Define a variable properly

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

pierrejuve

Member
Aug 14, 2017
1
0
1
26
Hello everybody.
Lately I haven't been able to properly define a skript variable.
Indeed I would like to use the condition : if "% event-region%" contains {my_variable}:
However I would like to be able to modify {my_variable} to be able to add or remove text.
For example if the variable is set to "test" with a command i want to add "test2" the result will be "test test2".
Here is the skript code so you can understand why i need this and if it's possible or not.


Code:
on region enter:
    if {offcompass::*} is set:
        if "%event-region%" contains {my_variable}:
            if player's group is "Master":
                execute command "/pex user %player% add -worldedit.navigation.jumpto.tool"
                execute command "/pex user %player% add -worldedit.navigation.jumpto.command"

on region exit:
    if {offcompass::*} is set:
        if "%event-region%" contains {my_variable}:
            if player's group is "Master":
                execute command "/pex user %player% remove -worldedit.navigation.jumpto.tool"
                execute command "/pex user %player% remove -worldedit.navigation.jumpto.command"

Thank you for your help :emoji_wink: !
 
Status
Not open for further replies.