Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I increase a player walkspeed when equipped?

How do I change the player walkspeed without changing their actual speed?

local Player = game.Players.LocalPlayer.Character

script.Parent.Equipped:connect(function(equip)
	if equip then
		Player.Humanoid.WalkSpeed = Player.Humanoid.WalkSpeed + 5
	end
end)

QUESTION 2: Can this work with Tools unequipped?

1 answer

✓ Accepted answer

The error in your script is that you did not give time for the character to load and I recommend using CharacterAdded next time

Here's the script:

local Player = game.Players.LocalPlayer
local char = Player.CharacterAdded:Wait(20) --Wait for Player Character to load, Max wait time 20 seconds

script.Parent.Equipped:Connect(function()
	char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + 5 --Add 5 speed to Player WalkSpeed
end)

script.Parent.Unequipped:Connect(function()
	char.Humanoid.WalkSpeed = 16 --Makes Player WalkSpeed to default on unequip
end)



and yes Unequip works

2 comments

0

it can work if i do char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed - 5?

0

yes it will work too

This discussion is preserved as it was. New answers, comments, and votes are closed.