Solved When to use % signs

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

EcHo SKitt

Member
Oct 25, 2019
3
0
0
23
!!! BTW the list variables.sk is the other person I was talking about !!!


In an "if" statement I use just
Code:
If arg-1 is set:
  if arg-1 is "Creative":
    send "Teleporting You to Creative" to player
    make console execute command "/mvtp %player% to creative

But I was looking at someone elses skript and they did this
Code:
if arg-1 is set:
   if {blockedcommands::*} contains "%arg-1%":
     send "{@alreadyBlocked}"
And im wondering why they added the "%arg-1%" ????
 

Attachments

  • List Varibles.sk
    1.4 KB · Views: 132
Percentage is used when you want to show (or enter) specified placeholder, and not its tag. For example, if your player is named "Steve", and you're willing to show his name in chat, you need to add %player%, and that placeholder will be changed to player's name. If you just enter word ' player' without percentages at beggining and at the end, in chat you will just see that word, and not player's name. Percentages are also used in commands, for example if you use minecraft command /teleport, and you want to teleport to someone, you can't enter - /teleport player (that will start /tp PLAYER command, and not /tp Steve), you need to add percentages to make it work like it is supposed to.
 
Percentage is used when you want to show (or enter) specified placeholder, and not its tag. For example, if your player is named "Steve", and you're willing to show his name in chat, you need to add %player%, and that placeholder will be changed to player's name. If you just enter word ' player' without percentages at beggining and at the end, in chat you will just see that word, and not player's name. Percentages are also used in commands, for example if you use minecraft command /teleport, and you want to teleport to someone, you can't enter - /teleport player (that will start /tp PLAYER command, and not /tp Steve), you need to add percentages to make it work like it is supposed to.
thanks for that very useful
 
Status
Not open for further replies.