Hello! I am trying to make a simple skript where I can easily copy and paste files to create many easy to make shops. For my code, I need the Functions to have specific names for each skript file.
The error I am receiving is caused by the option tag. It is saying how Function names can only be letters and underscores, meaning it isn't picking up the option tag as the option itself.
Is there a way to have options in Function names? Or is there a work around? I have the idea of using commands instead, but would like to use Functions for this project. Thanks!
code_language.skript:
options:
shopname: TestMerchant
name: Dealer
item1: leather
name1: &eLeather
lore1: &eTest
cost1: &eTest
on npc right click:
npc is named "{@name}"
open virtual dispenser inventory with name "&6&l{@name}" to player
format gui slot 0 of player with {@item1} named "&r{@item1}" with lore "{@lore1}||&r&l${@cost1}" to run function itemone{@shopname}(player)
function itemone{@shopname}(p: player):
if {_p}'s balance is below {@cost1}:
send "&l&7[&4!&7]&r You do not have enough money to buy this item!" to {_p}
else:
remove {@cost1} from {_p}'s balance
give a {@item1} named "{@name1}" with lore "{@lore1}" to {_p}
Is there a way to have options in Function names? Or is there a work around? I have the idea of using commands instead, but would like to use Functions for this project. Thanks!