Hello, I'm currently making a skyblock server, anyways I've been trying to skript sellwands. I'm wanting various ones limited to a certain amount of uses, at the moment I've only got an infinite one. How could I make this limited to around 100 uses etc. Hope one of you guys can help me out!
Heres my current code:
Heres my current code:
Code:
options:
tag: &d&lSELLWAND &8»&7
command /sellwand:
trigger:
if player's inventory contains name tag named "&8» &d&lSELLWAND" with lore "&7 &oRight-Click &7on a chest.":
send "{@tag} You already have a &dsell wand&7."
stop
else:
give 1 name tag named "&8» &d&lSELLWAND" with lore "&7 &oRight-Click &7on a chest." to player
send "{@tag} You got a &dsell wand&7."
stop
on right-click:
if event-block is chest or trapped chest:
if player's tool is name tag named "&8» &d&lSELLWAND" with lore "&7 &oRight-Click &7on a chest.":
cancel event
loop all items in inventory of clicked block:
if loop-item is cactus:
set {_items} to number of cactus in inventory of event-block
set {_money} to unformat("%{balance::%player%}%")
set {_result} to ({_items} * 10)
add {_result} to {_money}
set {_resultFormat} to format({_result})
set {balance::%player%} to format({_money})
send "{@tag} You sold &d%{_items}% &7of &dcactus &7and you got &d$%{_resultFormat}%&7." to player
remove all cactus from inventory of event-block
if loop-item is sugar cane:
set {_items} to number of sugar cane in inventory of event-block
set {_money} to unformat("%{balance::%player%}%")
set {_result} to ({_items} * 5)
add {_result} to {_money}
set {_resultFormat} to format({_result})
set {balance::%player%} to format({_money})
send "{@tag} You sold &d%{_items}% &7of &dsugar cane &7and you got &d$%{_resultFormat}%&7." to player
remove all sugar cane from inventory of event-block
if loop-item is pumpkin:
set {_items} to number of sugar cane in inventory of event-block
set {_money} to unformat("%{balance::%player%}%")
set {_result} to ({_items} * 6.25)
add {_result} to {_money}
set {_resultFormat} to format({_result})
set {balance::%player%} to format({_money})
send "{@tag} You sold &d%{_items}% &7of &dpumpkin &7and you got &d$%{_resultFormat}%&7." to player
remove all pumpkin from inventory of event-block
if loop-item is melon slice:
set {_items} to number of melon slice in inventory of event-block
set {_money} to unformat("%{balance::%player%}%")
set {_result} to ({_items} * 2.5)
add {_result} to {_money}
set {_resultFormat} to format({_result})
set {balance::%player%} to format({_money})
send "{@tag} You sold &d%{_items}% &7of &dmelon slice &7and you got &d$%{_resultFormat}%&7." to player
remove all melon slice from inventory of event-block
if loop-item is poppy:
set {_items} to number of poppy in inventory of event-block
set {_money} to unformat("%{balance::%player%}%")
set {_result} to ({_items} * 1)
add {_result} to {_money}
set {_resultFormat} to format({_result})
set {balance::%player%} to format({_money})
send "{@tag} You sold &d%{_items}% &7of &dpoppy &7and you got &d$%{_resultFormat}%&7." to player
remove all poppy from inventory of event-block
if loop-item is iron ingot:
set {_items} to number of iron ingot in inventory of event-block
set {_money} to unformat("%{balance::%player%}%")
set {_result} to ({_items} * 37.5)
add {_result} to {_money}
set {_resultFormat} to format({_result})
set {balance::%player%} to format({_money})
send "{@tag} You sold &d%{_items}% &7of &diron ingot &7and you got &d$%{_resultFormat}%&7." to player
remove all iron ingot from inventory of event-block
on right-click:
if event-block is chest or trapped chest:
if player's tool is name tag named "&8» &d&lSELLWAND" with lore "&7 &oRight-Click &7on a chest.":
cancel event
loop all items in inventory of clicked block:
if loop-item is iron ore:
set {_items} to number of iron ore in inventory of event-block
set {_money} to unformat("%{balance::%player%}%")
set {_result} to ({_items} * 18.75)
add {_result} to {_money}
set {_resultFormat} to format({_result})
set {balance::%player%} to format({_money})
send "{@tag} You sold &d%{_items}% &7of &diron ore &7and you got &d$%{_resultFormat}%&7." to player
remove all iron ore from inventory of event-block
Last edited: