How would I fix my ContextActionService script?
Here's the problem: When using game:GetService('ContextActionService')
to make mobile controls for my game, I use a debounce called Allowed
. It controls whether the buttons should be active or not. I tried to use this code to make it happen:
1 | local CAS = game:GetService( 'ContextActionService' ) |
4 | CAS:BindAction( 'function' , predefinedfunction, true , Enum.KeyCode.Z) |
The code seemed fine to me, until I tested it. Immediately after Allowed
was set to true, It spammed the function it was binded to. I can't seem to figure out why.
Please help.