A gui prob <TuSK>

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

Jeroeno_Boy

Active Member
Jun 2, 2017
61
2
8
24
So i have the problem when i loop {Players::*} <all total players that joined the server> and then look at thier stats with a function and gui, it only works on the first person from the value, importand code:
code_language.skript:
function Refresh(P: player):
    set {Slots.%{_P}%} to 0
    loop 5 times:
        loop 9 times:
            format gui slot {Slots.%{_P}%} of {_P} with 1 light gray stained glass pane named " &a " to do nothing
            add 1 to {Slots.%{_P}%}
          
    loop 9 times:
        format gui slot {Slots.%{_P}%} of {_P} with 1 gray stained glass pane named " &a " to do nothing
        add 1 to {Slots.%{_P}%}
      
    if {Page.%{_P}%} is more than 1:
        remove 1 from {Page.%{_P}%}
        format gui slot 48 of {_P} with 1 arrow named "&fNaar pagina: &a%{Page.%{_P}%}%" to run function BackPage({_P})
        add 1 to {Page.%{_P}%}
      
    format gui slot 49 of {_P} with 1 red stained glass pane named "&7Terug naar HoofdMenu" to close then run {_P} command "/admin"
      
    add 1 to {Page.%{_P}%}
    format gui slot 50 of {_P} with 1 arrow named "&fNaar pagina: &a%{Page.%{_P}%}%" to run function Nextpage({_P})
    remove 1 from {Page.%{_P}%}
  
    set {Skip.%{_P}%} to 0
  
    if {Page.%{_P}%} is more than 1:
        remove 1 from {Page.%{_P}%}
        loop {Page.%{_P}%} times:
            add 20 to {Skip.%{_P}%}
        add 1 to {Page.%{_P}%}
      
    set {JoinedPlayers.%{_P}%} to 0
    loop {Players::*}:
        add 1 to {JoinedPlayers.%{_P}%}
    format gui slot 52 of {_P} with 1 emerald named "&fTotaal gejoinde spelers: &a%{JoinedPlayers.%{_P}%}%" to do nothing
  
    set {ReadyFromSkip.%{_P}%} to 0
    set {Slots.%{_P}%} to 10
    set {SkipTimes.%{_P}%} to 0
    loop {Players::*}:
        if {Skip.%{_P}%} is more than 1:
            if {SkipTimes.%{_P}%} is more than {Skip.%{_P}%}:
                set {ReadyFromSkip.%{_P}%} to 1
            else:
                add 1 to {SkipTimes.%{_P}%}
        else:
            set {ReadyFromSkip.%{_P}%} to 1
        if {ReadyFromSkip.%{_P}%} is 1:
            if {Slots.%{_P}%} is 17 or 26:
                add 2 to {Slots.%{_P}%}
            if {Slots.%{_P}%} is 35:
                stop
            set {PlayerJoinedThing.%loop-value%} to loop-value
            format gui slot {Slots.%{_P}%} of {_P} with skull of loop-value named "&f%loop-value%" with lore "&fBank: &e$%{Balance.%loop-value%}%||&fMinecoins: &b%{Minecoins.%loop-value%}%||&fLevel: &5%{level.%loop-value%}%|| ||&7Click voor meer info" to close then run function PlayerStatus1ao({_P}, {PlayerJoinedThing.%loop-value%})
            add 1 to {Slots.%{_P}%}
          
          
          
function PlayerStatus1ao(P: player, S: player):
  
    wait 2 tick
  
    open virtual chest with size 4 named "&lSpeler status: &7%{_S}%" to {_P}
  
  
    set {Slots.%{_P}%} to 0
    loop 4 times:
        loop 9 times:
            format gui slot {Slots.%{_P}%} of {_P} with 1 light gray stained glass pane named " &a " to do nothing
            add 1 to {Slots.%{_P}%}
          
    format gui slot 10 of {_P} with 1 bonemeal named "&fBank: &e%{Balance.%{_S}%}%" to do nothing
    format gui slot 11 of {_P} with 1 wait disc named "&fMinecoins: &b%{Minecoins.%{_S}%}%" to do nothing
    format gui slot 12 of {_P} with 1 xp bottle named "&fLevel: &5%{Level.%{_S}%}%" to do nothing
    format gui slot 13 of {_P} with 1 clock named "&fEerste join: &a%{Firstjointje.%{_S}%}%" to do nothing
    format gui slot 14 of {_P} with 1 compass named "&fLaatst gejoind: &a%{Lastjoin.%{_S}%}%" to do nothing
    format gui slot 16 of {_P} with 1 wooden sword named "&fSpeler vermoord: &c%{Killed.%{_S}%}%" to do nothing
    if {_S} is online:
        format gui slot 15 of {_P} with 1 glowstonedust named "&fOnline: &aJa" to do nothing
    else:
        format gui slot 15 of {_P} with 1 gunpowder named "&fOnline: &cNee" to do nothing
  
  
    format gui slot 31 of {_P} with 1 barrier named "&7Terug naar Speler status" to close then run function SRefresh({_P})



function SRefresh(P: player):
  
    open virtual chest with size 6 named "&lSpeler status" to {_P}
    Refresh({_P})

  
  
function Nextpage(P: player):
    add 1 to {Page.%{_P}%}
    Refresh({_P})
  
  
  
function BackPage(P: player):
    remove 1 from {Page.%{_P}%}
    Refresh({_P})

  
  
function Seealladmin(P: player):
  
    set {Page.%{_P}%} to 1
    open virtual chest with size 6 named "&lSpeler status" to {_P}
    Refresh({_P})



command /test:
    trigger:
        Seealladmin(player)
Error message:

there is none

I think the problem is in line 53
 
Last edited:
Status
Not open for further replies.