Why am I not teleporting?

I want the player to teleport to a plot when they join but for some reason the problem is that torso for some reason doesent exist please help. The game is in R6

1 Like

You didnt wait for the Character of the player so it thinks its nil, so basically just wait for the Character like this

local character = player:WaitForChild("Character")

EDIT : If it worked mark me as a solution! @CoolSpaace

2 Likes

Never mind that does not work ,.

1 Like

It says that now theres a infinite yield

1 Like

Showing the full script will help me be bale to help you a bit more

1 Like

Is the character r15 or r6 because torso does not exist in r15

1 Like

R6

1 Like

Its saying whats he trying to index is nil

2 Likes

You have to use a chharacter added event, like so

player.CharacterAdded:Connect(function(character)
      --
end

@CoolSpaace

2 Likes

Do humanoidrootpart, as thats on all players.

1 Like

Thats not the problem, the problem is that he doesnt have acess to the character

From the first error, it seems like Character does not exist.

If you’re working from a server script, you can try connecting to the player.CharacterAdded event, Player | Documentation - Roblox Creator Hub.

I would highly recommend you to set the primary part’s CFrame (or the HumanoidRootPart) instead of any other part.

2 Likes

but if I do use character event how am I getting player

Just put the character added event inside of the player added event

1 Like

From the game.Players.PlayerAdded event

1 Like

I added it but now theres no errors and it still doesent tp the player

Show the code again but this time paste it in

local plot = script.Parent.Parent.Plot
local owned = false

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if owned == false then
owned = true
plot.Name = player.Name…“'sPlot”
character.Torso.CFrame = CFrame.new(plot.Spawn.Position) + Vector3.new(0, 3, 0)
end
end)
end)

Do character.HumanoidRootPart.CFrame instead, its the main part AND all character types have it.

1 Like