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 How to update a sign every 3 seconds?

Discussion in 'Skript' started by Dxstin, Nov 8, 2020.

Thread Status:
Not open for further replies.
  1. Dxstin

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    Hello, I'm doing a lobby system for my server and I'm stuck with a problem with the sign system: How can I update a sign every 3 seconds so that the sign shows the number of players in a world (and so that the number is updated as well)?
     
  2. Best Answer:
    Post #2 by Ankoki, Nov 8, 2020
  3. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    You could do something similar to this
    Code (Text):
    1. every 3 seconds:
    2.     set {_sign} to block at location 100, 100, 100 in world "world"
    3.     loop all players in world "world":
    4.         add 1 to {_players}
    5.     set line 3 of {_sign} to "%{_players}%"
    Obviously update your location, and should be exact (ex, 100.5)
    But hopefully this helps, and if theres anything which doesn't make sense i can explain c:
     
    • Like Like x 1
  4. Dxstin

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    Okay thanks! I will test it tomorrow
    --- Double Post Merged, Nov 10, 2020, Original Post Date: Nov 9, 2020 ---
    Thank you very much! I changed the code a bit, but without your help I wouldn't have figured it out!
     
  5. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    Glad i could help:emoji_slight_smile:
     
  6. Dxstin

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    Can you help me please with this:
    on rightclick on a sign:
    if line 1 is "&8◆ &cSkyWarsFFA-1 &8◆":
    if line 2 is "&8【&a&lONLINE &8】":
    make player execute command "swffajoin"

    The sign will not work if the number of players is shown on the sign.
     
  7. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    you sure your not changing line 1 or 2 by accident?
     
  8. Dxstin

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    I create the join signs with line 1: [swffa]
    and line 2: swffa-1 . Then the sign is automatically processed by the number of players and you cannot join with the sign anymore
     
  9. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    does it work when you remove the if’s?
     
  10. Dxstin

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    It doesn't work
     
  11. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    weird, maybe try “/swffajoin” or execute console command “sudo %player% swffajoin”
     
  12. Dxstin

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    I restarted the server and now it works, don't know what it is but thanks!
    --- Double Post Merged, Nov 10, 2020, Original Post Date: Nov 10, 2020 ---
    The problem was me, I only reloaded my LobbySystem but not SkyWarsFFA with the join sign inside
    --- Double Post Merged, Nov 10, 2020 ---
    Thanks for everything!
     
    • Like Like x 1
  13. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    Of course! I’m glad it works now:emoji_slight_smile:
     
  14. TenToTu Sho

    TenToTu Sho Member

    Joined:
    Dec 30, 2019
    Messages:
    20
    Likes Received:
    2
    also, for it to be more accurate and less potencially laggy, instad of every 3 seconds:, you could use something like this
    Code (Text):
    1. on world change:
    2.     wait 1 tick
    3.     # update sign
     
    • Agree Agree x 1
  15. Dxstin

    Dxstin Member

    Joined:
    Oct 1, 2020
    Messages:
    15
    Likes Received:
    1
    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...