Can't understand this structure

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

za_breado

Member
Apr 12, 2024
23
2
3
23
I'm trying to use "if size of a variable", but it isn't working

Addons: Skellet, SkQuery, skRayFall, Skbee, skript-gui

Code:
CoffeeScript:
if size of {compactors::%player's uuid%::*} is 7:
    send "work" to player
 

Attachments

  • problem.png
    problem.png
    19.1 KB · Views: 30
This code should work when using integers in Skript.

Code:
command /integer:
    trigger:
        set {_integer} to a random integer between 1 and 10
        if {_integer} is between 1 and 5:
            #do something
        else if {_integer} is between 5 and 10:
            #do something else

This code is untested. Please let me know if it works.
 
I'm trying to use "if size of a variable", but it isn't working

Addons: Skellet, SkQuery, skRayFall, Skbee, skript-gui

Code:
CoffeeScript:
if size of {compactors::%player's uuid%::*} is 7:
    send "work" to player
I'm not fully sure what you're trying to check for but I'm going to guess that you're trying to see how many compactors a player has. In which case, you don't have to check the 'size' of it, just check if a certain number of the list is set as a value.

Ie: if {Example::7} is set.
Let me know if that's the solution you were looking for! If not, lemme know the intention of the first line and I'll see if I can come up with a better solution.