I have been having a problem, I just started to learn how to use the ContextActionService and I made a speed button. The problem is, is that when you press the speed button it puts your speed to 32. But I wanna make it where when you press it again it sets your speed 16. Please help.
Code:
local cas = game:GetService("ContextActionService")
local player = game.Players.LocalPlayer
local char = player.Character
function buttonPress()
char.Humanoid.WalkSpeed = 32
end
local speedMobileButton = cas:BindAction("SpeedBtn",buttonPress,true,"d")
cas:SetPosition("SpeedBtn",UDim2.new(0.72,-25,0.20,-25))
cas:SetTitle("SpeedBtn", "Speed")
