Solved How to update a sign every 3 seconds?

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Dxstin

Member
Oct 1, 2020
15
1
3
24
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)?
 
You could do something similar to this
Code:
every 3 seconds:
    set {_sign} to block at location 100, 100, 100 in world "world"
    loop all players in world "world":
        add 1 to {_players}
    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
Reactions: Dxstin
Okay thanks! I will test it tomorrow
[doublepost=1605029736,1604951170][/doublepost]Thank you very much! I changed the code a bit, but without your help I wouldn't have figured it out!
 
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.
 
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
 
I restarted the server and now it works, don't know what it is but thanks!
[doublepost=1605036041,1605035948][/doublepost]The problem was me, I only reloaded my LobbySystem but not SkyWarsFFA with the join sign inside
[doublepost=1605036157][/doublepost]Thanks for everything!
 
  • Like
Reactions: Ankoki
Okay thanks! I will test it tomorrow
[doublepost=1605029736,1604951170][/doublepost]Thank you very much! I changed the code a bit, but without your help I wouldn't have figured it out!

also, for it to be more accurate and less potencially laggy, instad of every 3 seconds:, you could use something like this
Code:
on world change:
    wait 1 tick
    # update sign
 
Status
Not open for further replies.