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

How can i change walkspeed for a specific tool?

Asked by 6 years ago

What I mean by this is, when you equip the tool, you will either go faster, or slower, or unmovable.

0
You can just do (In a LocalScript) - game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = VALUE (put this where the equipping of the tool happens) - 16 is default WalkSpeed. xEiffel 280 — 6y
0
Worked fine, but what I meant was you should able get back to default speed after unequipping FinePineApple1 0 — 6y
0
insert that code into the tool FlippinAwesomeCrew 62 — 6y

1 answer

Log in to vote
0
Answered by
Mayk728 855 Moderation Voter
6 years ago

Sure you can. You need an event for when the tool is activated and a value to check when it's enabled or not.

local Tool = script.Parent
local plr = game:GetService('Players').LocalPlayer
local Enabled = false

Tool.Activated:Connect(function()
    if not Enabled then
        Enabled = true
        plr.Character.Humanoid.WalkSpeed = 25
    else
        Enabled = false
        plr.Character.Humanoid.WalkSpeed = 16
    end
end)
0
Can you remove the numbers please? SillyMayo 0 — 4y
Ad

Answer this question