game.Players.PlayerAdded:Connect(function(pl) pl.CharacterAdded:Connect(function(char) local pos = CFrame.new(22, 10, 0) char:SetPrimaryPartCFrame(pos) end) end)
This code does not teleport code, but if you add wait (1), it works. How to do without wait?
game.Players.PlayerAdded:Connect(function(pl) pl.CharacterAdded:Connect(function(char) local torso = char:WaitForChild("Torso") or char:WaitForChild("UpperTorso") local pos = CFrame.new(22, 10, 0) torso.CFrame = pos end) end)
I found the only solution which works is to make a Local Script in StarterCharacterScripts with code:
local char = script.Parent local pos = CFrame.new(22, 10, 0) char:SetPrimaryPartCFrame(pos)
You should replace the inner event with a WaitForChild like this:
game.Players.PlayerAdded:Connect(function(pl) local char = pl:WaitForChild("Character") local pos = CFrame.new(22, 10, 0) char:SetPrimaryPartCFrame(pos) end)