How do I make a button toggle some piece of code? and then when pressed again toggle another piece of code. I want to make a sprint feature which will be toggled by the press of the button q. This is my attempt.
Username = LocalPlayer
local on = false
local sprinting = true
if q is pressed then
on = true
sprinting = true
else
end
if sprinting = true then
game.Workspace.Username.Humanoid.WalkSpeed = speed
end

1 comment
Thank you! It worked flawlessly!