RepuIsed
|
  |
| Joined: 19 Sep 2016 |
| Total Posts: 47 |
|
|
| 20 May 2017 05:39 PM |
local h = game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
if h.MaxHealth == 0 then h.Health = 0 |
|
|
| Report Abuse |
|
|
LinkMe
|
  |
| Joined: 30 Apr 2009 |
| Total Posts: 512 |
|
|
| 20 May 2017 05:42 PM |
| You're missing an 'end' to close the if statement. |
|
|
| Report Abuse |
|
|
RepuIsed
|
  |
| Joined: 19 Sep 2016 |
| Total Posts: 47 |
|
|
| 20 May 2017 05:42 PM |
| already had that but it still doesn't work |
|
|
| Report Abuse |
|
|
Cyrakohl
|
  |
| Joined: 09 Nov 2014 |
| Total Posts: 3197 |
|
|
| 20 May 2017 05:46 PM |
Is this a local script? also it's "FindFirstChild" not findFirstChild
|
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 20 May 2017 05:48 PM |
:findFirstChild works
My guess is that Character is nil
write the whole code like this
local player = game.Players.LocalPlayer
player.CharacterAdded:wait()
And then do all the same things
|
|
|
| Report Abuse |
|
|
|
| 20 May 2017 07:00 PM |
local h = game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
if h then -- define the humanoid.
if h.MaxHealth == 0 then h.Health = 0
--This works.^
|
|
|
| Report Abuse |
|
|