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

Adding a time gui?

Asked by 10 years ago

So I'm creating game with modes.. This sample script is a mode "Boss Battle mode" so my problem is i want to add a script where the time will appear as a gui and not as message. This > wait(10) --How long the game lasts/ and if all the boss is eliminated and the time gui is not yet over a msg will come " all boss eliminated" and if the time is already over and boss are not eliminated "

while true do --This makes sure it keeps going and doesn't die out on us
wait(5) --This is how long until the games are started. Recomended that you keep to 5
local m = math.random(1,1) --This randomly selects a game. The seven shows how many games there are
local player = game.Players:GetPlayers()
for i = 1, #player do --This checks for players and gets them
msg = Instance.new("Message") --This make the annoying messages that appear on you screen
msg.Parent = nil --This identifies the game
if m == 1 then --don't change unless you know what you are doing
msg.Parent = game.Workspace --This makes sure it says and appears in the workspace
msg.Text = "Choosing Mode." --A bunch of messages to tell you that the game is starting which you can change if desired
wait(1)
msg.Text = "A Mode has been chosen!"
wait(3)
msg.Text = "The Mode is..."
wait(3)
msg.Text = "Boss Battle" --Put the name of the minigame you want it to be called
wait(2)
msg.Text = "Defeat all the Bosses as a team, You have 15 Minutes" --Put the rules of the minigame
wait(5)
msg.Text = "The Mode will be starting in:"
wait(1)
msg.Text = "...3..."
wait(1)
msg.Text = "..2.."
wait(1)
msg.Text = ".1."
wait(1)
msg.Text = "Begin!"
wait(1)
player[i].Character:MoveTo(Vector3.new(-8.6, 1.99, -66.4)) --Replace 206, 31.4, 48.5 with the location of where you want all players to be teleported to at the start of the minigame
msg:remove() --This removes the annoying messages Don't mess with!
game.Lighting.Minigame1:clone().Parent = game.Workspace -- Make a minigame then name it just like this: Minigame1 Once it is named that, put it in the position on the map were you want it to go then put the model in lighting. After you put the model in lighting, you may delete the one in workspace if you wish.
wait(10) --How long the game lasts
msg.Parent = game.Workspace
[ HERES WHERE TO ADD MY REQUEST IF I'M CORRECT? ]
wait(3)
msg:remove() 
game.Workspace.Minigame1:Remove() --Removes the brick so all players die (except spectators) and removes the brick so a new game can start (recommended games aren't over 5 minutes so spectators aren't bored)
end

Thank you very much! and i will credit you for this.

0
I'm the one who will create the gui, i just need the script i don't know where to start though. V0ngola 0 — 10y

1 answer

Log in to vote
0
Answered by
Lacryma 548 Moderation Voter
10 years ago

If the time span is 10 seconds then do this:

time = tick()

repeat wait() until tick() - time >= 10 or battleover --battleover should be a bool where it indicates whether the player has finished or not
Ad

Answer this question