Why Doesn't this play a countdown right after the map spawns?
Asked by
8 years ago Edited 8 years ago
This is a server script inside of serverscriptservice.
07 | local replicatedstorage = game:GetService( "ReplicatedStorage" ) |
08 | local status = replicatedstorage:WaitForChild( 'StatusValue' ) |
13 | status.Value = "Intermission: " .. i |
16 | status.Value = "Prepare to be Rushed!" |
19 | for i, v in pairs (game.Players:GetPlayers()) do |
22 | table.insert(_G.gameplayers, v.Name) |
25 | local maps = replicatedstorage:WaitForChild( 'Maps' ) |
26 | local maplist = maps:GetChildren() |
27 | local selectedIndex = math.random( 1 , #maplist) |
28 | local map = maplist [ selectedIndex ] :Clone() |
29 | map.Parent = Workspace.ActiveMap |
31 | local spawns = map:WaitForChild( 'Spawns' ):GetChildren() |
32 | for _, player in pairs (game.Players:GetPlayers()) do |
33 | if player and #spawns > 0 then |
34 | local torso = player.Character:WaitForChild( 'Torso' ) |
35 | local allspawns = math.random( 1 , #spawns) |
36 | local randomspawn = spawns [ allspawns ] |
37 | if randomspawn and torso then |
38 | table.remove(spawns, allspawns) |
39 | torso.CFrame = CFrame.new(randomspawn.Position + Vector 3. new( 0 , 2 , 0 )) |
50 | status.Value = i.. " seconds remaining!" |
53 | status.Value = "Game over!" |
It should go 3 2 1 GO! and then the 90,0,-1 do should play but it skips the 3 2 1 GO!
The part that is not working is