1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Delay between bow use (requesting lock)

Discussion in 'Skript' started by bigwillyman69, Sep 13, 2019 at 2:04 AM.

  1. b

    bigwillyman69 Member

    Joined:
    Aug 27, 2019
    Messages:
    10
    Likes Received:
    0
    I'm trying to make a bow delay system, but I can't figure out how.
    And google's uselessness isn't helping, either.

    Code (Text):
    1. on use of bow:
    2.    set {_waited} to difference between {bow.%player%.lastused} and now
    3.    if {_waited} is less than a secong:
    4.       message "You have to wait %difference between a second and {_waited}% before you can fire this bow"
    5.       set {bow.%player%.lastused} to now
    all i get is a bunch of errors
    --- Double Post Merged, Sep 13, 2019 at 2:28 AM, Original Post Date: Sep 13, 2019 at 2:04 AM ---
    bump
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    1) use the On Shoot event
    2) check your spelling "if {_waited} is less than a secong:" <--- "second"
    3) Read your errors, they usually tell you whats wrong.
     
  3. b

    bigwillyman69 Member

    Joined:
    Aug 27, 2019
    Messages:
    10
    Likes Received:
    0
    thanks for the help. however it doesn't work
     
    #3 bigwillyman69, Sep 13, 2019 at 5:02 AM
    Last edited: Sep 13, 2019 at 5:11 AM
  4. T

    TrickDev Member

    Joined:
    Monday
    Messages:
    4
    Likes Received:
    0
    like they said... Use on shoot. It should work. Here
    Code (Text):
    1. on shoot:
    2.     if {timer::%player%} > 0:
    3.         cancel event
    4.         send "&cBow Loading..." to shooter
    5.     else:
    6.         set {timer::%player%} to 5 #The amount (in seconds) of delay
    7. every second:
    8.     loop all players:
    9.         if {timer::%loop-player%} > 0:
    10.             remove 1 from {timer::%loop-player%}
     
  5. b

    bigwillyman69 Member

    Joined:
    Aug 27, 2019
    Messages:
    10
    Likes Received:
    0
    i just used on bow use
    i tried on shoot but it didn't work and your code just makes my sk file a mess
     
Loading...