Been using Java for a few months now, wanted to see what Skript was all about. I'm re-writing one of my Java plugins in Skript and I've hit a wall.
How would I go about creating a check to see if a command argument for <text> exists in a list.
Ex (pseudo-code):
Example command with correct format:
/cmd give Cart 10 slowball
[doublepost=1603222628,1603221830][/doublepost]I should note that I want to avoid spaghetti code.
I don't want my Skript to look like this:
How would I go about creating a check to see if a command argument for <text> exists in a list.
Ex (pseudo-code):
Code:
<my items>:
switcher:
lore: the lore
title: the title
enchant: the enchant on the item
slowball:
lore: the lore
title: the title
enchant: the enchant on the item
command /cmd give <player> <number> <text>:
trigger:
if argument 1 is <my items>:
do stuff
Example command with correct format:
/cmd give Cart 10 slowball
[doublepost=1603222628,1603221830][/doublepost]I should note that I want to avoid spaghetti code.
I don't want my Skript to look like this:
Code:
if arg 1 is "item1":
give player (item argument)
if arg 1 is "item2":
give player (item argument)
if arg 1 is "item3":
give player (item argument)