Skript Yaml Error, Player does not get recognized

Discussion in 'Skript' started by Stoian, Feb 9, 2020.

  1. Code (Text):
    on script load:
        if file "plugins/MythCore/Config.yml" doesn't exist:
            create file "plugins/MythCore/Config.yml"
            set yml value "Prefix" of file "plugins/MythCore/Config.yml" to "&5&lMyth &8➥"
            set yml value "JoinMsg" of file "plugins/MythCore/Config.yml" to "%%player%% &fa intrat pe server."
            set yml value "LeaveMsg" of file "plugins/MythCore/Config.yml" to "%%player%% &fa iesit de pe server."
            set yml value "Sound" of file "plugins/MythCore/Config.yml" to "entity.experience_orb.pickup"
            set yml value "SoundVolume" of file "plugins/MythCore/Config.yml" to 0.5


     
    on join:
        set {_JoinMsg} to yaml value "JoinMsg" from "plugins/MythCore/Config.yml"
        set {_Sound} to yaml value "Sound" from "plugins/MythCore/Config.yml"
        set {_SoundVolume} to yaml value "SoundVolume" from "plugins/MythCore/Config.yml"
        set yaml value "%%player%%" from "plugins/MythCore/Config.yml" to player
        set join message to "%{_JoinMsg}%"
        play sound "%{_Sound}%" with volume {_SoundVolume} to the player
    When I join on server, tell me: %player% joined server, does not show player name...how to fix?
     
  2. Code (YAML):
    on script load:
        if file "plugins/MythCore/Config.yml" doesn't exist
    :
           create file "plugins/MythCore/Config.yml"
            set yml value "Prefix" of file "plugins/MythCore/Config.yml" to "&5&lMyth &8➥"
            set yml value "JoinMsg" of file "plugins/MythCore/Config.yml" to "{player} &fa intrat pe server."
            set yml value "LeaveMsg" of file "plugins/MythCore/Config.yml" to "{player} &fa iesit de pe server."
            set yml value "Sound" of file "plugins/MythCore/Config.yml" to "entity.experience_orb.pickup"
            set yml value "SoundVolume" of file "plugins/MythCore/Config.yml" to 0.5


    on join
    :
       set {_JoinMsg} to yaml value "JoinMsg" from "plugins/MythCore/Config.yml"
        set {_Sound} to yaml value "Sound" from "plugins/MythCore/Config.yml"
        set {_SoundVolume} to yaml value "SoundVolume" from "plugins/MythCore/Config.yml"
        replace all "{player}" in {_JoinMsg} with "%player%"
        set join message to "%{_JoinMsg}%"
        play sound "%{_Sound}%" with volume {_SoundVolume} to the player

    You can do it by this way bro
     
  3. Thanks bro. Also can you show me a code for: when player join first time on server, to show him a message with number that he is joined. Like he is player ten, five, fifty etc. And a command that I can check total player count. Total numbers like
     
  4. Yes bro, about a player number you can do a list like this, i don't know if this is the most easy way, but it's a good way
    Code (Text):
    on join:
        if {n} isn't set:
            set {n} 0
        if{playersnumber::%player%} isn't set:
            add 1 to {n}
            set {playersnumber::%player%} to {_n}
            send "&fYou are the player &e%{playersnumber::%player%}%"
    And about players number:
    Code (Text):
    on join:
        set {players.online} to number of all players
     
    • Like Like x 1
  5. Thanks bro!
     
  6. But I have two errors bro:
    Can't understand this condition: set {n} to 0 and if {playersnumber::%player%} isn't set. And I want for first join, and how to do command for reset numbers if I want sometimes to do it?
     
  7. Check the spaces with all errors, because can't have bugs because it's simple code, and about a command to reset create any command and put into the trigger "delete {n}" obiusly without the two "
     
  8. https://imgur.com/a/Yq8vtsR still not working...
    EDIT: you didn't added a to and space to if %player%... isn't set. Fixed now!
     
  9. Code (Text):
    command /test:
        trigger:
            set {playersnumber::%player%} to {_n}
            delete {n}
            message "Player numbers succesfully reseted!"
    And when joining again, doesn't show me the message...
    And: https://imgur.com/a/Q3ReYry
     
  10. lol i coded so fast and wrote dumb mistakes, it's set {_n} to 0 not set {n} 0, and i said you that check spaces
     
  11. and i don't understand why you put this line in your command
    Code (Text):
            set {playersnumber::%player%} to {_n}
     
     
  12. The code still don't working...I tried to fix it, but it won't work to reset, and show me the number...
     
  13. change {_n} to {n}
     
  14. Exactly, but anyway in you command you don't need set {playersnumber::%player%}
     
  15. Thanks, and how to do command for reset this?
    My code:
    Code (Text):
    command /test:
        trigger:
            clear {n}
            message "Player numbers succesfully reseted!"
     
  16. should work
     
  17. Replace clear by delete, because clear it's used for a list.
     
  18. Still not...
    Code (Text):
    on first join:
        if {n} is not set:
            set {n} to 0
        if {playersnumber::%player%} is not set:
            add 1 to {n}
            set {playersnumber::%player%} to {n}
            send "&fYou are the player with number &e%{playersnumber::%player%}%"


    command /test:
        trigger:
            delete {n}
            message "Player numbers succesfully reseted!"
     
  19. nop...
    Code (Text):
    on first join:
        if {n} is not set:
            set {n} to 0
        if {playersnumber::%player%} is not set:
            add 1 to {n}
            set {playersnumber::%player%} to {n}
            send "&fYou are the player with number &e%{playersnumber::%player%}%"


    command /test:
        trigger:
            delete {n}
            message "Player numbers succesfully reseted!"
     
  20. errors? you may want to use on join instead btw it's reset not reseted in English grammar