Solved Wont read variable amount

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

Mattllama987

Active Member
Aug 5, 2018
225
7
18
24
Im tying to remove a variable amount of wheat seeds from the player, and i know i have enough. I even have too many wheat seeds in my inv. But its not removing the seeds when i click to buy a spawner. Its like not reading the variable amount i need. I says i dont have enough seeds. Does anyone know why? I havnt had this issue before.

Thanks!
~Matt
Code:
variables:
   {chicken::skull::cost} = 500
on inventory click:
   if name of player's current inventory contains "&c&lSkull Trader":
       cancel event
       if index of event-slot is 36:
           if amount of wheat seeds in player's inventory >= {chicken::skull::cost} parsed as number:
               remove {chicken::skull::cost} of wheat seeds from player's inventory
               set {spawner::9::%player%} to true
               send "&aYou bought a Chicken spawner!"
               execute console command "us givespawner %player% CHICKEN"
           else:
               close player's inventory
               send "&cYou dont have enough wheat seeds to trade!"
[doublepost=1602427485,1602275036][/doublepost]bump
 
Status
Not open for further replies.