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

why wont my instant humanoid.kill script work for my game?

local player = game.Players.LocalPlayer
local HumanoidHealth = player.Humanoid.Health
wait(10)
HumanoidHealth = 0

1 comment

0

You can't allocate properties as pointers, the compiler will simply just store its current value. Instead, use Humanoid.Health = 0.

2 answers

I should be commenting this instead since it's a simple thing, here anyways

local player = game.Players.LocalPlayer
local HumanoidHealth = player.Character.Humanoid.Health
wait(10)
HumanoidHealth = 0

The player is the player, We're getting the character from the player. So player.Character

you forgot to mention the player!:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local HumanoidHealth = character.Humanoid.Health
wait(10)
HumanoidHealth = 0

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