Ok.. So I've been working on a snowball fight game as a basic project to start my scripting on, but for some reason my code doesn't work! My dev console dosen't find a problem, but it won't run. Can somebody help me?
while true do
player = game.Players:GetPlayers()
wait (5)
for i = 1, # player do
infogui = player[i].PlayerGui.infogui.Text
infogui.Text = "Intermission"
end
wait(5)
for i = 1, # player do
infogui = player[i].PlayerGui.infogui.Text
infogui.Text = "The game will start in a few."
end
wait(1)
Number = 1
for i = 1, # player do
infogui.Text = "Loading map."
player[i].Character.Parent = game.Workspace.Players
print(player[i].Character)
end
mapchoise = "Map" .. Number
print(mapchoise)
local map1 = game.ServerStorage:FindFirstChild(mapchoise):Clone()
map1.Parent = game.Workspace.RM
wait (1)
for i = 1, # player do
infogui.Text = "Game in progress."
spawnloc = math.random(1,4)
if spawnloc == 1 then
player[i].Character:MoveTo(map1.Spawn.Position)
end
if spawnloc == 2 then
player[i].Character:MoveTo(map1.Spawn2.Position)
end
if spawnloc == 3 then
player[i].Character:MoveTo(map1.Spawn3.Position)
end
if spawnloc == 4 then
player[i].Character:MoveTo(map1.Spawn4.Position)
end
game.ServerStorage.SnowBall:Clone().Parent = player[i].Backpack
end
repeat
wait(0.1)
until game.Workspace.Players:GetChildren() == 1
for i = 1, # player do
player[1]:LoadCharacter()
infogui.Text = "Game Over!"
end
game.Workspace.RM:ClearAllChildren()
end

1 comment
Also, It prints the map, BUT IT DOES NOTHING ELSE