Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I increase a player walkspeed when equipped?

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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

0
it can work if i do char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed - 5? TheBuliderMC 84 — 4y
0
yes it will work too SUPERMEGADANTHEMAN 33 — 4y
Ad

Answer this question