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

How do you reference humanoid?

I don't know how to reference humanoid. I try to reference by: game.workspace.Humanoid.Health =400 Then I get an error "Humanoid is not a valid member of workspace". I

1 comment

0

it's easy, i'll answer it.

1 answer

✓ Accepted answer
local player = game.Players
local Char = player.Character
local Hum = Char.Humanoid -- or Char:WaitForChild("Humanoid")

Humanoid.Health = 400
Humanoid.MaxHealth = 400

5 comments

0

(LOCAL SCRIPT BTW)

0

game.Players is a service, it should be game.Players.LocalPlayer

0

You'll need a RemoteEvent if you want to change the player's health, client-side only affects player physics

0

I messed that up

0

You don't need a remote event!!

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