Ueskay
|
  |
| Joined: 20 Jun 2014 |
| Total Posts: 824 |
|
|
| 03 Jan 2016 06:13 PM |
local character = game.Workspace.Player local player = game.Players:GetPlayerFromCharacter(character)
function OnClicked() player.Humanoid.Health = 0 end
script.Parent.ClickDetector.MouseClick:connect(OnClicked)
Error: Player is not a valid member of Workspace
|
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 06:27 PM |
[Hot Fix]
function OnClicked(plr) if plr:IsA('Player') and plr.Character then plr.Character.Humanoid.Health = 0 end end
script.Parent.ClickDetector.MouseClick:connect(OnClicked)
[Work not tested, not bested.] |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 06:37 PM |
^ Why would you check if the player is actually the classname 'player'? A bit pointless?
|
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 07:03 PM |
Just in case a supercomputer takes over the server for its evil purposes and begins eradicating us all, making sure it can't use that button.
[Work not tested, not bested.] |
|
|
| Report Abuse |
|
|
| |
|