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

Can I teleport a specific player to a position when they join?

Asked by 6 years ago

Hi, I want to teleport 1 specific player when they join the game without having to touch a brick. I know how it would work, it would keep checking every time someone joined and if they had the correct name the would teleport to a part or location. It is just that I do not have much experience in scripting and would really love some help with this.

1 answer

Log in to vote
1
Answered by
xEiffel 280 Moderation Voter
6 years ago

You could do this by using the PlayerAdded Function and the :MoveTo() Yield Function.

local PlayersTriggered = {"tictac67", "Player1"} --//Names of players that trigger when they join

game.Players.PlayerAdded:Connect(function(Player) --//Player = Player's Name that joined
    Player.CharacterAdded:Connect(function(Character)
        if PlayersTriggered[Player.Name] then
            Character:MoveTo(workspace:FindFirstChild("INSERT BRICK NAME HERE").Position)
        end
    end)
end)
0
Thanks :) tictac67 96 — 6y
Ad

Answer this question