How to make a slow walkspeed when damaged

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to a make a jailbreak like script that when you get damaged your walkspeed lowers

  2. What is the issue? Include screenshots / videos if possible!
    I have completed no clue how

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

3 Likes

You can do when the player health is 70, you change the walk speed to 13.5

Hey, try using this. This is just a script that defines the player’s Humanoid and connects a HealthChanged event to it. When their health changes, it will set their WalkSpeed to their new health times 0.16. This means their WalkSpeed will gradually decrease as their health decreases.

local Character = script.Parent
local Humanoid = Character.Humanoid
		
Humanoid.HealthChanged:Connect(function(Health)
	Humanoid.WalkSpeed = Health * 0.16
end)

Edit: This script should be a server script in StarterPlayer → StarterCharacterScripts

2 Likes

Can this script be in ServerScriptService?

For that you would need to use PlayerAdded and CharacterAdded events.