humanoid:GetState() == Enum.HumanoidStateType.Dead then
Im using this in a if statement, and it doesn't work. It is in a local script. Asking before bed so wont answer for 8 hours.
Thanks for the help.
humanoid:GetState() == Enum.HumanoidStateType.Dead then
Im using this in a if statement, and it doesn't work. It is in a local script. Asking before bed so wont answer for 8 hours.
Thanks for the help.
You can use a loop to check if the State is dead. Example:
while wait() do -- The loop, add the wait() so it doesnt crash
if humanoid:GetState() == Enum.HumanoidStateType.Dead then -- If there's already a variable called humanoid in your script
print("He's dead")
end
end
Hope this helps.
You can try this
if humanoid.health = 0 then
print("I think he is D e a d")
end
There is an event called died that can be fired, syntax is like this:
local humanoid=script.Parent.Humanoid
humanoid.Died:Connect(function()
print("I Died")
end)
make a local script inside of starterpack and type this
local hum = game.Players.LocalPlayer
if hum.Character.Health == 0 then
print("Player Has Died"
if this helped accept my answer!
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
you doing this on a loop? if not, try placing it on one
Try adding a "wait()" in the script so it doesn't execute immediately when the game starts