Thread: Delay after you click an object?

Results 1 to 7 of 7
  1. #1 Delay after you click an object? 
    Registered Member

    Join Date
    Oct 2012
    Posts
    398
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    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:

    case 245:
    long objectDelay;
    if (System.currentTimeMillis() - objectDelay > 5000) {
    c.startAnimation(200);
    objectDelay = System.currentTimeMillis();
    } else {
    c.sendMessage("Wait 5 seconds..");
    }
    break;
    But I get this error:

    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 . . .
    Please help.
    Reply With Quote  
     

  2. #2  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Put the long object delay above case

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Oct 2012
    Posts
    398
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    Now 2 errors. it also said objectDelay wasnt't defined.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Oct 2012
    Posts
    398
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    I really need this
    Reply With Quote  
     

  5. #5  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    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?

    Code:
    long objectDelay = 0;
    learn java if you want to use a rsps ffs
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Oct 2012
    Posts
    398
    Thanks given
    31
    Thanks received
    33
    Rep Power
    991
    Dude.. chill the fuck out. Not everyone knows this when they begin coding.. rofl.

    Thanks for the help though
    Reply With Quote  
     

  7. #7  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Quote Originally Posted by Harlan View Post
    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?

    Code:
    long objectDelay = 0;
    learn java if you want to use a rsps ffs

    Chill.the.fuck.out.

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Click delay on everything?
    By Tylers Pur3 in forum Help
    Replies: 6
    Last Post: 08-15-2011, 04:56 AM
  2. [PI] Object Delay
    By Dharmesh in forum Help
    Replies: 3
    Last Post: 08-05-2011, 12:06 AM
  3. [525] Anim Click Delay
    By CerdaX in forum Tutorials
    Replies: 14
    Last Post: 04-12-2009, 11:40 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •