1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't set items in a player's slot to variable

Discussion in 'Skript' started by AndreasLK, Mar 22, 2020.

Thread Status:
Not open for further replies.
  1. AndreasLK

    AndreasLK Member

    Joined:
    Mar 12, 2020
    Messages:
    16
    Likes Received:
    0
    Code (Text):
    1.             open chest with 3 rows named "&6&lKøb" to player
    2.             wait 1 tick
    3.             format slot 0 of player with green wool named "&a&l+" to run [set {crypto.%player%.amount} to {crypto.%player%.amount}+1]->[format slot 1 of player with black wool named "&7&l%{crypto.%player%.amount}%" to close]->[set {_crypto.number.%player%} to 5]
    4.             format slot 1 of player with {_crypto.number.%player%} black wool named "&7&l%{crypto.%player%.amount}%" to close
    5.             format slot 2 of player with red wool named "&4&l-" to run [set {crypto.%player%.amount} to {crypto.%player%.amount}-1]->[format slot 1 of player with black wool named "&7&l%{crypto.%player%.amount}%" to close]->[set {crypto.number.%player%} to "%{crypto.%player%.amount}% black wool"]
    6.  
    7.  
    8.  
    I can't set the number of items with a variable. It just returns a failure. If I set it to something like 5 it works. But not when this number is represented by a variable. Can anyone help?
     
  2. Runakai

    Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
  3. AndreasLK

    AndreasLK Member

    Joined:
    Mar 12, 2020
    Messages:
    16
    Likes Received:
    0
    Sorry. Forgot to mention it's 1.8.8
    And I've tried using {} and %{}%
    Any other suggestions?
     
  4. Runakai

    Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Vanilla guis also work on 1.8.
    Also I didn't say to put %% around it,

    {} Of %item%

    You simply forgot "of"

    Also don't use format slot. You'll have a lot of trouble switching to vanilla guis anyway because your method of making guis is buggy.
     
  5. AndreasLK

    AndreasLK Member

    Joined:
    Mar 12, 2020
    Messages:
    16
    Likes Received:
    0
    Thank you so much, sir!
    I really appreciate your help!
    --- Double Post Merged, Mar 22, 2020, Original Post Date: Mar 22, 2020 ---
    Slight problem..... It doesn't work even if I put "of" in......
     
Thread Status:
Not open for further replies.

Share This Page

Loading...