Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Whats wrong with this script? No errors i've tried everything.

Asked by 8 years ago

local replicatedstorage = game:GetService("ReplicatedStorage") local status = replicatedstorage:WaitForChild("InfoValue") local mapStorage = game.Workspace:WaitForChild("mapStorage")

while true do

01while game.Players.NumPlayers > 1 do
02    status.Value = "There must be 2 or more players to play"
03    repeat wait(2) until game.Players.numPlayers <= 2      
04end
05 
06for i = 1,0,-1 do
07    status.Value = "Intermision "..i
08    wait(1)
09end
10_G.gameplayers = {}
11for i, v in pairs(game.Players:GetPlayers()) do
12 
13    if v then
14        table.insert(_G.gameplayers, v.Name)
15    end
View all 49 lines...

end

01end
02for i = 60,0,-1 do wait(1)
03    if i == 0 then
04        status.Value = "Times up!!"
05        break
06    end
07 
08    wait(1)
09    if #_G.gameplayers == 1 then
10        for i, v in pairs(_G.gameplayers) do
11            if v ~= nil then
12                status.Value = v.." is the winner!"
13                break
14            end
15        end
View all 23 lines...

end

The thing that isn't working is THe round is for 1 second long... instead of 60

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

use a while wait() loop so it can constantly detects if there is enough players.

Ad

Answer this question