Solved Signs

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

TigerPvPzzz

Active Member
Feb 24, 2017
109
2
0
25
Hello, i know this question is asked a few times in here before, but i really never got a anwser i understood...

How to a make like a top 5 on signs, example:

SIGN 1: Number 1 bal
SIGN 2: Number 2 bal
SIGN 3: Number 3 bal
And over and over again

(Sorry for bad english)
 
First of all a sign can hold 4 lines,

For the top 4, you would have to find greatest to lowest, from the variable, and add those to a list variable.

then for adding them to a sign, you would have to loop the list variable that you have added the 4.
and set the line to loop-value.

I'm sure I wasn't specific enough on some parts, but you should get the basic idea and structure.
 
First of all a sign can hold 4 lines,

For the top 4, you would have to find greatest to lowest, from the variable, and add those to a list variable.

then for adding them to a sign, you would have to loop the list variable that you have added the 4.
and set the line to loop-value.

I'm sure I wasn't specific enough on some parts, but you should get the basic idea and structure.
Can you give me an example of how to loop the variable, and then put in on signs automaticly? I really can't come up with something...

(Sorry for bad english)
[doublepost=1503512755,1503260257][/doublepost]I have tried but i could't get it fixed... Can anyone help?
 
Just to be clear, you want 5 different signs with a list of balances on each one, 4 names per sign? I'll try and do it, I just want to make sure I understand you ^-^
 
Couldn't make the one list variable work for all the sings unfortunately, but elsewise this is functional~
How to - define the top bal signs as [top bal 1], [top bal 2], and so on. You only need to type it on the first line, and everything else will work automatically. It updates every 5 min, but the /signupdate command will force an update. balances are set on join and quit, but you could add it at other points too
code_language.skript:
command /signupdate:
    trigger:
        loop {plr.bal::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    if {_low.to.high.list::%loop-value-1%.%{_n}%} is not set:
                        set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        set {_c} to 1
        loop {_high.to.low.list::*}:
            set {_player} to "%loop-value%" parsed as offlineplayer
            set line 2 of {sign::%{_c}%} to "%{_player}%"
            set line 3 of {sign::%{_c}%} to "%{plr.bal::%loop-value%}%"
            add 1 to {_c}
            if {_c} is 6:
                exit loop
              
 
          
on sign change:
    if line 1 is "[Top Bal 1]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign::1} to block at event-location
    if line 1 is "[Top Bal 2]":
        send "&1Top Bal sign 2 placed"
        set line 1 to ""
        set {sign::2} to block at event-location
    if line 1 is "[Top Bal 3]":
        send "&1Top Bal sign 3 placed"
        set line 1 to ""
        set {sign::3} to block at event-location
    if line 1 is "[Top Bal 4]":
        send "&1Top Bal sign 4 placed"
        set line 1 to ""
        set {sign::4} to block at event-location
    if line 1 is "[Top Bal 5]":
        send "&1Top Bal sign 5 placed"
        set line 1 to ""
        set {sign::5} to block at event-location     
      
on join:
    set {plr.bal::%player%} to "%player's balance%"
  
on quit:
    set {plr.bal::%player%} to "%player's balance%"
  
every 5 minutes:
    execute console command "/signupdate"
 
Last edited by a moderator:
Couldn't make the one list variable work for all the sings unfortunately, but elsewise this is functional~
How to - define the top bal signs as [top bal 1], [top bal 2], and so on. You only need to type it on the first line, and everything else will work automatically. It updates every 5 min, but the /signupdate command will force an update. balances are set on join and quit, but you could add it at other points too
code_language.skript:
command /signupdate:
    trigger:
        loop {plr.bal::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    if {_low.to.high.list::%loop-value-1%.%{_n}%} is not set:
                        set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        set {_line} to 1
        loop {_high.to.low.list::*}:
            set {_player} to "%loop-value%" parsed as offlineplayer
            send "    &1%{_player}% - &7%{plr.bal::%loop-value%}%"
            set line {_line} of {signlist::1} to "%{_player}%"
            add 1 to {_line}
            if {_line} is 4:
                set line {_line} of {signlist::2} to "%{_player}%"
            if {_line} is 8:
                set line {_line} of {signlist::2} to "%{_player}%"
            if {_line} is 12:
                set line {_line} of {signlist::2} to "%{_player}%"        
            if {_line} is 16:
                set line {_line} of {signlist::2} to "%{_player}%"            

         
on sign change:
    if line 1 is "[Top Bal 1]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign1::1} to block at event-location
    if line 1 is "[Top Bal 2]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign1::2} to block at event-location
    if line 1 is "[Top Bal 3]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign1::3} to block at event-location
    if line 1 is "[Top Bal 4]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign1::4} to block at event-location
    if line 1 is "[Top Bal 5]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign1::5} to block at event-location    
     
on join:
    set {plr.bal::%player%} to "%player's balance%"
 
on quit:
    set {plr.bal::%player%} to "%player's balance%"
 
every 5 minutes:
    execute console command "/signupdate"
You are the man! - Thank you very much!
 
Uhhmm, the signs are not updating, it's coming in the chat but the signs does not really change.
oh derp, wrong one. had a few going to test variables one sec.
[doublepost=1503685686,1503685568][/doublepost]I updated the original code, try that.

**note though, I can't test the other signs as I only have one alt. So not enough names to fill them. Ideally that should work but if not let me know
 
oh derp, wrong one. had a few going to test variables one sec.
[doublepost=1503685686,1503685568][/doublepost]I updated the original code, try that.

**note though, I can't test the other signs as I only have one alt. So not enough names to fill them. Ideally that should work but if not let me know
Now it shows 4 players, at one sign
 
it should be 4 per sign.
I meant. that it should show the number 1 player at one sign, and then number 2 at another sign like:
SIGN 1:
LINE 1: ---( 1 )---
LINE 2: PLAYER
LINE 3: Player's bal
LINE 4: ----------------

SIGN 2:
LINE 1: ---( 2 )---
LINE 2: PLAYER
LINE 3: Player's bal
LINE 4: ----------------

And so on
 
I asked you here(in the quote below) if you wanted 4 names per sign x3
Just to be clear, you want 5 different signs with a list of balances on each one, 4 names per sign? I'll try and do it, I just want to make sure I understand you ^-^

but I can change it in a few.
 
Okay, can u change it for me?
yupper just give me a few
[doublepost=1503687165,1503686416][/doublepost]Right, so try this. Weems to be working nicely on my end.
8bb5962019.jpg

code_language.skript:
command /signupdate:
    trigger:
        loop {plr.bal::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    if {_low.to.high.list::%loop-value-1%.%{_n}%} is not set:
                        set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        set {_c} to 1
        loop {_high.to.low.list::*}:
            set {_player} to "%loop-value%" parsed as offlineplayer
            set line 2 of {sign::%{_c}%} to "%{_player}%"
            set line 3 of {sign::%{_c}%} to "%{plr.bal::%loop-value%}%"
            add 1 to {_c}
            if {_c} is 6:
                exit loop
                

            
on sign change:
    if line 1 is "[Top Bal 1]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign::1} to block at event-location
    if line 1 is "[Top Bal 2]":
        send "&1Top Bal sign 2 placed"
        set line 1 to ""
        set {sign::2} to block at event-location
    if line 1 is "[Top Bal 3]":
        send "&1Top Bal sign 3 placed"
        set line 1 to ""
        set {sign::3} to block at event-location
    if line 1 is "[Top Bal 4]":
        send "&1Top Bal sign 4 placed"
        set line 1 to ""
        set {sign::4} to block at event-location
    if line 1 is "[Top Bal 5]":
        send "&1Top Bal sign 5 placed"
        set line 1 to ""
        set {sign::5} to block at event-location       
        
on join:
    set {plr.bal::%player%} to "%player's balance%"
    
on quit:
    set {plr.bal::%player%} to "%player's balance%"
    
every 5 minutes:
    execute console command "/signupdate"
 
T
yupper just give me a few
[doublepost=1503687165,1503686416][/doublepost]Right, so try this. Weems to be working nicely on my end.
8bb5962019.jpg

code_language.skript:
command /signupdate:
    trigger:
        loop {plr.bal::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    if {_low.to.high.list::%loop-value-1%.%{_n}%} is not set:
                        set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        set {_c} to 1
        loop {_high.to.low.list::*}:
            set {_player} to "%loop-value%" parsed as offlineplayer
            set line 2 of {sign::%{_c}%} to "%{_player}%"
            set line 3 of {sign::%{_c}%} to "%{plr.bal::%loop-value%}%"
            add 1 to {_c}
            if {_c} is 6:
                exit loop
               

           
on sign change:
    if line 1 is "[Top Bal 1]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign::1} to block at event-location
    if line 1 is "[Top Bal 2]":
        send "&1Top Bal sign 2 placed"
        set line 1 to ""
        set {sign::2} to block at event-location
    if line 1 is "[Top Bal 3]":
        send "&1Top Bal sign 3 placed"
        set line 1 to ""
        set {sign::3} to block at event-location
    if line 1 is "[Top Bal 4]":
        send "&1Top Bal sign 4 placed"
        set line 1 to ""
        set {sign::4} to block at event-location
    if line 1 is "[Top Bal 5]":
        send "&1Top Bal sign 5 placed"
        set line 1 to ""
        set {sign::5} to block at event-location      
       
on join:
    set {plr.bal::%player%} to "%player's balance%"
   
on quit:
    set {plr.bal::%player%} to "%player's balance%"
   
every 5 minutes:
    execute console command "/signupdate"
Thanks
[doublepost=1503689707][/doublepost]
yupper just give me a few
[doublepost=1503687165,1503686416][/doublepost]Right, so try this. Weems to be working nicely on my end.
8bb5962019.jpg

code_language.skript:
command /signupdate:
    trigger:
        loop {plr.bal::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    if {_low.to.high.list::%loop-value-1%.%{_n}%} is not set:
                        set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        set {_c} to 1
        loop {_high.to.low.list::*}:
            set {_player} to "%loop-value%" parsed as offlineplayer
            set line 2 of {sign::%{_c}%} to "%{_player}%"
            set line 3 of {sign::%{_c}%} to "%{plr.bal::%loop-value%}%"
            add 1 to {_c}
            if {_c} is 6:
                exit loop
               

           
on sign change:
    if line 1 is "[Top Bal 1]":
        send "&1Top Bal sign 1 placed"
        set line 1 to ""
        set {sign::1} to block at event-location
    if line 1 is "[Top Bal 2]":
        send "&1Top Bal sign 2 placed"
        set line 1 to ""
        set {sign::2} to block at event-location
    if line 1 is "[Top Bal 3]":
        send "&1Top Bal sign 3 placed"
        set line 1 to ""
        set {sign::3} to block at event-location
    if line 1 is "[Top Bal 4]":
        send "&1Top Bal sign 4 placed"
        set line 1 to ""
        set {sign::4} to block at event-location
    if line 1 is "[Top Bal 5]":
        send "&1Top Bal sign 5 placed"
        set line 1 to ""
        set {sign::5} to block at event-location      
       
on join:
    set {plr.bal::%player%} to "%player's balance%"
   
on quit:
    set {plr.bal::%player%} to "%player's balance%"
   
every 5 minutes:
    execute console command "/signupdate"
Yo can you make it, so it spawns a NPC of the player on top of the sign? So the NPC with my skin and name spawns in at the block behind like this: https://gyazo.com/3dd580bb1264afb54b96c6d7780831ff