Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Anyone Know How to Get This to Work?

local player = game.Players.LocalPlayer.Character

if player then
	player.Humanoid.Health = 10
end

3 answers

I don't see any errors. You might want to do this.

local player = game.Players.LocalPlayer.Character
while player == nil do wait() end
player.Humanoid.Health = 10

You shouldn't really say 'if player then'. I believe that was your problem as to why it was not working previously.

1 comment

0

Should I just take it out or?

@l0cky2013 That didn't work either. That is meant for a local script, correct?

2 comments

0

Yeah, make sure it is in either StarterPack or StarterGui.

0

StarterPack didn't work?

This discussion is preserved as it was. New answers, comments, and votes are closed.