I’ve been trying so long, so please don’t take this as a rant. I’m just really frustrated.
Here’s my script. It’s parented to StarterGUI, so it runs. I’ve printed and it works. It’s basically a combination of all of the workarounds I’ve seen on the Internet.
-- this script is a final attempt at removing jumping (i hate mobile)
local cas = game:GetService("ContextActionService")
local rs = game:GetService("RunService")
local plr = game.Players.LocalPlayer
plr.CharacterAdded:Wait()
plr:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
script.Parent:WaitForChild("TouchGui")
:WaitForChild("TouchControlFrame")
:WaitForChild("JumpButton")
:Destroy()
local timeout = 10
local timeCur = 0
local connection : RBXScriptConnection
connection = rs.Heartbeat:Connect(function(step)
timeCur += step
if timeCur > timeout then connection:Disconnect() end
if cas:GetAllBoundActionInfo()["jumpAction"] then
print("yay")
cas:UnbindAction("jumpAction")
if connection.Connected then connection:Disconnect() end
end
end)
Why does this not hide the jump button? Is there a specific thing I have to do?