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 out 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 Not repeat

Discussion in 'Skript' started by Kristian Rahbek, Aug 3, 2018.

Thread Status:
Not open for further replies.
  1. Kristian Rahbek

    Kristian Rahbek New Member

    Joined:
    Jun 12, 2018
    Messages:
    9
    Likes Received:
    0
    So the thing is that i made a auto sell mining script.
    But the thing is that it spams whenever i mine a block (because i did so it would send you a message of the money you earned.)
    But the thing is that i only want the message sometimes.
    For example like whenever i mined 4 blocks it says that i earned something so your chat doens't gets over spammed! :emoji_grinning:

    This is maybe a little confusion but i hope you guys understand it! :emoji_wink:
    on break of stone:
    if player has permission "normal":
    cancel event
    set event-block to air
    add 1 to player's balance
    send "&a+1$"
    Thats my code, and instead of "send "&a+1$" i would like it to send sometimes not everytime you mine the block.
     
    #1 Kristian Rahbek, Aug 3, 2018
    Last edited: Aug 3, 2018
  2. Best Answer:
    Post #2 by ShaneBee, Aug 3, 2018
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    You should put your code, its hard to help if we dont know what youre working with
    --- Double Post Merged, Aug 3, 2018, Original Post Date: Aug 3, 2018 ---
    This is a simple way you could do this.
    You can chance the loop time to however long you want in between this message popping up.
    Code (Skript):
    1. on break of stone:
    2.     if player has permission "normal":
    3.         cancel event
    4.         set event-block to air
    5.         add 1 to balance of player
    6.         add 1 to {mining::money::%player%}
    7.  
    8.  
    9. every 10 seconds:
    10.     loop all players:
    11.         if {mining::money::%loop-player%} is set:
    12.             send "&a+%{mining::money::%loop-player%}%$" to loop-player
    13.             delete {mining::money::%loop-player%}
     
    Kristian Rahbek likes this.
  4. Farid

    Farid Active Member

    Joined:
    Feb 5, 2017
    Messages:
    179
    Likes Received:
    11
    If you don't want to use looping here is different version
    Code (Skript):
    1. on break of stone:
    2.     if player has permission "normal":
    3.         cancel event
    4.         set event-block to air
    5.         add 1 to balance of player
    6.         add 1 to {mining::money::%uuid of player%}
    7.         add 1 to {notifications.%uuid of player}
    8.         if {notifications.%uuid of player} >= 5:
    9.             set {notifications.%uuid of player} to 0
    10.             send "&a+&c%{mining::money::%player%}%&a$"
    11.            
    12.            
    13.            
    14.            
    15. on quit:
    16.     set {notifications.%uuid of player} to 0
     
  5. Kristian Rahbek

    Kristian Rahbek New Member

    Joined:
    Jun 12, 2018
    Messages:
    9
    Likes Received:
    0
    Thank you both so much :emoji_wink:
    It really helped me out :emoji_wink:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...