Hay Developers, I need some help making a teleportation script! Here is what I need to do: Make it so that the game tp’s all players to a set location. Please respond if you know how!
You can use a for loop to teleport either by model:SetPrimaryPartCFrame(cframe) or setting the humanoidrootpart’s position.
Script
local players = game:GetService("Players")
for _,player in pairs(players:GetPlayers()) do
local char = player.Character
if char then
char:SetPrimaryPartCFrame(...) -- cframe
end
end
In a server script, loop through all players and set their character’s primary part to where you want them to end up.
That is spoonfeeding, which isn’t allowed. Also, ipairs well looping through the players (or any table) is faster then pairs by about 20% which can be quite useful.
The rules says that it must be meaningful and contributive, it won’t be allowed if i weren’t to describe how this works.
Still I see people describe and contribute, and spoonfeed mostly for help or as an example of what it would look like, and Yes i’m aware they won’t learn but this is definitely an example.
You’re right, and I’m wrong. I didn’t see the part where you explained it.