script.Parent.MouseClick:connect(function() game.Players.LocalPlayer.Character.Humanoid.Health = 0 end)
It's in a clickdector, its a script so if you click the brick, they die but wont work in-game, only works in studio
script.Parent.MouseClick:connect(function() game.Players.LocalPlayer.Character.Humanoid.Health = 0 end)
It's in a clickdector, its a script so if you click the brick, they die but wont work in-game, only works in studio
Alright, your problem is that you can't access LocalPlayer from a normal Script in a live Server.
Luckily, ClickDetectors' MouseClick returns an argument that is the Player who clicked, allowing you to do this:
script.Parent.MouseClick:connect(function(plyr)
plyr.Character.Humanoid.Health = 0
end)
DUDE
THANX AT ADARK
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
Is this in a LocalScript?
No
I'll try, again too put in local script
Local script failed