Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

CFrame Teleporting doesn't work?

Hello,

So I got CFrame teleporting and it doesn't work Online. The code is made in "Script". Works in Studio, but not in Online

local Player = game.Players.LocalPlayer
Player.Character.Torso.CFrame = CFrame.new(Vector3.new(-142.6, 49.5, 46))

2 answers

✓ Accepted answer

I wouldn't use CFrame if I were you. I'd use MoveTo:

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(char)
		char:MoveTo(Vector3.new(-142.6, 49.5, 46))
	end
end)

The script loads before the character/torso exist, so you need to wait for them to load.

local Player=game.Players.LocalPlayer
local Character=Player.Character or Player.CharacterAdded:wait()
Character:WaitForChild("Torso").CFrame=CFrame.new(-142.6,49.5,46)

5 comments

0

Hey, Sadly it doesn't work Online or in Studio. Doesn't show any errors as well

0

Btw, that code comes after "Hint Talk" code

0

The spawn system may be overriding line 3 if you have any SpawnLocations.

0

I got 6 Spawn locations. How can I make them to get to SpawnLocations maybe? Without killing them

0

I don't understand what you just said.

This discussion is preserved as it was. New answers, comments, and votes are closed.