|
| 01 Oct 2017 11:13 PM |
I have a small script and I dont know how to set a players health to 0
if game.Players.LocalPlayer.leaderstats.Hunger.Value == 0 then game.Players.LocalPlayer.Humanoid.Health = 0 end
help???? |
|
|
| Report Abuse |
|
|
Sukadia
|
  |
| Joined: 25 Jan 2013 |
| Total Posts: 500 |
|
|
| 01 Oct 2017 11:15 PM |
The player's HP is in workspace.
game.Workspace.LocalPlayer.Humanoid.Health = 0
|
|
|
| Report Abuse |
|
|
|
| 01 Oct 2017 11:22 PM |
| i couldnt get that to work :P |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Sukadia
|
  |
| Joined: 25 Jan 2013 |
| Total Posts: 500 |
|
|
| 01 Oct 2017 11:30 PM |
LocalPlayer only works on local scripts. You're going to have to change it to that.
|
|
|
| Report Abuse |
|
|
|
| 01 Oct 2017 11:30 PM |
| Try adding a print right before the health setting line to see if it runs at all |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2017 11:34 PM |
| would i put the local script in starterpack/gui or in the workspace? |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2017 11:44 PM |
| LocalScripts have to be parented under the player or character |
|
|
| Report Abuse |
|
|
|
| 02 Oct 2017 12:43 AM |
| game.Players.LocalPlayer.Character.Humanoid.Health = 0 |
|
|
| Report Abuse |
|
|
|
| 02 Oct 2017 08:13 PM |
| None of it worked :P i dont know what im doing wrong?! |
|
|
| Report Abuse |
|
|