|
| 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 |
|
|
|
| 07 Apr 2012 08:10 AM |
Simple: waittime = 5
for i = 1, waittime do --stuff end |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 07 Apr 2012 08:25 AM |
Thanks justasimpletest1, but how will I implement this into my script?
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 07 Apr 2012 09:00 AM |
| You are still trying make two loops run at the same time. |
|
|
| Report Abuse |
|
|