Scripting Gripping System

	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?

1 Like

This is honestly a really bad method of achieving this. Can you explain what you’re trying to do?

When the player health reaches 10 then the player need to stops moving and then it plays a knocked animation. I dont want to anchor the player cause it causes bugs.

The solution in here helped me fix my solution. If your having the same problem check this out.
Ragdoll low health script doesn’t work properly - Help and Feedback / Scripting Support - DevForum | Roblox

1 Like