Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you reference humanoid?

Asked by 4 years ago

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

0
it's easy, i'll answer it. DayLighter_1995 8 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
local player = game.Players
local Char = player.Character
local Hum = Char.Humanoid -- or Char:WaitForChild("Humanoid")

Humanoid.Health = 400
Humanoid.MaxHealth = 400
0
(LOCAL SCRIPT BTW) DayLighter_1995 8 — 4y
0
game.Players is a service, it should be game.Players.LocalPlayer cherrythetree 130 — 4y
0
You'll need a RemoteEvent if you want to change the player's health, client-side only affects player physics cherrythetree 130 — 4y
0
I messed that up DayLighter_1995 8 — 4y
0
You don't need a remote event!! KadenBloxYT 135 — 4y
Ad

Answer this question