I need to change the text of a TextLabel to the word "HI" when a part is touched. It won't work, though. The TextLabel is in a ScreenGui in StarterGui. This script is in a part in the Workspace. Can someone tell me what I'm doing wrong?
script.Parent.Touched:connect(function(hit)
if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
script.Parent:Destroy()
game.Player.LocalPlayer.PlayerGui.ScreenGui.Total.Text = "HI"
end
end)

1 comment
Is it in a LocalScript?