Greetings fellow ROBLOXians
can i get some help on my script?
------------------------------------------------
player = game.Players.LocalPlayer
mouse = player:GetMouse()
mouse.KeyDown:connect(function(key)
if key == "2" then
player.Character.Humanoid.WalkSpeed = 50
mouse.KeyDown:connect(function(key)
if key == "2" and player.Character.Humanoid.WalkSpeed == 50 then
player.Character.Humanoid.WalkSpeed = 16
end
end)
end
end)
---------------------------------------------------------------------------------------------
"2" = ctrl key when i press the ctrl key my walkspeed will be 50
however when i press the ctrl key again it says like this can i get some he
COMMUNITY QUESTION
What's wrong with my script?
1 answer
When you put the key as "2," I think it's listening for the literal 2 number key. Try replacing line 9 on your posted script to if key:byte() == "2" then. That will make it listen for the key whose byte code is 2.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Same with the other line where you have an if statement.
that byte thing doesn't work
when i added :byte() to key the whole script won't work anymore