My script resets a player when a tool is selected and "r" is pressed. The script is a LocalScript and is in a Tool.
function onKeyDown(key) key:lower() if key == "r" then game.Players.LocalPlayer.Character.Humanoid.Health = 0 end end function onSelected(mouse) mouse.KeyDown:connect(onKeyDown) end script.Parent.Selected:connect(onSelected)
But it doesn't do anything. Can anyone help me out?
I've tested this in studio, and it seems to work just fine. Perhaps you made it a Script instead of a LocalScript?