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

AlfaLe0

Member
Mar 2, 2018
25
0
0
34
Which are the differences between {xp.%player%} and {xp::%player%} ? I don’t understand
 
If you use {xp.%player%}, and for some reasons you want to delete all the xp variables, you need to have a offline player list, loop it and delete it for every player. If you use {xp::%player%}, and want to delete it, you can easily use
code_language.skript:
delete {xp::*}
also {xp::%player%} can easily be called with {xp::*} if you want to get all of them.
EDIT:
The old Skript documentation says it as well:
All you need to do is set the name (The part after the colons) in the variable. You can write it out, or you can even use expressions to set it for you:

set {list::mod} to 7
set {list::%player%} to true

Notice that we no longer use the 'add' effect? This is because we are not simply adding a box to the room (Which would give us the default number system), but we are adding a box with a specific name. So we need to set that box's name to something, and give it a value. You can also use this method to access a specific box in the room (One value out of a list variable) at any time in your code. This makes them work very similar to nested variables.

This technique allows for the quick deletion of a list of variables. Rather than setting nested variables to a value, you can do the same thing with a list variable, but it will be set up in such a way to be able to easily delete the entire list:

set {mod.%player%} to true # Old method
set {mod.list::%player%} to true #New method

delete {mod.list::*} #When you use the * as the index it refers to the entire room, rather than a specific box

Looping
To start a loop of a list variable you start it off with:

loop {list::*}:
 
Last edited:
Status
Not open for further replies.