I’m trying to make a game and currently I ran into an issue. I can’t figure out why it won’t work.
Script:
local maps = game.ReplicatedStorage.Maps:GetChildren()
while true do
wait(3)
for i = 1,10 do
status.Value = "Intermission: "..10-i .. " seconds left."
end
local rand = math.random(1, #maps)
local map = maps[rand]:Clone()
map.Parent = workspace
status.Value = "Map chosen: " ..map.Name.. "!"
wait(2)
local players = game.Players:GetChildren()
for i = 1,#players do
if players[i].Character ~= nil then
local SpawnLocation = math.random(#1,workspace.Teleports:GetChildren())
players[i].Character:MoveTo(workspace.Teleports:GetChildren(SpawnLocation.Position))
end
end
end```
Error: ServerScriptService.GameScript:21: attempt to get length of a number value