Disable Player Movement While Using MoveTo

Hello, I am trying to disable player movement while using the Humanoid:MoveTo method.

However, nothing seems to work. It needs to be server-sided so other players can see that player moving, however, I’ve tried firing events, etc, but nothing seems to work.

script.Parent.Touched:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if player then
		print('worked')
        game.ReplicatedStorage.yes:FireClient(player)
		wait()
		player.Character.Humanoid:MoveTo(workspace.Folder.One.Position) 

	end
end)
game.ReplicatedStorage.yes.OnClientEvent:Connect(function()
	local Controls = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")):GetControls()---GetControls

	Controls:Disable()
end)
1 Like

Did you mean to fire to the player? Since you’re firing from Server to Client, the first parameter of the RemoteEvent will always be the player (unless your are using :FireAllClients())

game.ReplicatedStorage.yes:FireClient(player)

oops didn’t add that, but yes i fixed it to that… still nothing

Never mind, figured it out. My local script was under workspace smh

1 Like