while true do
wait(0.1)
while Character.Humanoid.Health <= 10 do
if Character:FindFirstChild("HumanoidRootPart") and Character:FindFirstChild("Humanoid") then
local knocked = Instance.new("BoolValue")
knocked.Name = "Knocked"
knocked.Parent = Character
hum.Jump = false
--hum.AutoRotate = false
--hum.PlatformStand = true
hum.JumpPower = 0
hum.WalkSpeed = 0
wait(1.5)
local hit = Instance.new("BoolValue")
hit.Name = "Hit"
hit.Parent = Character
game.Debris:AddItem(hit,15)
hum.JumpPower = 0
hum.WalkSpeed = 0
--Character.HumanoidRootPart.Anchored = true
--anim:Play()
--wait(0.9)
anim2:Play()
wait(10)
if anim2 then
anim2:Stop()
end
if Character:FindFirstChild("Knocked") then
Character:FindFirstChild("Knocked"):Destroy()
end
Character.HumanoidRootPart.Anchored = false
--hum.PlatformStand = false
--hum.AutoRotate = true
hum.JumpPower = 50
hum.WalkSpeed = 16
end
end
end
end)
end)
The player walkspeed turns to 0 but as soon as the player presses w. The walkspeed changes back to 16. Or if you know a better way to make this?