1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Define a variable properly

Discussion in 'Skript' started by pierrejuve, Apr 5, 2020.

Thread Status:
Not open for further replies.
  1. pierrejuve

    pierrejuve Member

    Joined:
    Aug 14, 2017
    Messages:
    1
    Likes Received:
    0
    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 (Text):
    1. on region enter:
    2.     if {offcompass::*} is set:
    3.         if "%event-region%" contains {my_variable}:
    4.             if player's group is "Master":
    5.                 execute command "/pex user %player% add -worldedit.navigation.jumpto.tool"
    6.                 execute command "/pex user %player% add -worldedit.navigation.jumpto.command"
    7.  
    8. on region exit:
    9.     if {offcompass::*} is set:
    10.         if "%event-region%" contains {my_variable}:
    11.             if player's group is "Master":
    12.                 execute command "/pex user %player% remove -worldedit.navigation.jumpto.tool"
    13.                 execute command "/pex user %player% remove -worldedit.navigation.jumpto.command"
    Thank you for your help :emoji_wink: !
     
  2. GuardDev

    GuardDev Member

    Joined:
    Apr 5, 2020
    Messages:
    19
    Likes Received:
    4
    Code (Text):
    1. {my_variable}
    ->
    Code (Text):
    1. "{my_variable}"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...