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: Edit my script to make it loop

Previous Thread :: Next Thread 
TempestLord25 is not online. TempestLord25
Joined: 11 Apr 2011
Total Posts: 2
30 Aug 2011 10:16 AM
Somebody help me edit my script so that it loops forever. Here is the script.


h = Instance.new("Hint")

function Countdown(min,sec,txt,pretxt)
h.Parent = game.Workspace
for i = 1, sec + (min * 60) + 1 do
if sec < 10 and min == 0 then
h.Text = pretxt.." 0:0"..sec.." "..txt
elseif sec < 10 then
h.Text = pretxt.." "..min..":0"..sec.." "..txt
elseif sec + (min * 60) < 60 then
h.Text = pretxt.." 0:"..sec.." "..txt
elseif sec + (min * 60) > 59 then
h.Text = pretxt.." "..min..":"..sec.." "..txt
end
wait(1)
if sec > 0 then
sec = sec - 1
elseif sec == 0 and min ~= 0 then
sec = 59
min = min - 1
elseif sec == 0 and min == 0 then
print("Ended")
end
end
h.Parent = nil
end

mins = 10 --Set this to the amount of minutes
secs = 00 --Set this to the amount of seconds
text = "to destroy the giant zombie before it regenerates." --Set this to the text you want it to say after the numbers
pretext = "Players have" --Set this to the text you want it to say the numbers
Countdown(mins,secs,text,pretext)
Report Abuse
nightmare3o is not online. nightmare3o
Joined: 21 Jun 2008
Total Posts: 956
30 Aug 2011 10:17 AM
while true do
h = Instance.new("Hint")

function Countdown(min,sec,txt,pretxt)
h.Parent = game.Workspace
for i = 1, sec + (min * 60) + 1 do
if sec < 10 and min == 0 then
h.Text = pretxt.." 0:0"..sec.." "..txt
elseif sec < 10 then
h.Text = pretxt.." "..min..":0"..sec.." "..txt
elseif sec + (min * 60) < 60 then
h.Text = pretxt.." 0:"..sec.." "..txt
elseif sec + (min * 60) > 59 then
h.Text = pretxt.." "..min..":"..sec.." "..txt
end
wait(1)
if sec > 0 then
sec = sec - 1
elseif sec == 0 and min ~= 0 then
sec = 59
min = min - 1
elseif sec == 0 and min == 0 then
print("Ended")
end
end
h.Parent = nil
end

mins = 10 --Set this to the amount of minutes
secs = 00 --Set this to the amount of seconds
text = "to destroy the giant zombie before it regenerates." --Set this to the text you want it to say after the numbers
pretext = "Players have" --Set this to the text you want it to say the numbers
Countdown(mins,secs,text,pretext)


ta da!
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
30 Aug 2011 10:20 AM
Lol @ above.

You're just defining the function repeatedly. That wouldn't make it loop .-.

You'd have to loop the part where it actually CALLS the function at the bottom.

Regards,
~Scarfacial
Report Abuse
TempestLord25 is not online. TempestLord25
Joined: 11 Apr 2011
Total Posts: 2
30 Aug 2011 10:41 AM
can you show me an example of that
Report Abuse
deividaxas is not online. deividaxas
Joined: 20 Feb 2009
Total Posts: 1054
30 Aug 2011 11:33 AM
h = Instance.new("Hint")

function Countdown(min,sec,txt,pretxt)
h.Parent = game.Workspace
for i = 1, sec + (min * 60) + 1 do
if sec < 10 and min == 0 then
h.Text = pretxt.." 0:0"..sec.." "..txt
elseif sec < 10 then
h.Text = pretxt.." "..min..":0"..sec.." "..txt
elseif sec + (min * 60) < 60 then
h.Text = pretxt.." 0:"..sec.." "..txt
elseif sec + (min * 60) > 59 then
h.Text = pretxt.." "..min..":"..sec.." "..txt
end
wait(1)
if sec > 0 then
sec = sec - 1
elseif sec == 0 and min ~= 0 then
sec = 59
min = min - 1
elseif sec == 0 and min == 0 then
print("Ended")
end
end
h.Parent = nil
end

mins = 10 --Set this to the amount of minutes
secs = 00 --Set this to the amount of seconds
text = "to destroy the giant zombie before it regenerates." --Set this to the text you want it to say after the numbers
pretext = "Players have" --Set this to the text you want it to say the numbers
while wait() do
Countdown(mins,secs,text,pretext)
end
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