✓ Accepted answer
Hello! There are a few ways you could go about this actually.
The first method is using Humanoid:LoadCharacter()
local Player = game:GetService("Players").LocalPlayer
local humanoid = Player.Character:FindFirstChild("Humanoid")
humanoid:LoadCharacter()
The second method you can use is changing the humanoids health to 0
local Player = game:GetService("Players").LocalPlayer
local humanoid = Player.Character:FindFirstChild("Humanoid")
humanoid.Health = "0"
The last method that I know of is using the humanoid TakeDamage function
local Player = game:GetService("Players").LocalPlayer
local humanoid = Player.Character:FindFirstChild("Humanoid")
humanoid:TakeDamage(100)
I hope this was able to help you! Any questions? Comment down below, and I'll be glad to help!
Don't forget to mark as the solution if this helps you!
5 comments
attempt to index upvalue 'humanoid' (a nil value)
Channge :FindFirstChild to :WaitForChild("Humanoid")
And make sure you spell Humanoid with a capital "H", LUA is case sensitive!
nice, now it works, thank you!
No problem! Happy scrpting!