![]() |
Need some quick help
Hey guys. Hoping to get a bit of help here. I'm working on a fishing system that initializes and brings up a button you have to press. if the correct button is pressed within x amount of seconds (we'll use 3 seconds), another button pops up with about 5 rounds of this. If the button is not pressed or the incorrect button is pressed, you lose.
I'm initializing the weapon and calling a timeout. The timeout runs through functions ShowButton(),CheckKeys(). showbutton determines a random number 0-3 and show the corresponding button. How can I make the button stay there for x seconds without having to call the timeout again. If that makes sense. I'm running the timeout on a .05 timer which is constantly running the show arrow script and checking for a keydown. I'm really sorry if this sounds confusing. If I need to elaborate more, i'll try. |
If I were scripting a system that did this I'd use
HTML Code:
scheduleevent(sleep, "onEventName", params);HTML Code:
cancelevents("onEventName"); |
That's not a bad idea at all. I'll try to incorporate that. Right now i'm having problems with the keychecking. I know i'm doing something wrong, but can't figure out what.
PHP Code:
|
You can't use while loops like that in Graal; it will hit a max loop limit. Either way, it's best to just use the onKeyPressed event.
I would probably do it somewhat like this: PHP Code:
|
| All times are GMT +2. The time now is 03:03 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.