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

i the GUI does not count how much time is left and i do not have the wait time?

Asked by 5 years ago

-- Difine variables

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ServerStorage = game:GetService("ServerStorage")

local MapsFolder = ServerStorage:WaitForChild("Maps")

local Status = ReplicatedStorage:WaitForChild("Status")

local GameLenght = 50

local Reward = 25

-- Game Loop

while true do

01Status.Value = "Waiting for enough players"
02 
03repeat wait(1) until game.Players.NumPlayers >= 2
04 
05Status.Value = "Intermission"
06 
07wait(10)
08 
09local plrs = {}
10 
11for i, player in pairs(game.Players:GetPlayers()) do
12    if player then
13        table.insert(plrs,player) -- Add each player into plrs table
14    end
15end
View all 63 lines...

end

01Status.Value = "Get ready to play!"
02 
03wait(2)
04 
05for i = GameLenght,0,-1 do
06 
07    for x, player in pairs(plrs) do
08        if player then
09 
10            character = player.Character
11 
12            if not character then
13                -- left the game
14            else
15                if character:FindFirstChild("GameTag") then
View all 77 lines...
0
Could you just give us the code snippet that is responsible for counting down, this is too much Ziffixture 6913 — 5y
0
Yeah too confusing, and did you take this code from someone? ffancyaxax12 181 — 5y
0
I doubt this is your own code if you don't know what is inside of it. Please refrain from posting code that does not belong to you. DeceptiveCaster 3761 — 5y
0
AlvinBloxx has never been a reliable source . He has plagiarized many times as well Ziffixture 6913 — 5y
View all comments (3 more)
1
I will lock this question once a VALID answer is given.  DeceptiveCaster 3761 — 5y
0
downvoted because this is literally confusing everyone (including me) speedyfox66 237 — 5y
0
Wow this is from AlvinBlox lol. PrismaticFruits 842 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
01while true do wait()
02    print("Hello")
03end
04 
05print("World") -- not print because the script stopped on loop
06 
07--<< Output: Hello x1
08 
09 
10spawn(function() -- if you not use the "spawn", the script stop here and not continue read.
11    while true do wait()
12        print("Hello")
13    end
14end)
15 
16print("World")
17 
18--<< Output: Hello x1
19--<< Output: World x1
20--<< Output: Hello x1223....
Ad

Answer this question