Server POV:
Client POV: (The movement isn’t the same, but the same problem persists)
This code is running when it happens:
local battleJoinLeave = {}
function battleJoinLeave.Join(char,plr,stage)
local function findSpot() -- Function to see if theres a spot open in battle.
for i=1,4,1 do
if stage.Players["Player"..i].Value == false then return stage.Players["Player"..i]
end end end
local spot = findSpot() -- Starts the function.
if spot ~= nil and char.Parent == game.Workspace then -- If there's a spot open and the char is in workspace. It's to prevent multiple events happening from one player and closing multiple spots in battle.
spot.Value = true -- Spot is taken so other players can't take it.
char.HumanoidRootPart.Position = stage.Entry.Position -- Teleports play to the battlefield (I think the problem happens here?)
char.Parent = spot -- Sets char parent to player spot, to prevent... you know.
plr.DevComputerMovementMode = Enum.DevComputerMovementMode.Scriptable -- Movement set is scriptable, so WASD, space etc cannot be used.
wait() -- Had to put wait in here, because else the character doesnt MoveTo() the spot.
script.setCamera:FireClient(plr, spot.cam) -- Sets camera position in another local script.
char.Humanoid:MoveTo(spot.pos.Position) -- Humanoid moves to the spot in battle.
char.Humanoid.MoveToFinished:Wait() -- Waits till movement is done.
tweenModule.linearTweening(0.5,char.HumanoidRootPart,{CFrame = CFrame.new(char.HumanoidRootPart.Position,stage.playerLookAt.Position)}) -- Character looks at a different angle.
end
end
return battleJoinLeave