okay so i have the code on how to move a character:
script.Parent.Touched:Connect(function(s) local position = Vector3.new(91, 0.5, 131.75) local humanoid = script.Parent:WaitForChild("Humanoid") humanoid:MoveTo(position) end)
but i need to know how to make a character cancel its manual movement. (like have it controlled, but the player themselves cant manually move via arrow or wasd keys)
im planning to make a game like one of of those "tifany mayumi" gamer games.
pls help?
You can use the context service for this:
local ContextActionService = game:GetService("ContextActionService") local FREEZE_ACTION = "freezeMovement" ContextActionService:BindAction( FREEZE_ACTION, function() return Enum.ContextActionResult.Sink end, false, unpack(Enum.PlayerActions:GetEnumItems()) ) --to unfreeze ContextActionService:UnbindAction(FREEZE_ACTION)
original: here