I have put a TouchInterest and a script inside of a tool that you can pick up.
I want it so that when you pick this tool up, a textlabel changes (it is located: StarterGui > BtmText > Frame > TextLabel )
The code currently doesn't work and I need help with it.
The code right now:
function onTouched(hit) wait(.5) game.StarterGui.BtmText.Frame.TextLabel.Text = "You picked a keycard up!" end script.Parent.Parent.Touched:connect(onTouched)
Thanks - Frosty
When you touch an object, you would need to fire a RemoteEvent
to the client who stepped on it. And then have a Local Script
change the TextLabel to your desired text.
This might get you started...
function onTouched(obj) local character = obj.Parent local humanoid = obj.Parent:FindFirstChild("Humanoid") if humanoid then local player = game.Players:GetPlayerFromCharacter(character) -- FireEvent(player) end end script.Parent.Parent.Touched:Connect(onTouched)
https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events