Solved how to make every player got own sidebar

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

kenkencw

Active Member
Jan 31, 2017
68
0
0
31
Malaysia
www.huskycraftmc.com
MC Version: Spigot 1.9.4
Skript: bensku dev 19
addons:
- skstuff v1.6.3.7
- Tuske 1.6.9.6
- SkRayFall v1.9.5
- SkQuery by gatt (11 May 2016)
- Skellett v1.6.8
- Wild Skript 1.9

problem:
im now using skellett scoreboard, but cannot set different scoreboard for every players

i have thousands of codes, i dont want change to umbaska, umbaska conflict with some important addons, it will spend me too much time to rewrite & test all the codes
 
Are you using skellett stylish boards? They should only show for one player if your code is correct, here is an example:

code_language.skript:
command /applyboard:
  trigger:
    create a new stylish scoreboard named "%player%"
    set title of stylish scoreboard "%player%" to "&a&lHello!"
    create a new id based score "%player%4" with text "This is slot 4" slot 4 for stylish scoreboard "%player%"
    create a new id based score "%player%3" with text "This is slot 3" slot 3 for stylish scoreboard "%player%"
    create a new id based score "%player%2" with text "This is slot 2" slot 2 for stylish scoreboard "%player%"
    create a new id based score "%player%1" with text "This is slot 1" slot 1 for stylish scoreboard "%player%"
    set stylish scoreboard of player to "%player%"
command /updatescores:
  trigger:
    set the text of id "%player%1" to "Slot 1 Updated"
    set the text of id "%player%2" to "Slot 2 Joins in"
    set the text of id "%player%3" to "Slot 3 is here"
    set the text of id "%player%4" to "Slot 4 is best"
command /removeboard:
  trigger:
    reset stylish scoreboard of player
    delete stylish scoreboard named "%player%"
 
skrayfall's scoreboard conflicted with skellett
[doublepost=1486238197,1486237580][/doublepost]
Are you using skellett stylish boards? They should only show for one player if your code is correct, here is an example:

code_language.skript:
command /applyboard:
  trigger:
    create a new stylish scoreboard named "%player%"
    set title of stylish scoreboard "%player%" to "&a&lHello!"
    create a new id based score "%player%4" with text "This is slot 4" slot 4 for stylish scoreboard "%player%"
    create a new id based score "%player%3" with text "This is slot 3" slot 3 for stylish scoreboard "%player%"
    create a new id based score "%player%2" with text "This is slot 2" slot 2 for stylish scoreboard "%player%"
    create a new id based score "%player%1" with text "This is slot 1" slot 1 for stylish scoreboard "%player%"
    set stylish scoreboard of player to "%player%"
command /updatescores:
  trigger:
    set the text of id "%player%1" to "Slot 1 Updated"
    set the text of id "%player%2" to "Slot 2 Joins in"
    set the text of id "%player%3" to "Slot 3 is here"
    set the text of id "%player%4" to "Slot 4 is best"
command /removeboard:
  trigger:
    reset stylish scoreboard of player
    delete stylish scoreboard named "%player%"
this can be my solution, but how to detect exist id? coz i want make it update every 5 sec for all players
 
skrayfall's scoreboard conflicted with skellett
[doublepost=1486238197,1486237580][/doublepost]
this can be my solution, but how to detect exist id? coz i want make it update every 5 sec for all players
I don't think there is a way to check if a score id exists

You just need to remember what you named the score id and do something like

code_language.skript:
every 5 seconds:
  loop all players:
    set the text of id "%loop-player%1" to "Slot 1"
    set the text of id "%loop-player%2" to "Slot 2"
    set the text of id "%loop-player%3" to "Slot 3"
    set the text of id "%loop-player%4" to "Slot 4"

I hear using the "every x timeperiod" effect is a bad idea but I just used it in this example to give you an idea on how to do it
 
I don't think there is a way to check if a score id exists

You just need to remember what you named the score id and do something like

code_language.skript:
every 5 seconds:
  loop all players:
    set the text of id "%loop-player%1" to "Slot 1"
    set the text of id "%loop-player%2" to "Slot 2"
    set the text of id "%loop-player%3" to "Slot 3"
    set the text of id "%loop-player%4" to "Slot 4"

I hear using the "every x timeperiod" effect is a bad idea but I just used it in this example to give you an idea on how to do it
emm so whats the best way to code in this case?
 
Another approach to this is to use while loop with on join event, though I can't comment on how efficient this is compared to looping every x timeperiod.

code_language.skript:
on join:
    while player is online:
        #do something
        wait 5 seconds
 
Status
Not open for further replies.