Basically, I have some old code that has been given to me by someone else on this forum long ago, and I bumped in an issue. However, they seem to be less active and haven’t answered my DM.
The Issue: This code freezes people and doesn’t allow the character to move (Permanent effect inteded, part of the game), only jump. However, I tested for the first time outside of Studio, on a tablet, and it’s possible to use the built-in controls to move. I suppose this also applies to console…
local ContextActionService = game:GetService("ContextActionService")
local ACTION = "freezeMovement"
local Disable = {
Enum.PlayerActions.CharacterLeft,
Enum.PlayerActions.CharacterRight,
Enum.PlayerActions.CharacterForward,
Enum.PlayerActions.CharacterBackward,
}
-- Disable movement
local function disableMovement()
ContextActionService:BindAction(
ACTION,
function()
return Enum.ContextActionResult.Sink
end,
false,
unpack(Disable)
)
end
-- Enable movement
local function enableMovement()
ContextActionService:UnbindAction(ACTION)
end
local events = game:GetService("ReplicatedStorage").Events
events.Start.OnClientEvent:Connect(disableMovement)
events.End.OnClientEvent:Connect(enableMovement)
This is on a local script in StarterPlayerScripts