The problem you’re experiencing here is that the client is the network owner of their character controller, not the server.
So the server is telling the Humanoid to move, but the Humanoid is actually being controlled by the Character.
To solve this, remove the :MoveTo call from the server, and move to to the client - something like this:
-- LocalScript (obviously)
local Players = game:GetService("Players")
local ContextActionService = game:GetService("ContextActionService")
local FREEZE_ACTION = "freezeMovement"
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
game.ReplicatedStorage.FreezePlayer.OnClientEvent:Connect(function(State, TargetGoal)
if State == true then
ContextActionService:BindAction(
FREEZE_ACTION,
function()
return Enum.ContextActionResult.Sink -- need to explicitly return this
end,
false,
unpack(Enum.PlayerActions:GetEnumItems())
)
Humanoid:MoveTo(TargetGoal)
Humanoid.MoveToFinished:Wait() -- I assume you want to unfreeze when they get there
ContextActionService:UnbindAction(FREEZE_ACTION)
elseif State == false then
ContextActionService:UnbindAction(FREEZE_ACTION)
end
end)
Sorry about the awful formatting