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: Accolades

Previous Thread :: Next Thread 
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
07 Apr 2012 08:06 AM
I know this question is probably too nooby but still...

What will I use for creating a condition in with it will only loop for x amount of seconds?

Code:
function onRageChanged()
if rageLevel == 1 then
if Rage.Value == prevValue+1 then
PopUp("RAGE+1", 1)
while wait(5) do -- I know this is wrong
end

I'm trying to create an accolade GUI which it says 'Double Rage' if you get another kill within a soo called amount of time. All I need is the condition I will use. Don't worry about the rest of the script.

Thanks, in advance...

--drag]]
Report Abuse
justasimpletest1 is not online. justasimpletest1
Joined: 05 Apr 2012
Total Posts: 35
07 Apr 2012 08:10 AM
Simple:
waittime = 5

for i = 1, waittime do
--stuff
end
Report Abuse
justasimpletest1 is not online. justasimpletest1
Joined: 05 Apr 2012
Total Posts: 35
07 Apr 2012 08:13 AM
SORRY I DIDN'T READ THE QUESTION

looptime = 5
while true do
wait(1)
looptime = looptime -1
end

for i = looptime, 0, -1 do
--stuff
end

It may work
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
07 Apr 2012 08:25 AM
Thanks justasimpletest1, but how will I implement this into my script?

Report Abuse
justasimpletest1 is not online. justasimpletest1
Joined: 05 Apr 2012
Total Posts: 35
07 Apr 2012 08:27 AM
Fix script:
looptime = 5
while true do
wait(1)
looptime = looptime -1
end

while looptime ~= 0 do
--stuff
end

Inside the while loop you put what you want to loop.
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
07 Apr 2012 08:40 AM
But two while loops can't run at the same time...


while true do
wait(1)
looptime = looptime -1
end

and

while looptime ~= 0 do
--stuff
end
Report Abuse
justasimpletest1 is not online. justasimpletest1
Joined: 05 Apr 2012
Total Posts: 35
07 Apr 2012 08:44 AM
Oh yea,

waittime = 5

repeat
wait(1)
waittime=waittime-1
until waittime = 0

while waittime ~= 0 do
--stuff
end
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
07 Apr 2012 09:00 AM
You are still trying make two loops run at the same time.
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