Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this TeleportService not working?

Asked by 10 years ago

When a player with BC joins the game, I want them to be teleported to the BC version of the game. For some reason, I can't seem to get this to work. What am I doing wrong?

game.Players.PlayerAdded:connect(function(player)
    if player.MembershipType ~= Enum.MembershipType.None then
        game:GetService("TeleportService"):Teleport(140909480, player)
    end
end)

2 answers

Log in to vote
1
Answered by 10 years ago

Allowing a small wait time before the teleport might work. Also, did you try it from the site? Cause it doesn't work from Studio.

Ad
Log in to vote
0
Answered by 10 years ago

Also, I've noticed that some things just need to be set as a local variable to work right, such as FindFirstChild(). So try seeing if this works: game.Players.PlayerAdded:connect(function(player) if player.MembershipType ~= Enum.MembershipType.None then local tel = game:GetService("TeleportService") tel:Teleport(140909480, player) end end)

Answer this question