#help with local scripts, touch functions, and chats
22 messages · Page 1 of 1 (latest)
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
ok :DDDDDDDDDDDDD
local scripts dont run under workspace
only starter player scripts and startergui (playergui)
@lavish tide
LocalScripts can run in:
- Everything inside the player
- ReplicatedFirst
You can also make a regular script, then set the runcontext to Client
But it will run for every client when it loads
It's insecure anyway
LocalScripts only run on the client who's player or character their a descendant of
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)
👍
THATS EXACTLY WHAT I NEED
ok it didnt work
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
