this doesnt make sense (SOLVED)

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

completeidiot

Member
May 5, 2024
21
0
1
18
so im trying to make a generator thing but it doesnt work. theres no errors and it doesnt work.

Code:
on load:
    set {moneygeneration} to sunflower of mending named "&fMoney Generation" with lore "&8Welcome %player%!"
    set {gen} to green concrete named "&2Money Gen" with lore "&eCosts 15 &2Money!"

on right click:
    if clicked block is fletching table:
        open chest with 5 rows named "&eMarket" to player
        format slot 0 of player with yellow stained glass named "&eClick These Items To Change Shop Page! ->" with lore "&8Welcome %player%!" to close
        format slot 1 of player with sunflower of mending named "&fMoney Generation" with lore "&8Welcome %player%!" to close
        format slot 9 of player with green concrete named "&2Money Gen" with lore "&eCosts 15 &2Money!" to run [wait 1 tick]

on inventory click:
    if clicked slot contains {gen}:
        if {money::%player's uuid%} > 14:
            subtract 15 from {money::%player's uuid%}
            give player green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney"
        else:
            send "&cYou do not have enough money for that!" to player

edit: im trying to make generators buyable.
edit 2: the on inventory click is the function that should buy them
 
Last edited:
on inventory click is an event, not a function. Also rather than using money in a variable I recommend you use player's balance.


Also please explain "doesn't work". Also also, format slot--atleast the way it's used here--looks like TuSKe syntax. Is it TuSKe or skript-gui?
 
Some issues I see are declaring {moneygeneration} using %player% when no player is defined, also idk if this is a mistake or not but the gen in the shop doesn't match up with {gen}.
 
Oh yeah, because %player% is replaced with the player name, so the variable just has lore of "Welcome %player%" but the shop item will contain "Welcome completeidiot" or "Welcome Nixters" so its never gonna work.

@Gryphon2029 The {gen} variable and the gen item in the shop do match, but @completeidiot should just do format slot 9 of player with {gen}

Also make {gen} a ram variable, and don't forget to lmk if it's TuSKe or skript-gui
 
1715006099449.png
 
Oh yeah, because %player% is replaced with the player name, so the variable just has lore of "Welcome %player%" but the shop item will contain "Welcome completeidiot" or "Welcome Nixters" so its never gonna work.

@Gryphon2029 The {gen} variable and the gen item in the shop do match, but @completeidiot should just do format slot 9 of player with {gen}

Also make {gen} a ram variable, and don't forget to lmk if it's TuSKe or skript-gui
skquery
;-;
 
on inventory click is an event, not a function. Also rather than using money in a variable I recommend you use player's balance.


Also please explain "doesn't work". Also also, format slot--atleast the way it's used here--looks like TuSKe syntax. Is it TuSKe or skript-gui?
ik what an event is im saying the code after it should buy the gen
 
on inventory click is an event, not a function. Also rather than using money in a variable I recommend you use player's balance.


Also please explain "doesn't work". Also also, format slot--atleast the way it's used here--looks like TuSKe syntax. Is it TuSKe or skript-gui?
by doesnt work i mean it does nothing
 
delete query, delete rayfall, update SkBee and Skript, and use all the built in skript and skbee stuff for this lol.

Query and Rayfall are old and can cause issues, plus most of their syntax is in Bee and Skript. And all of your addons/skript are months out of date.

Skript has built in stuff for guis and such
i need rayfall for action bar thing
 
removed skquery and the entire thing broke
tuske made the entire skript not do anything (like litterally nothing it thought there was no code)