local gameSpawn = game.Workspace.gameSpawn
local lobbySpawn = game.Workspace.Lobby.lobbySpawn.lobbySpawn
local minimumGameSpawn = 1
local minimumLobbySpawn = 4
local function teleportPlayers(target)
for i,v in ipairs(game.Players:GetChildren()) do
pcall (v.character.HumanoidRootPart.CFrame = target.CFrame)
end
end
wait(5)
print("Racers To Your Karts")
wait(2)
teleportPlayers(gameSpawn)
I have an error at the equal sign at
pcall (v.character.HumanoidRootPart.CFrame = target.CFrame)"
The error states :
Expected ')' (to close "(" at column 8), got '='

4 comments
pcall has a lot of useful functionality to it, in my opinion. It makes scripts a lot safer. If you had a large script without pcall, and it happened to come across an error in-game, then it would end up breaking the script. You can also use it for bug testing.
Whats i pairs i still dont understand
16:04:44.772 - ServerScriptService.Script:8: bad argument #2 to 'random' (interval is empty)
nvm i think i foudn the problem i forgot to defien variable but still i dont understad how you want me to define target. The model i want to tp to is called gameSpawn