Put the long object delay above case
|
I was wondering if anyone could help me with delaying actions after you click on an object. For example, if I were to click something, I want to make it so you have to wait 5 seconds until you can click it again. Also, I want it to delay 5 seconds until the animation starts after I click the object.. How can I do this? I've been trying since last night and I can't figure it out.
This is the code I've been trying to use:
But I get this error:case 245:
long objectDelay;
if (System.currentTimeMillis() - objectDelay > 5000) {
c.startAnimation(200);
objectDelay = System.currentTimeMillis();
} else {
c.sendMessage("Wait 5 seconds..");
}
break;
Please help.src\server\model\players\packets\ClickObject.java: 116: variable objectDelay migh
t not have been initialized
if (System.currentTimeMillis() - objectDelay > 5000) {
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Press any key to continue . . .
Now 2 errors. it also said objectDelay wasnt't defined.
I really need this
would take 2 seconds to find your problem if you used logic or even googled
variable objectDelay migh
t not have been initialized
I WONDER WHAT THIS COULD POSSIBLE MEAN, mabyue my objectDelay wasn't initialized?
learn java if you want to use a rsps ffsCode:long objectDelay = 0;
Dude.. chill the fuck out. Not everyone knows this when they begin coding.. rofl.
Thanks for the help though
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |