Hello, I have a skript with folder and I try to play an sound from config.yml when player join on server. Code (Text): set yml value "JoinSound" of file "plugins/MythCore/Config.yml" to "AMBIENCE_CAVE" set {_JoinSound} to yaml value "JoinSound" from "plugins/MythCore/Config.yml" play "%{_JoinSound}%" to player at volume 15 And I get this error in console: is not a valid sound type...How to fix?
according to this it accepts both minecraft sound names and spigot sound enums: https://skriptlang.github.io/Skript/effects.html#EffPlaySound no need to parse as sound, if even possible
Code (Text): on load: if file "plugins/MythCore/Config.yml" doesn't exist: create file "plugins/MythCore/Config.yml" set yml value "JoinMsg" of file "plugins/MythCore/Config.yml" to "&d%%player%% a intrat pe server." set yml value "LeaveMsg" of file "plugins/MythCore/Config.yml" to "&c%%player%% a 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 "1.0" on join: set {_Sound} to yaml value "Sound" from "plugins/MythCore/Config.yml" set {_SoundVolume} to yaml value "SoundVolume" from "plugins/MythCore/Config.yml" set join message to "%{_JoinMsg}%" play sound "%{_Sound}%" with volume {_SoundVolume} to player This is the new code, %%player%% get recognized as <none> how to fix this, and {_SoundVolume} doesn't work...I don't know how to fix it.
Code (Text): on load: if file "plugins/MythCore/Config.yml" doesn't exist: create file "plugins/MythCore/Config.yml" set yml value "JoinMsg" of file "plugins/MythCore/Config.yml" to "&d%%player%% a intrat pe server." set yml value "LeaveMsg" of file "plugins/MythCore/Config.yml" to "&c%%player%% a 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 "1.0" on join: set {_Sound} to yaml value "Sound" from "plugins/MythCore/Config.yml" set {_SoundVolume} to yaml value "SoundVolume" from "plugins/MythCore/Config.yml" set join message to "%{_JoinMsg}%" play sound "%{_Sound}%" with volume {_SoundVolume} to player This is the new code, %%player%% get recognized as <none> how to fix this, and {_SoundVolume} doesn't work...I don't know how to fix it.
you need to replace %player% with player's name and parse SoundVolume as a number and as I see you are simply making a configuration of messages in skript, why? Skript is human-readable already, it's not Java where you have to decompile, so there's absolutely no point in making configuration for messages if you aren't making multi-language support, since people can just change messages in .sk file, it only makes it a harder job for you to parse stuff