local serverstorage = game:GetService("ServerStorage")
local playerlist = game:GetService("Players")
local tracksstorage = serverstorage:WaitForChild("Tracks"):GetChildren()
local workspacetrackfolder = game.Workspace.Track
local values = game.Workspace.Values
local racefolder = values.Race
local trackfolder = values.Track
local racestarted = racefolder.RaceStarted
local raceended = racefolder.RaceEnded
local racechoosed = trackfolder.RaceChoosed
game.Players.PlayerAdded:Connect(function(plr)
local gui = plr.PlayerGui:WaitForChild("RaceSetup")
local text1 = gui.TrackName
while wait(0.2) do
if racestarted.Value == true then
print("a")
if racechoosed.Value == false then
print("Race choosed!")
local choosedtrack = tracksstorage[math.random(1, #tracksstorage)]
local currenttrack = choosedtrack:Clone()
currenttrack.Name = choosedtrack.Name
currenttrack.Parent = game.Workspace.Track
currenttrack.CFrame = CFrame.new(game.Workspace.MapSpawner.Position)
print("Ready for use!")
text1.Text = "Track Name : "..currenttrack.Name
racechoosed.Value = true
local spawnpoint = currenttrack:GetChildren("Spawn")
for i, players in pairs(game.Players:GetChildren()) do
players.Character.HumanoidRootPart.CFrame = CFrame.new(spawnpoint.Position) + Vector3.new(i*math.random(-2,2), i*2, 0)
print("Teleported players!")
end
else
print("Race already choosed")
end
end
end
end)
31: invalid argument #1 to 'new' (Vector3 expected, got nil)
It doesn't teleport all of the players in the part's CFrame and i wanna do so they get teleported all over the part (like big spawnlocations usually do)
This is for a racing game.

2 comments
i'll check that tommorow, gotta sleep.
It will for sure work thats your problem welp gn