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 our 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 Need help with Scoreboards

Discussion in 'Skript' started by Adrihun, May 8, 2017.

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

    Adrihun Member

    Joined:
    Feb 1, 2017
    Messages:
    368
    Likes Received:
    6
    I can't make Scoreboards work. This is my code:

    Code (Skript):
    1.  
    2. on join:
    3.     createBoard(player, "KITBOARD", 15)
    4.     set title of stylish scoreboard "KITBOARD-%player%" to "  &a&lKITPVP  "
    5.     set stylish scoreboard of player to "KITBOARD-%player%"
    6.     updateBoard(player)
    7. function updateBoard(p: player):
    8.     setSlot(player, "KITBOARD", 15, "&c&lServer")
    9.     setSlot(player, "KITBOARD", 14, "&fKitPVP")
    10.     setSlot(player, "KITBOARD", 12, "&c&lMoney")
    11.     setSlot(player, "KITBOARD", 11, "&c&lbalance")
    12.     setSlot(player, "KITBOARD", 9, "&c&lRank")
    13.     setSlot(player, "KITBOARD", 8, "&fTest")
    14.     setSlot(player, "KITBOARD", 6, "&c&lWebsite")
    15.     setSlot(player, "KITBOARD", 5, "&flol.com")
    16.     setSlot(player, "KITBOARD", 4, "&7-----------------------------")
    17.  
    And this is the error i get when I do /skript reload scoreboard
    https://hastebin.com/jelidozibi.vbs - How do I fix this?
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    I AM NO GENIUS HERE BUT "
    The function 'createBoard' does not exist."

    I DON'T THINK THE FUNCTION EXISTS M8
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    The function need to be writed first of the code.
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    I don't know how to do it xd
    I just need a simple scoreboard. I tried SkRayfall one and it gave me lots of errors
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1. function updateBoard(p: player):
    2.     setSlot(player, "KITBOARD", 15, "&c&lServer")
    3.     setSlot(player, "KITBOARD", 14, "&fKitPVP")
    4.     setSlot(player, "KITBOARD", 12, "&c&lMoney")
    5.     setSlot(player, "KITBOARD", 11, "&c&lbalance")
    6.     setSlot(player, "KITBOARD", 9, "&c&lRank")
    7.     setSlot(player, "KITBOARD", 8, "&fTest")
    8.     setSlot(player, "KITBOARD", 6, "&c&lWebsite")
    9.     setSlot(player, "KITBOARD", 5, "&flol.com")
    10.     setSlot(player, "KITBOARD", 4, "&7-----------------------------")
    11.        
    12. on join:
    13.     createBoard(player, "KITBOARD", 15)
    14.     set title of stylish scoreboard "KITBOARD-%player%" to "  &a&lKITPVP  "
    15.     set stylish scoreboard of player to "KITBOARD-%player%"
    16.     updateBoard(player)
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Are you all brain dead? the function SetSlot() does not exist.
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    "createBoard(player, "KITBOARD", 15)" createBoard too , he didn't send the whole code.
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Thats the whole code i got it from LimeGlass
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Rewrite it. It could be the wrong version of Skript.
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1. function createBoard(p: player, t: text, size: integer = 15):
    2.     add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
    3.     if stylish scoreboard "%{_t}%-%{_p}%" does not exist:
    4.         create new stylish scoreboard named "%{_t}%-%{_p}%"
    5.         loop {_size} times:
    6.             create a new id based score "%{_p}%Slot%loop-number%" with text "%{_d::%loop-number%}%" slot loop-number for stylish scoreboard "%{_t}%-%{_p}%"
    7.  
    8. function deleteBoard(p: player, t: text):
    9.     loop 15 times:
    10.         delete the id based score "%{_p}%Slot%loop-number%" in stylish scoreboard "%{_t}%-%{_p}%"
    11.     delete stylish scoreboard "%{_t}%-%{_p}%"
    12.  
    13. function setSlot(p: player, board: text, slot: integer, t: text):
    14.     add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
    15.     if {_slot} is between 1 and 15:
    16.         set text of id "%{_p}%Slot%{_slot}%" to "%{_d::%{_slot}%}%%{_t}%"
    17.  
    18. command /board:
    19.     trigger:
    20.         createBoard(player, "Example", 3)
    21.         set title of stylish scoreboard "Example-%player%" to "&a&lSkellett"
    22.         set stylish scoreboard of player to "Example-%player%"
    23.         setSlot(player, "Example", 3, "&6Yeee boi")
    24.         setSlot(player, "Example", 2, "&a&lSkellett stylish scoreboards ftw")
    25.         wait 2 seconds
    26.         deleteBoard(player, "Example")
    27.  
    28. function updateBoard(p: player):
    29.     setSlot({_p}, "KITBOARD", 15, "&c&lServer")
    30.     setSlot({_p}, "KITBOARD", 14, "&fKitPVP")
    31.     setSlot({_p}, "KITBOARD", 12, "&c&lMoney")
    32.     #setSlot({_p}, "KITBOARD", 11, "&c&l%{_p}'s balance%")
    33.     setSlot({_p}, "KITBOARD", 9, "&c&lRank")
    34.     setSlot({_p}, "KITBOARD", 8, "&f%{rank.%{_p}%}%")
    35.     setSlot({_p}, "KITBOARD", 6, "&c&lWebsite")
    36.     setSlot({_p}, "KITBOARD", 5, "&fnpc-network.net")
    37.     setSlot({_p}, "KITBOARD", 4, "&7-----------------------------")
    38.  
    39. on join:
    40.     createBoard(player, "KITBOARD", 15)
    41.     set title of stylish scoreboard "KITBOARD-%player%" to "  &a&lKITPVP  "
    42.     set stylish scoreboard of player to "KITBOARD-%player%"
    43.     updateBoard(player)
    44.  
    45. every 2 seconds:
    46.     loop all players:
    47.         updateBoard(loop-player)
    48.  
    49. on disconnect:
    50.     deleteBoard(player, "KITBOARD")
     
    #11 ShaneBee, May 8, 2017
    Last edited by a moderator: May 8, 2017
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    thanks but thats a big code for a simple scoreboard.
    I love the skrayfall one but its broken!
    Is there any other addons that do scoreboard and its easy?
    --- Double Post Merged, May 8, 2017, Original Post Date: May 8, 2017 ---
    Update: I'm trying to add the name feature to the scoreboard with %player%, so it will show you your name. This is the error i'm getting.
    [19:58:55 ERROR]: Variables cannot be used here. (scoreboard.sk, line 29: setSlo
    t({_p}, "Board", 14, "&f%player%")')
    How can i fix this?
     
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1. %{_p}'s name%
     
    • Like Like x 1
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    @YoshYz What about my custom Economy variable?

    This is how I used it in the first one,
    Code (Skript):
    1. on join:
    2.     player has permission "scoreboarddzz.use"
    3.     $ thread
    4.     set {_amount} to checkRubies(player)
    5.     set {_message} to "[AMOUNT]"
    6.     replace "[AMOUNT]" in {_message} with "%{_amount}%"
    7.     wipe player's sidebar
    8.     set score "&f%{_message}%" in sidebar of player to 1
    Can't do this in "function"
     
  15. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Didn't understand what you need for the code above :emoji_stuck_out_tongue:
     
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    okay.. let me try explaining it to you lol
    So i got money script (mysql) and i want the money to show up on scoreboard.
    The only way i can do this is by adding this mysql part to the script, and i can't do that on the function script (lime glass's script)
     
  17. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Just get the mysql data , set them into a variable and put it into the setSlot.
     
  18. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    I don't know how to do that. Thats the last thing i need to fix with the scoreboard, and then i can set the title to "Solved".
     
  19. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Don't know your table etc from mysql , but that's an example
    Code (Skript):
    1. set {_data::*} to objects in column "amount" from result of query "SELECT amount FROM money WHERE uuid = '%uuid of player%'" and close
    2. set {_amount} to "%{_data::*}%" parsed as number
    3. setSlot(player, "BOARD", 1, "%{_amount}%")
     
  20. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    do you think this whole script will lag my server?
    --- Double Post Merged, May 8, 2017, Original Post Date: May 8, 2017 ---
    [21:31:17 ERROR]: There's no player in a function event (scoreboard.sk, line 27:
    set {_data::*} to objects in column "amount" from result of query "SELECT amoun
    t FROM rubies WHERE uuid = '%uuid of player%'" and close')
     
Thread Status:
Not open for further replies.
Loading...