So i tired to make a move where the character moves faster, here is the code:
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
Activate = false
--Activate
Mouse.KeyDown:connect(function(key)
key = key:lower()
if key ~= "z" then return end;
if Activate == false then
Player.Character.Humanoid.WalkSpeed = Player.Character.Humanoid.WalkSpeed +35
Activate = true
end
end)
--Deactivation
Mouse.KeyDown:connect(function(key)
key = key:lower()
if key ~= "z" then return end;
if Activate == true then
Player.Character.Humanoid.WalkSpeed = Player.Character.Humanoid.WalkSpeed -35
Activate = false
end
end)
So is there anyway, to make the activation and deactivation work?

1 comment
First, don't use
Mouse.KeyDown. UseUserInputService.InputBeganinstead. The former is deprecated.