Is there a way this works?
Basically what I want to do here is that in the second argument of the function you can "save" the variable placed to be able to use it later.My question is whether that is possible, for example to do something like this: (Taking the function that I wrote earlier)
[doublepost=1556071252,1556066436][/doublepost]I just found a way to do it.
code_language.skript:
function worldexpNivelDelJugador(p: player, variable: string):
if {worldexp.nivel.%{_p}%} is between 1 and 4:
set {_%{_variable}%} to "&8[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} is between 5 and 9:
set {_%{_variable}%} to "&7[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} is between 10 and 14:
set {_%{_variable}%} to "&f[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} is between 15 and 19:
set {_%{_variable}%} to "&2[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} is between 20 and 24:
set {_%{_variable}%} to "&3[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} is between 25 and 29:
set {_%{_variable}%} to "&5[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} is between 30 and 34:
set {_%{_variable}%} to "&1[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} is between 35 and 39:
set {_%{_variable}%} to "&e&l[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} is between 40 and 44:
set {_%{_variable}%} to "&a&l&ki&2&l%{worldexp.nivel.%{_p}%}%&a&l&ki&f %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
else if {worldexp.nivel.%{_p}%} >= 45:
set {_%{_variable}%} to "&3&l&ki&b&l&ki&9&l&o%{worldexp.nivel.%{_p}%}%&b&l&ki&3&l&ki&f %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%"
code_language.skript:
on chat:
cancel event
worldexpNivelDelJugador(player, "_n")
if player has permission "world.chat.suscrito":
if {suscrito.%player%} is not set:
broadcast "&7&ki%{suscrito.%player%}%&7&ki&a %{_n}%&f &9»&b» &6&l%message%"
#...