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.

Advanced Autobroadcaster

Discussion in 'Skript' started by Simon942, Dec 25, 2018.

Tags:
Thread Status:
Not open for further replies.
  1. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Hi there

    I have a issue with the skript: https://pastebin.com/veNNM3Es
    The issue is that it sends the same message, and sometime sending two messages at the same time.

    My skript is advanced made in that way it should only broadcast then there are some players online (For clean logs) and not using commands (For clean console)

    I have tried to contact a friend but we can't resolve it by our self.

    Best regards Simon
     
  2. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Code (Skript):
    1.  
    2. options:
    3.      prefix: &6&l[&b&lLobby&6&l]&r &e
    4. every 1 minute:
    5.     if number of all players > 1:
    6.         broadcast "{@prefix} Besøg vores hjemmeside på: &f&ohttps://www.Siecraft.dk/"
    7.     else:
    8.         if number of all players = 1:
    9.             broadcast "{@prefix} Besøg vores Discord på: &f&ohttp://Discord.Siecraft.dk/"
    10.  
    Your problem of 2 messages having been sent at the same time is due to line 8.

    Code (Skript):
    1.         if {BC.Starter} is 1 or over:
    So, it checks if it is 1 OR over. If it is 1 then it will execute both broadcasts due to line 13-15 because it checks again if it is just 1
     
    #2 Runakai, Dec 25, 2018
    Last edited: Dec 25, 2018
  3. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Hi again

    Thank you for the answear.
    Now Skript tells me that there are some Empty configurations.

    Code:
    Code (Skript):
    1. options:
    2.      prefix: &6&l[&b&lLobby&6&l]&r &e
    3.  
    4. every 1 minute:
    5.     if number of all players = 0:
    6.     stop
    7.     if {_1} is 1:
    8.         set {_2} to 2
    9.         broadcast "{@prefix} Besøg vores hjemmeside på: &f&ohttps://www.Siecraft.dk/"
    10.         clear {_1}
    11.     else:
    12.         if {_2} is 1:
    13.             set {_1} to 1
    14.             broadcast "{@prefix} Besøg vores Discord på: &f&ohttp://Discord.Siecraft.dk/"
    15.             clear {_1}
     
  4. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Code (Skript):
    1.  
    2. options:
    3.      prefix: &6&l[&b&lLobby&6&l]&r &e
    4. every 1 minute:
    5.     if number of all players = 0:
    6.         stop
    7.         if {_1} is 1:
    8.             set {_2} to 2
    9.             broadcast "{@prefix} Besøg vores hjemmeside på: &f&ohttps://www.Siecraft.dk/"
    10.             clear {_1}
    11.         else:
    12.             if {_2} is 1:
    13.                 set {_1} to 1
    14.                 broadcast "{@prefix} Besøg vores Discord på: &f&ohttp://Discord.Siecraft.dk/"
    15.                 clear {_1}
     
  5. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Sorry but i can't see any difference.

    Best regards Simon
    --- Double Post Merged, Dec 27, 2018, Original Post Date: Dec 26, 2018 ---
    Hi there¨

    Sorry for the last answear. Now i have tested the code you sent, and it worked fine :emoji_slight_smile:
    Thanks alot.

    Best regards Simon
     
  6. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    If so please set the thread to solved or mark my answer as best answer
     
  7. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Hi there

    Hmm it still seems to be a issue:
    It posts the first broadcast over and over again. Instead of posting the first broadcast and after that the other one.

    best regards Simon
     
  8. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Well that’s because of line 8 and 12. {_2} has to be the same value
     
  9. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Can you give me a example. I don't understand it :emoji_slight_smile:
     
  10. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Code (Skript):
    1.  
    2. every minute:
    3.     if number of all players is more than 0:
    4.         if {_1} is not set:
    5.             broadcast "Text1"
    6.             set {_1} to true
    7.         else:
    8.             broadcast "Text2"
    9.             delete {_1}
     
  11. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Hi there
    Now it just repeats "Text1" the other message "Text2" is never shown.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...