I am trying to teleport a player to a certain position when spawning by using a script. It does everything except teleport.
player.CharacterAdded:Connect(function(char) char:WaitForChild("Humanoid") char.Humanoid.Torso.CFrame = CFrame.new(0,-1245,0) char.Humanoid.WalkSpeed = 0 char.Humanoid.JumpPower = 0 char.Head.BrickColor = BrickColor.new("Bright yellow") char["Left Arm"].BrickColor = BrickColor.new("Bright yellow") char["Right Arm"].BrickColor = BrickColor.new("Bright yellow") char.Torso.BrickColor = BrickColor.new("Electric blue") char["Left Leg"].BrickColor = BrickColor.new("Shamrock") char["Right Leg"].BrickColor = BrickColor.new("Shamrock") local ForceField = Instance.new("ForceField") ForceField.Visible = false ForceField.Parent = char local healthScript = char:WaitForChild("Health") healthScript:Destroy() events.GameLoaded:FireClient(player) end)
There’s some kind of weird delay between the character getting parented and the character actually being move-able. I wouldn’t recommend CFraming the player’s position on the server. What could happen is the client may send a packet to the server giving position information for their avatar, which could then override the server’s position.
Teleport the player on the client when they spawn, so that it’s more guaranteed that the player will be at that position.