Solved Split a 2 part expression

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

    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.

Donut

Well-Known Member
Mar 27, 2017
1,336
177
0
U.S.
Is it possible to split an expression that has 2 parts and assign each part to a different variable? This might not make sense so here's an example.

code_language.skript:
on inventory click:
    broadcast "clicked  item"

Clicked item returns something such as "5 cobblestone" so is there a way to set one variable to "5" and one variable to "cobblestone"?

If that's not possible, is there a way to get just the number of the clicked item?
 
If you're using the Bensku's fork you can use the item amount expression for get that number. If you aren't then you'll have to install Skellett if you don't have it yet and use the size of item stack expression from it. Just use the type of expression for get the type of the item.
 
Status
Not open for further replies.