Using Humanoid:MoveTo() on a player character without having player input disrupt it?

Hello, im trying to make a script that whenever a player collides with a part. It will make the player move to a specific part with an offset before teleporting them (sort of like a cutscene i guess). Which is mostly working but the issue is that the player can simply disrupt the :MoveTo() by using their movement keys. Is there a way to stop the player being able to move for a moment but still being able to use :MoveTo()

(the script im using to teleport is a server script, Would i have to use remoteevents to do it or is there a way i can do it through the server?)

you can disable character controls this way:

local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local PlayerScripts = localPlayer:WaitForChild("PlayerScripts")
local PlayerModule = require(PlayerScripts:WaitForChild("PlayerModule"))
local Controls = PlayerModule:GetControls()


Controls:Disable()

task.wait(5)
local character = localPlayer.Character
character.Humanoid:MoveTo(Vector3.new(10000,0,0))
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.