custom variable shop not working

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

Status
Not open for further replies.
Mar 18, 2021
16
0
1
26
i dont understand whats wrong because it doesnt send any errors it just doesnt work
pls if you know a solution pls help

on inventory click:
if name of player's inventory is "&7&lKITPVP EXTRA ITEMS":
if clicked slot is 13:
cancel event
if {balance::%player%} >= 50:
subtract 50 from {balance::%player%}
give player golden apple named "&7Golden Apple"
if clicked slot is 15:
cancel event
if {balance::%player%} >= 75:
subtract 75 from {balance::%player%}
give player mushroom soup named "&7Soup"
if clicked slot is 11:
cancel event
if {balance::%player%} >= 250:
subtract 250 from {balance::%player%}
give player eye of ender named "&7Adrenalin"
else:
cancel event

skript addons:
skrayfall
skquery
 
ill try the all the above
[doublepost=1616250930,1616233843][/doublepost]Code
Code:
every 5 seconds:
    loop all players:
        if loop-player's world is "hub":
            wipe loop-player's sidebar
            set name of sidebar of loop-player to "&6&lFoxScape"
            set {sidebarname.%loop-player%} to "&6&lFoxScape"
            set id score "&8&m-------------------" in sidebar of loop-player to 11 with id "sidebar11"
            set id score "&6&lYOU:" in sidebar of loop-player to 10 with id "sidebar10"
            set id score "  &fRank &8➢ &7%colored loop-player's prefix%" in sidebar of loop-player to 9 with id "sidebar9"
            set id score "  &fPlayer &8➢ &7%loop-player's name%" in sidebar of loop-player to 8 with id "sidebar8"
            set id score " " in sidebar of loop-player to 7 with id "sidebar7"

            set id score "&3" in sidebar of loop-player to 5 with id "sidebar5"
            set id score "&6&lDiscord:" in sidebar of loop-player to 4 with id "sidebar4"
            set id score "   &fDiscord &8➢ &6/discord" in sidebar of loop-player to 3 with id "sidebar3"
            set id score "&8&m-------------------" in sidebar of loop-player to 2 with id "sidebar2"
            set id score "&6&lFoxScape.minehut.gg" in sidebar of loop-player to 1 with id "sidebar1"
        else if loop-player's world is "prison-c":
            wipe loop-player's sidebar
            set name of sidebar of loop-player to "&6&lFoxScape Prison"
            set {sidebarname.%loop-player%} to "&6&lFoxScape Prison"
            set id score "&8&m-------------------" in sidebar of loop-player to 11 with id "sidebar11"
            set id score "&6&lYOU:" in sidebar of loop-player to 10 with id "sidebar10"
            set id score "  &fRank &8➢ &6C" in sidebar of loop-player to 9 with id "sidebar9"
            set id score "  &fPlayer &8➢ &7%loop-player's name%" in sidebar of loop-player to 8 with id "sidebar8"
            set id score "  &fMoney &8➢ &7%loop-player's balance%" in sidebar of loop-player to 7 with id "sidebar8"
            set id score " " in sidebar of loop-player to 6 with id "sidebar7"

            set id score "&3" in sidebar of loop-player to 4 with id "sidebar5"
            set id score "&6&lDiscord:" in sidebar of loop-player to 3 with id "sidebar4"
            set id score "   &fDiscord &8➢ &6/discord" in sidebar of loop-player to 2 with id "sidebar3"
            set id score "&8&m-------------------" in sidebar of loop-player to 1 with id "sidebar2"
            set id score "&6&lFoxScape.minehut.gg" in sidebar of loop-player to 0 with id "sidebar1"
        else if loop-player's world is "prison-b":
            wipe loop-player's sidebar
            set name of sidebar of loop-player to "&6&lFoxScape Prison"
            set {sidebarname.%loop-player%} to "&6&lFoxScape Prison"
            set id score "&8&m-------------------" in sidebar of loop-player to 11 with id "sidebar11"
            set id score "&6&lYOU:" in sidebar of loop-player to 10 with id "sidebar10"
            set id score "  &fRank &8➢ &6B" in sidebar of loop-player to 9 with id "sidebar9"
            set id score "  &fPlayer &8➢ &7%loop-player's name%" in sidebar of loop-player to 8 with id "sidebar8"
            set id score "  &fMoney &8➢ &7%loop-player's balance%" in sidebar of loop-player to 7 with id "sidebar8"
            set id score " " in sidebar of loop-player to 6 with id "sidebar7"

            set id score "&3" in sidebar of loop-player to 4 with id "sidebar5"
            set id score "&6&lDiscord:" in sidebar of loop-player to 3 with id "sidebar4"
            set id score "   &fDiscord &8➢ &6/discord" in sidebar of loop-player to 2 with id "sidebar3"
            set id score "&8&m-------------------" in sidebar of loop-player to 1 with id "sidebar2"
            set id score "&6&lFoxScape.minehut.gg" in sidebar of loop-player to 0 with id "sidebar1"
        else if loop-player's world is "prison-a":
            wipe loop-player's sidebar
            set name of sidebar of loop-player to "&6&lFoxScape Prison"
            set {sidebarname.%loop-player%} to "&6&lFoxScape Prison"
            set id score "&8&m-------------------" in sidebar of loop-player to 11 with id "sidebar11"
            set id score "&6&lYOU:" in sidebar of loop-player to 10 with id "sidebar10"
            set id score "  &fRank &8➢ &6A" in sidebar of loop-player to 9 with id "sidebar9"
            set id score "  &fPlayer &8➢ &7%loop-player's name%" in sidebar of loop-player to 8 with id "sidebar8"
            set id score "  &fMoney &8➢ &7%loop-player's balance%" in sidebar of loop-player to 7 with id "sidebar8"
            set id score " " in sidebar of loop-player to 6 with id "sidebar7"

            set id score "&3" in sidebar of loop-player to 4 with id "sidebar5"
            set id score "&6&lDiscord:" in sidebar of loop-player to 3 with id "sidebar4"
            set id score "   &fDiscord &8➢ &6/discord" in sidebar of loop-player to 2 with id "sidebar3"
            set id score "&8&m-------------------" in sidebar of loop-player to 1 with id "sidebar2"
            set id score "&6&lFoxScape.minehut.gg" in sidebar of loop-player to 0 with id "sidebar1"
        else if loop-player's world is "kitpvp":



            wipe loop-player's sidebar
            set name of sidebar of loop-player to "&6&lFoxScape KitPvp"
            set {sidebarname.%loop-player%} to "&6&lFoxScape KitPvp"
            set id score "&8&m-------------------" in sidebar of loop-player to 11 with id "sidebar11"
            set id score "&6&lYOU:" in sidebar of loop-player to 10 with id "sidebar10"
            set id score "  &fPlayer &8➢ &7%loop-player's name%" in sidebar of loop-player to 8 with id "sidebar8"
            set id score "  &fMoney &8➢ &7%{balance::%loop-player%}%" in sidebar of loop-player to 7 with id "sidebar7"
            set id score "  &fDeaths &8➢ &7%{deaths.kitpvp::%uuid of loop-player%}%" in sidebar of loop-player to 6 with id "sidebar6"
            set id score "  &fKills &8➢ &7%{kills.kitpvp::%uuid of loop-player%}%" in sidebar of loop-player to 5 with id "sidebar8"
            set id score " " in sidebar of loop-player to 4 with id "sidebar7"

            set id score "&3" in sidebar of loop-player to 3 with id "sidebar5"
            set id score "&6&lDiscord:" in sidebar of loop-player to 2 with id "sidebar4"
            set id score "   &fDiscord &8➢ &6/discord" in sidebar of loop-player to 2 with id "sidebar3"
            set id score "&8&m-------------------" in sidebar of loop-player to 1 with id "sidebar2"
            set id score "&6&lFoxScape.minehut.gg" in sidebar of loop-player to 0 with id "sidebar1"
        else if loop-player's world is "world":
            wipe loop-player's sidebar
            set name of sidebar of loop-player to "&6&lFoxScape Survival"
            set {sidebarname.%loop-player%} to "&6&lFoxScape"
            set id score "&8&m-------------------" in sidebar of loop-player to 11 with id "sidebar11"
            set id score "&6&lYOU:" in sidebar of loop-player to 10 with id "sidebar10"
            set id score "  &fRank &8➢ &7%colored loop-player's prefix%" in sidebar of loop-player to 9 with id "sidebar9"
            set id score "  &fPlayer &8➢ &7%loop-player's name%" in sidebar of loop-player to 8 with id "sidebar8"
            set id score " " in sidebar of loop-player to 7 with id "sidebar7"

            set id score "&3" in sidebar of loop-player to 5 with id "sidebar5"
            set id score "&6&lDiscord:" in sidebar of loop-player to 4 with id "sidebar4"
            set id score "   &fDiscord &8➢ &6/discord" in sidebar of loop-player to 3 with id "sidebar3"
            set id score "&8&m-------------------" in sidebar of loop-player to 2 with id "sidebar2"
            set id score "&6&lFoxScape.minehut.gg" in sidebar of loop-player to 1 with id "sidebar1"
        else:
            wipe loop-player's sidebar


#! INFORMATION

# YOU NEED THE ECONOMY SKRIPT IF YOU WANT A WORKING MONEY REWARD #
# DO NOT REUPLOAD THIS FILE #
# FULLYRAW IS THE REAL OWNER OF THIS FILE, I WANT TO KEEP IT LIKE THAT #

options:

#! MESSAGES

    Kill_Message: &b&l$+15 &7and &a&l+15 EXP &7for killing &e%victim%
    Death_Message: &e%victim% &7was killed by &e%attacker%

#! REWARDS

    Money_Reward: 15
    EXP_Reward: 15

#! SKRIPT

on death:
    if victim's world is "kitpvp":
        if victim is a player:
            if attacker is a player:
                add 1 to {deaths.kitpvp::%uuid of victim%}
                add 1 to {kills.kitpvp::%uuid of attacker%}
                send "{@Kill_Message}" to attacker
                add 15 to {balance::%attacker%}
                make console execute command "/xp give %attacker% {@EXP_Reward}"
                set the death message to "{@Death_Message}"

on join:
    if {kills.kitpvp::%uuid of player%} is not set:
        set {kills.kitpvp::%uuid of player%} to 0
    if {deaths.kitpvp::%uuid of player%} is not set:
        set {deaths.kitpvp::%uuid of player%} to 0

on first join:
    set {kit.%player%} to "iron"

command /KitPvpEco <offline player> <text>:
    permission: foxscape.kitpvp.eco
    trigger:
        set {balance::%player%} to %arg-2%
        
command /KitPvpRemoveEco <offline player> <text>:
    permission: foxscape.kitpvp.eco
    trigger:
        subtract %arg-2% from {balance::%player%}
        


command /kit:
    permission: foxscape.kitpvp.kit
    trigger:
        if player's world is "kitpvp":
            if {kit.%player%} is not set:
                set {kit.%player%} to "iron"
            else if {kit.%player%} is "iron":
                set the helmet of the player to iron helmet
                set the chestplate of the player to iron chestplate
                set the leggings of the player to iron leggings
                set the boots of the player to iron boots
                execute console command "/give %player% iron_sword 1"
                execute console command "/give %player% bow 1"
                execute console command "/give %player% arrow 64"


command /shop:
    permission: foxscape.kitpvp.shop
    trigger:
        if player's world is "kitpvp":
            open chest inventory with 3 rows named "&7&lKITPVP SHOP" to player
            set slot 0 of player's current inventory to orange stained glass pane named "&4 "
            set slot 1 of player's current inventory to orange stained glass pane named "&4 "
            set slot 2 of player's current inventory to orange stained glass pane named "&4 "
            set slot 3 of player's current inventory to orange stained glass pane named "&4 "
            set slot 4 of player's current inventory to orange stained glass pane named "&4 "
            set slot 5 of player's current inventory to orange stained glass pane named "&4 "
            set slot 6 of player's current inventory to orange stained glass pane named "&4 "
            set slot 7 of player's current inventory to orange stained glass pane named "&4 "
            set slot 8 of player's current inventory to orange stained glass pane named "&4 "
            set slot 18 of player's current inventory to orange stained glass pane named "&4 "
            set slot 19 of player's current inventory to orange stained glass pane named "&4 "
            set slot 20 of player's current inventory to orange stained glass pane named "&4 "
            set slot 21 of player's current inventory to orange stained glass pane named "&4 "
            set slot 22 of player's current inventory to orange stained glass pane named "&4 "
            set slot 22 of player's current inventory to orange stained glass pane named "&4 "
            set slot 23 of player's current inventory to orange stained glass pane named "&4 "
            set slot 24 of player's current inventory to orange stained glass pane named "&4 "
            set slot 25 of player's current inventory to orange stained glass pane named "&4 "
            set slot 26 of player's current inventory to orange stained glass pane named "&4 "
            
            set slot 13 of player's current inventory to diamond sword named "&7KITS"
            set slot 15 of player's current inventory to netherite chestplate named "&7DONATOR KITS"
            set slot 11 of player's current inventory to golden apple named "&7EXTRA ITEMS"

on inventory click:
    if name of player's inventory is "&7&lKITPVP SHOP":
        if clicked slot is 13:
            open chest inventory with 3 rows named "&7&lKITPVP KITS" to player
            set slot 0 of player's current inventory to orange stained glass pane named "&4 "
            set slot 1 of player's current inventory to orange stained glass pane named "&4 "
            set slot 2 of player's current inventory to orange stained glass pane named "&4 "
            set slot 3 of player's current inventory to orange stained glass pane named "&4 "
            set slot 4 of player's current inventory to orange stained glass pane named "&4 "
            set slot 5 of player's current inventory to orange stained glass pane named "&4 "
            set slot 6 of player's current inventory to orange stained glass pane named "&4 "
            set slot 7 of player's current inventory to orange stained glass pane named "&4 "
            set slot 8 of player's current inventory to orange stained glass pane named "&4 "
            set slot 18 of player's current inventory to orange stained glass pane named "&4 "
            set slot 19 of player's current inventory to orange stained glass pane named "&4 "
            set slot 20 of player's current inventory to orange stained glass pane named "&4 "
            set slot 21 of player's current inventory to orange stained glass pane named "&4 "
            set slot 22 of player's current inventory to orange stained glass pane named "&4 "
            set slot 22 of player's current inventory to orange stained glass pane named "&4 "
            set slot 23 of player's current inventory to orange stained glass pane named "&4 "
            set slot 24 of player's current inventory to orange stained glass pane named "&4 "
            set slot 25 of player's current inventory to orange stained glass pane named "&4 "
            set slot 26 of player's current inventory to orange stained glass pane named "&4 "
            
            set slot 13 of player's current inventory to diamond chestplate named "&bDIAMOND KIT"
            set slot 15 of player's current inventory to netherite chestplate named "&7NETHERITE KIT"
            set slot 11 of player's current inventory to iron chestplate named "&7ENCHANTED IRON KIT"
        if clicked slot is 15:
            if player has permission "DONATOR":
                open chest inventory with 3 rows named "&7&lKITPVP DONATOR KITS" to player
                set slot 0 of player's current inventory to orange stained glass pane named "&4 "
                set slot 1 of player's current inventory to orange stained glass pane named "&4 "
                set slot 2 of player's current inventory to orange stained glass pane named "&4 "
                set slot 3 of player's current inventory to orange stained glass pane named "&4 "
                set slot 4 of player's current inventory to orange stained glass pane named "&4 "
                set slot 5 of player's current inventory to orange stained glass pane named "&4 "
                set slot 6 of player's current inventory to orange stained glass pane named "&4 "
                set slot 7 of player's current inventory to orange stained glass pane named "&4 "
                set slot 8 of player's current inventory to orange stained glass pane named "&4 "
                set slot 18 of player's current inventory to orange stained glass pane named "&4 "
                set slot 19 of player's current inventory to orange stained glass pane named "&4 "
                set slot 20 of player's current inventory to orange stained glass pane named "&4 "
                set slot 21 of player's current inventory to orange stained glass pane named "&4 "
                set slot 22 of player's current inventory to orange stained glass pane named "&4 "
                set slot 22 of player's current inventory to orange stained glass pane named "&4 "
                set slot 23 of player's current inventory to orange stained glass pane named "&4 "
                set slot 24 of player's current inventory to orange stained glass pane named "&4 "
                set slot 25 of player's current inventory to orange stained glass pane named "&4 "
                set slot 26 of player's current inventory to orange stained glass pane named "&4 "
            
                set slot 13 of player's current inventory to diamond chestplate named "&bDIAMOND KIT"
                set slot 15 of player's current inventory to netherite chestplate named "&7NETHERITE KIT"
                set slot 11 of player's current inventory to iron chestplate named "&7ENCHANTED IRON KIT"
        if clicked slot is 11:
            open chest inventory with 3 rows named "&7&lKITPVP EXTRA ITEMS" to player
            set slot 0 of player's current inventory to orange stained glass pane named "&4 "
            set slot 1 of player's current inventory to orange stained glass pane named "&4 "
            set slot 2 of player's current inventory to orange stained glass pane named "&4 "
            set slot 3 of player's current inventory to orange stained glass pane named "&4 "
            set slot 4 of player's current inventory to orange stained glass pane named "&4 "
            set slot 5 of player's current inventory to orange stained glass pane named "&4 "
            set slot 6 of player's current inventory to orange stained glass pane named "&4 "
            set slot 7 of player's current inventory to orange stained glass pane named "&4 "
            set slot 8 of player's current inventory to orange stained glass pane named "&4 "
            set slot 18 of player's current inventory to orange stained glass pane named "&4 "
            set slot 19 of player's current inventory to orange stained glass pane named "&4 "
            set slot 20 of player's current inventory to orange stained glass pane named "&4 "
            set slot 21 of player's current inventory to orange stained glass pane named "&4 "
            set slot 22 of player's current inventory to orange stained glass pane named "&4 "
            set slot 22 of player's current inventory to orange stained glass pane named "&4 "
            set slot 23 of player's current inventory to orange stained glass pane named "&4 "
            set slot 24 of player's current inventory to orange stained glass pane named "&4 "
            set slot 25 of player's current inventory to orange stained glass pane named "&4 "
            set slot 26 of player's current inventory to orange stained glass pane named "&4 "
            
            set slot 13 of player's current inventory to golden apple named "&7Golden Apple" with lore "&7Price: 50$"
            set slot 15 of player's current inventory to mushroom soup named "&7Soup" with lore "&7Price: 75$"
            set slot 11 of player's current inventory to eye of ender named "&7Adrenalin" with lore "&7Price: 250$"
        else:
            
on inventory click:
    if name of player's inventory is "&7&lKITPVP EXTRA ITEMS":
        if index of event-slot is <number>:
            cancel event
            if {balance::%player%} >= 50:
                subtract 50 from {balance::%player%}
                give player golden apple named "&7Golden Apple"
        if clicked slot is 15:
            cancel event
            if {balance::%player%} >= 75:
                subtract 75 from {balance::%player%}
                give player mushroom soup named "&7Soup"
        if clicked slot is 11:
            cancel event
            if {balance::%player%} >= 250:
                subtract 250 from {balance::%player%}
                give player eye of ender named "&7Adrenalin"
        else:
            cancel event
    
command /kitpvpitem <text>:
    permission: foxscape.kitpvp.itemgive
    trigger:
        if arg-1 is "Adrenalin":
            give player eye of ender named "&7Adrenalin"
        if arg-1 is "gapple":
            give player golden apple named "&7Golden Apple"
        if arg-1 is "soup":
            give player mushroom soup named "&7Soup"
    
on rightclick with mushroom soup:
    if player is holding mushroom soup named "&7Soup":
        if player's health = 10:
            if player's hunger < 10:
                cancel event
                set the player's tool to bowl
                set {_Hunger} to player's hunger + 3.5
                set the player's hunger to {_Hunger}
                set the player's saturation to 7
            else:
                cancel event

        else if player's health < 10:
            cancel event
            set the player's tool to bowl named "Bowl"
            heal the player by 3.5 hearts
            
on rightclick with eye of ender:
    if player is holding eye of ender named "&7Adrenalin":
        apply swiftness 3 to the player for 20 seconds
        apply strength 2 to the player for 20 seconds



Code:
on inventory click:
    if name of player's inventory is "&7&lKITPVP EXTRA ITEMS":
        if index of event-slot is <number>:
            cancel event
            if {balance::%player%} >= 50:
                subtract 50 from {balance::%player%}
                give player golden apple named "&7Golden Apple"
        if clicked slot is 15:
            cancel event
            if {balance::%player%} >= 75:
                subtract 75 from {balance::%player%}
                give player mushroom soup named "&7Soup"
        if clicked slot is 11:
            cancel event
            if {balance::%player%} >= 250:
                subtract 250 from {balance::%player%}
                give player eye of ender named "&7Adrenalin"
        else:
            cancel event


Code:
Empty configuration section You might want to indent one or more of the subsequesnt lines to make them belong to this section or remove the colon at the of the line if you dont want this line to start a section. (score.sk line277: else:')
Can't understand this expression "%arg-2%' (score.sk line 145: set {balance::%player%} to %arg-2%') %arg-2% can't be removed from (balance::%the player%) because the former is not an object (score.sk, line 150: subract %arg-2% from {balance%player%}')

but i dont know if that matters because that part already works and there are no errors about the code i want to work
 
on line 148, remove the % surrounding arg-2
on line 280, remove the unnecessary 'else:'
 
ill try thx
[doublepost=1616941465,1616941313][/doublepost]the shop still doesnt work ;-;


there are no errors tho
 
Status
Not open for further replies.