You can write your topic however you want, but you need to answer these questions:
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
What is the issue? Include screenshots / videos if possible!
I have completed no clue how
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.
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