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)