Hi, I made TimeStop script inside PlayerCharacterScripts and I need to try it on mobile, and I made a Bindable Event and it won show on phone screen. Is possible to make a Bindable Event outside of StarterGUI?
There is code from Local Script that is in PlayerCharacterScripts:
local CAS = game:GetService("ContextActionService")
local holding = false
function Handler(Name, InputState)
if not holding and Name == 'TimeStop' then
holding = true
RE:FireServer("Begin")
Mmodule.Animator(Player, S.AnimationId , 1, true)
elseif holding and Name == "TimeStop" then
holding = false
RE:FireServer("Ended")
Mmodule.Animator(Player, P.AnimationId , 1, false)
end
end
-- I tried these:
CAS:BindAction('TimeStop', Handler, UIS.TouchEnabled, Enum.UserInputType.MouseButton2)
CAS:BindAction("TimeStop", UIS.TouchEnabled, Enum.UserInputType.MouseButton2)
CAS:BindActivate(Enum.UserInputType.Touch, Enum.UserInputType.MouseButton2)
-- Note: I did not get any errors while trying these