So I have this code that theoretically teleports the players in the lobby into the block part on the race track when the race cars are created and the race is ready to start.
local lobbySpawn = game.Workspace.LobbySpawn
local trackSpawn = game.Workspace.TrackSpawn
function teleportPlayers(target)
for _, players in pairs(game.Players:GetChildren()) do
local character = player.Character
local torso = character.Torso
torso.CFrame = target.CFrame
end
end
teleportPlayers(trackSpawn)
I get this error:
attempt to index global 'player' (a nil value)

2 comments
gg
The problem is that. Also I have been testing with an R15 character, how do I convert him into to an R6 character in script.