Solved Doesnt execute a command once i join the server

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

Time4Games

Active Member
Jul 25, 2020
203
4
18
Basically im working on a server and i want a scoreboard to show the blocks a player have. The problem is that when i join it doesnt execute the command "scoreboard1 %player%"
help pls





Code:
on join:
  execute command "scoreboard1 %player%"
    
command /scoreboard1 <player>:
  permission:sk.developer
  trigger:
    wipe player's sidebar
    set name of sidebar of arg-1 to  "&3Blocks:"
    if {glass::%arg-1%} is bigger than 0:
      set score "&3Glass" in sidebar of arg-1 to {glass::%arg-1%}
      execute command "scoreboard2 %arg-1%"
    else:
      execute command "scoreboard2 %arg-1%"
 
Basically im working on a server and i want a scoreboard to show the blocks a player have. The problem is that when i join it doesnt execute the command "scoreboard1 %player%"
help pls





Code:
on join:
  execute command "scoreboard1 %player%"
   
command /scoreboard1 <player>:
  permission:sk.developer
  trigger:
    wipe player's sidebar
    set name of sidebar of arg-1 to  "&3Blocks:"
    if {glass::%arg-1%} is bigger than 0:
      set score "&3Glass" in sidebar of arg-1 to {glass::%arg-1%}
      execute command "scoreboard2 %arg-1%"
    else:
      execute command "scoreboard2 %arg-1%"
Try:
code_language.skript:
on join:
    while player is online:
        wipe player's sidebar
        set name of sidebar of player to "&3Blocks"
        if {glass::%player%} > 0:
            set score "&3Glass" in sidebar of player to {glass::%player%}
            #console command "scoreboard2 %arg 1%" <-- ?
        else:
            wipe player's sidebar 
            set name of sidebar of player to "Second score"
            #do stuff
        wait 5 seconds
You should check if the variable {glass::%arg 1%} corresponds to a number associated with a player. Also, i think it is unnecessary to create the scoreboard using a command. I find it more efficient this way or creating a function.
 
Thanks you it works.
Also i used the commands becuase i cant do it without them(at least i dont know how), if i try to do it without commands every thing messes up.
Thanks for the help
 
Status
Not open for further replies.