generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Count Down

Previous Thread :: Next Thread 
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
20 Nov 2012 01:34 PM
local CountDown = 750
local a = false
script.Parent.ClickDetector.MouseClick:connect(function()
a = true
wait()

local h = Instance.new("Hint" , Workspace)
h.Text = "Raiders have captured the nuke!"
wait(5)
while true do
wait(1)
Countdown -1
h.Text =

So this is where I have stopped... I'm not sure what comes next other then 2 ends.
Report Abuse
OBF is not online. OBF
Joined: 29 Sep 2009
Total Posts: 10709
20 Nov 2012 01:37 PM
local CountDown = 750
local a = false
script.Parent.ClickDetector.MouseClick:connect(function()
a = true
wait()

local h = Instance.new("Hint" , Workspace)
h.Text = "Raiders have captured the nuke!"
wait(5)
while true do
wait(1)
h.Text = "Time left: " ..Countdown
Countdown = Countdown - 1
end
end)
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
20 Nov 2012 01:57 PM
Thanks.

Now I thought this would stop the loop... guess not.

llocal Countdown = 10
local a = false
script.Parent.ClickDetector.MouseClick:connect(function()
a = true
wait()

local h = Instance.new("Hint" , Workspace)
h.Text = "Raiders have captured the nuke!"
wait()
while true do
wait(1)
h.Text = "Time left: " ..Countdown
Countdown = Countdown - 1
end
if Countdown == 0 then
Countdown = 0
end
end)
Report Abuse
Exobyte is not online. Exobyte
Joined: 26 Jul 2011
Total Posts: 386
20 Nov 2012 01:58 PM
Instead of while true do, put this:

while Countdown > 0 do
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
20 Nov 2012 02:00 PM
local Countdown = 10
local a = false
script.Parent.ClickDetector.MouseClick:connect(function()
a = true
wait()

local h = Instance.new("Hint" , Workspace)
h.Text = "Raiders have captured the nuke!"
wait()
repeat
h.Text = "Time left: " ..Countdown
Countdown = Countdown - 1
wait(1)
until CountDown <=0
end)

Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
20 Nov 2012 02:17 PM
Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image