How can I use a variable in a command line.

  • 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 community!

    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!

emju

Member
Feb 1, 2024
1
0
1
The script makes a trail behind a player.

How can I use a variable in? Im trying to make the particles change, but the particles is not appereaing. (The problem is in the draw 5 of %{typeofparticles}% at player ~ {_v} with extra 0 to all players, how can i make it work?)

Dont mind in language.

code_language.skript:
on load:
    set {boolean} to yes
    set {typeofparticles} to "heart"

on player move:
    if player has permission "rmwtrail.trail":
        if {boolean} is yes:
            draw 5 of %{typeofparticles}% at player ~ {_v} with extra 0 to all players
            wait 2 ticks
        
command /trail [<text>]:
    trigger:
        if arg 1 is "on":
            send "&9&l[&r&6&lRMW Trail&9&l] &aPomyślnie wlączono efekt."
            set {boolean} to yes
        if arg 1 is "off":
            send "&9&l[&r&6&lRMW Trail&9&l] &cPomyślnie wylączono efekt."
            set {var::boolean} to no
        if arg 1 is "heart":
            set {typeofparticles} to "heart"
        if arg 1 is "cloud":
            set {typeofparticles} to "cloud"
            send "%{typeofparticles}%"
        





on tab complete of "/trail":
    set tab completions for position 1 to "on", "off", "heart" and "cloud"
 
The script makes a trail behind a player.

How can I use a variable in? Im trying to make the particles change, but the particles is not appereaing. (The problem is in the draw 5 of %{typeofparticles}% at player ~ {_v} with extra 0 to all players, how can i make it work?)

Dont mind in language.

code_language.skript:
on load:
    set {boolean} to yes
    set {typeofparticles} to "heart"

on player move:
    if player has permission "rmwtrail.trail":
        if {boolean} is yes:
            draw 5 of %{typeofparticles}% at player ~ {_v} with extra 0 to all players
            wait 2 ticks
      
command /trail [<text>]:
    trigger:
        if arg 1 is "on":
            send "&9&l[&r&6&lRMW Trail&9&l] &aPomyślnie wlączono efekt."
            set {boolean} to yes
        if arg 1 is "off":
            send "&9&l[&r&6&lRMW Trail&9&l] &cPomyślnie wylączono efekt."
            set {var::boolean} to no
        if arg 1 is "heart":
            set {typeofparticles} to "heart"
        if arg 1 is "cloud":
            set {typeofparticles} to "cloud"
            send "%{typeofparticles}%"
      





on tab complete of "/trail":
    set tab completions for position 1 to "on", "off", "heart" and "cloud"
You only use percents around variables if they're in a text. If they are not in a text, there's no percents. So, change %{typeofparticles}% to {typeofparticles}.
 
  • Like
Reactions: emju