is there an onButtonRelease() type function in contextaction?
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!!
1 | local contextActionService = game:GetService( "ContextActionService" ) |
2 | function onButtonPress() |
3 | game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25 |
5 | local mobilebutton = contextActionService:BindAction( "RunButton" ,onButtonPress, true , "Shift" ) |
6 | contextActionService:SetPosition( "RunButton" ,UDim 2. new( 0.72 ,- 25 , 0.20 ,- 25 )) |