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

is there an onButtonRelease() type function in contextaction?

Asked by 5 years ago

I'm very new to experimenting with Mobile device scripting. So i scripted this for a run Gui only available on mobile devices. Problem is I can't seem to get the run to deactivate. Is there a onButtonRelease() function ? i could'nt use an "if" and a boolvalue as false/true. i couldnt manage using debounce. i just havent figured out why i cant get back to 16 walkspeed. so i took out most of my script and maybe someone can help me out a bit.

Thanks in advance!!

local contextActionService = game:GetService("ContextActionService")
function onButtonPress()
    game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25
end
local mobilebutton = contextActionService:BindAction("RunButton",onButtonPress,true,"Shift")
contextActionService:SetPosition("RunButton",UDim2.new(0.72,-25,0.20,-25))

Answer this question