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
 

Have An Event Take Place When A Countdown is Finished

Previous Thread :: Next Thread 
Vyxium is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
18 Mar 2014 08:46 PM
I can't believe nobody has thought of using a for loop -_-

for i = 10, 1, -1 do
script.Parent.Value = i
wait(1)
end
GameV.Value = 3
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
18 Mar 2014 08:51 PM
t = workspace.GameV

-- Separate this script --
while true do
wait(1)
if t.Value <= 60
t.Value = t.Value + 1
end end
-- END OF SCRIPT --


-- Put this in a separate script too!
eventLast = 120 -- event will last for 2 minutes
t.Changed:connect(function()
if t.Value == 60 then
print'event occuring'
wait(eventLast)
t.Value = 0
print'event finished'
end end)
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
18 Mar 2014 09:21 PM
At aesthetic - well, we're getting somewhere. It didn't crash the game. But, it doesn't tick?
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
18 Mar 2014 09:23 PM
At vyxium - so how long will that count for?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Mar 2014 09:27 PM
I think I forgot a wait, but w/e
Report Abuse
Vyxium is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
18 Mar 2014 09:27 PM
you can customize it, the first line is where you edit all the numbers.

the first number is how long you want it to run
the second number is what number you want it to count down to, in your case, 0
the third number is what it counts down by, in this case, 1's

so it count down from 10, to 1 by 1's
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
18 Mar 2014 10:34 PM
function Set_Da_World_on_Fieeeaaahhhh()
print("It's a song :3")
end

local derps = 60
local h = Instance.new("Hint", game.Workspace)

for i = 1,60,-.1 do
h.Text = "Countdown: " .. derps[i] .. " seconds left"
wait(.1)
end

Set_Da_World_on_Fieeeaaahhhh()
Report Abuse
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
18 Mar 2014 11:38 PM
to make it reset the number

repeat -awd jadaw
--ndawjndw
until --BLaswdwd

num = 60

its that simple, after it's done repeating just reset the variable to what ever number you want it at
Report Abuse
Previous Thread :: Next Thread 
Page 2 of 2Go to page: 1, [2] Prev
 
 
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