I made a script to turn on jug by using a turret for 10 seconds (not necessarily consecutive). There are no syntax errors, however, jug turns on within 10 seconds of my spawning in, regardless of whether I am using the turret or not. Here is my script:
Thanks in advance! (Also, another thing is that this will only work for player 1 right now (solo). This is just for testing and not a concern as of now).
Are you sure about this? I want the variable activator to go up while I am firing, and then have juggernog turn on when activator = 200 (10 seconds), so I put the level notify outside the while loop so that once it breaks (activator is greater than or equal to 200) then juggernog will turn on.
Are you sure about this? I want the variable activator to go up while I am firing, and then have juggernog turn on when activator = 200 (10 seconds), so I put the level notify outside the while loop so that once it breaks (activator is greater than or equal to 200) then juggernog will turn on.
i edited my post above and i think your while loop would be better like this xD just to be sure
Code Snippet
Plaintext
while(activator < 201)
to break the code inside cause once jugg is on it would be useless to keep running that loop also when a while loop ends the code inside it stops runing but it doesnt mean that the code will wait the while loop to stop to continue reading the rest of the code thats why your jugg always was on even if you didnt grabed the turret
Last Edit: April 15, 2014, 07:08:31 pm by jjbradman
Unfortunately, it still doesn't work, which means that the problem stems from the variable activator increasing when it is not supposed to. Thanks for your advice, though!
To daedra:
What I meant is that the variable activator will be increasing while firing the turret by waiting 0.05 seconds and then adding one to activator. Once activator is equal to or greater than 200, the while loop will break as its condition is no longer met, and the script will proceed to the next line, which turns on jug.
Post Merge: April 15, 2014, 07:15:02 pmTo jei:
Yeah, I think that's it. I'll test it out now. Thanks!
Unfortunately, it still doesn't work, which means that the problem stems from the variable activator increasing when it is not supposed to. Thanks for your advice, though!
To daedra:
What I meant is that the variable activator will be increasing while firing the turret by waiting 0.05 seconds and then adding one to activator. Once activator is equal to or greater than 200, the while loop will break as its condition is no longer met, and the script will proceed to the next line, which turns on jug.
Post Merge: April 15, 2014, 07:15:02 pmTo jei:
Yeah, I think that's it. I'll test it out now. Thanks!
lol this seems like a mess to me xD if you cant get it to work just post the edited code to point what is wrong