#help with local scripts, touch functions, and chats

22 messages · Page 1 of 1 (latest)

lavish tide
#

ok so..... whenever i touch a block, its supposed to teleport me to the value of WinRoomCFrame (CFrameValue), then chat, (person who touched it's name) "has beaten" (value of TowerName (StringValue))"!", with the color of DifficultyColor (Color3Value)

#

i have 2 versions of the script, but the normal script is the most responsive, teleporting me and sending an error that chats can only be sent with local scripts

#

while the local script doesnt do anything at all

ionic stone
#

cold

#

put in starter char tho

lavish tide
#

ok :DDDDDDDDDDDDD

carmine grove
#

local scripts dont run under workspace

#

only starter player scripts and startergui (playergui)

#

@lavish tide

pulsar lance
#

LocalScripts can run in:

  • Everything inside the player
  • ReplicatedFirst
random spindle
#

You can also make a regular script, then set the runcontext to Client

#

But it will run for every client when it loads

pulsar lance
#

It's insecure anyway

random spindle
#

LocalScripts only run on the client who's player or character their a descendant of

pulsar lance
#

That's in short what I said, the character is inside the player as well.
(Well the model itself is in workspace but you get the point)

random spindle
#

👍

lavish tide
#

ok it didnt work

lavish tide
#

theres more to my problem now, i need the chat to be the color thats stored in difficulty color

#
    if not hit or not hit.Parent then 
        return 
    end
    local human = hit.Parent:findFirstChild("Humanoid")
    if human and human:IsA("Humanoid") then
        human.Parent.HumanoidRootPart.CFrame = script.WinPadValue.Value.WinRoomCFrame.Value
        game:GetService("TextChatService").TextChannels.RBXSystem:DisplaySystemMessage(human.DisplayName.." has beaten "..script.WinPadValue.Value.TowerName.Value.."!")
        end
    end
script.WinPadValue.Value.Touched:connect(onTouched)```
#

thats my code