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

How can I teleport all players who enter my world to a certain location?

Asked by 8 years ago

I have been trying to make this work in a normal script, the code executes the "Moving to #1" print, but it does not actually move the character, and I have no idea why that is. The path to the SpawnPoint is correct.

01--Waiting for players to load
02while #game.Players:GetPlayers() == 0 do
03    wait()
04end
05 
06--Teleports player to #1
07for _, player in pairs(game.Players:GetPlayers()) do   
08 
09    --prints out amount of players
10    print(#game.Players:GetPlayers())
11 
12    local character = player.Character or player.CharacterAdded:Wait()
13    local SpawnPoint = game.Workspace.Plots.Plot_1.SpawnPoint
14 
15    --If Character is loaded
View all 22 lines...

any ideas?

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

**Try this **

1character.Torso.CFrame = SpawnPoint.CFrame
0
My problem was the fact some of the bricks was not loaded yet. But nevertheless, my problem got solved. Not by this, but I guess this could work aswell. I'll accept your answer. Codegasm 0 — 8y
Ad

Answer this question