Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local LocalPlayer = Players.LocalPlayer
- local resetThreshold = 10 -- Kill if HP is 10 or lower
- RunService.Heartbeat:Connect(function()
- local char = LocalPlayer.Character
- if char then
- local hum = char:FindFirstChildOfClass("Humanoid")
- if hum and hum.Health > 0 and hum.Health <= resetThreshold then
- hum:ChangeState(Enum.HumanoidStateType.Dead)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement