7Spawn
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 8030 |
|
|
| 11 Jul 2016 08:22 AM |
Post here or PM me if u can do JavaScript
Moolah // R$303 |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 11 Jul 2016 08:30 AM |
| Post your question and I can solve it. |
|
|
| Report Abuse |
|
|
7Spawn
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 8030 |
|
|
| 11 Jul 2016 08:31 AM |
how do I loop a full script, thats my question.
I want a script to loop over and over again rather than running once
Moolah // R$303 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 08:33 AM |
| Set your script as a function and loop it in a while loop? |
|
|
| Report Abuse |
|
|
7Spawn
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 8030 |
|
|
| 11 Jul 2016 08:34 AM |
I dont even know, is it the same as Lua's while loop?
Moolah // R$303 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 08:35 AM |
while (argument) { function(); } |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 11 Jul 2016 08:37 AM |
Just know that is a bad way to "loop" in JavaScript. It'll run at an amazing speed and JavaScript is non-blocking, so yielding won't work.
Use setInterval()
setInterval(function(){ -- code }, 500);
That will run every 500 milliseconds, or 0.5 seconds. |
|
|
| Report Abuse |
|
|
7Spawn
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 8030 |
|
|
| 11 Jul 2016 08:38 AM |
Ye thats what I just used the timeout thing, thanks
Moolah // R$303 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 09:01 AM |
@Nox
I used ur way and it gave me the error code "Uncaught SyntaxError: Unexpected identifier" |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 11 Jul 2016 09:15 AM |
Because you left the
-- code
Part in there >.> |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 09:16 AM |
I didnt >.>
Moolah // R$133 |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 11 Jul 2016 09:22 AM |
| What exactly re you putting and in where. Because that code is perfectly valid. |
|
|
| Report Abuse |
|
|