belac136 Posted August 19, 2021 Share Posted August 19, 2021 I have this skript, and i don't know why it doesn't work... Help? command /shop: trigger: open virtual chest inventory with size 5 named "&6Crates" to player format gui slot 11 of player with {crate::1} named "&fBasic Crate" with lore "&7[&fCosts 1 &bDiamond&7]" to run: if player's inventory has 1 diamond: remove 1 diamond from player's inventory set {_random} to random integer between 1 and 2 if {_random} is 1: send "&7You opened a crate and found: &b1 diamond&7!" to player give player 1 diamond else: if {_random} is 2: send "&7You opened a crate and found: &b2 diamonds&7!" to player give player 2 diamonds command /itemset [<text>]: trigger: set {crate::%arg 1%} to player's held item 1 Link to comment Share on other sites More sharing options...
rosabel Posted August 19, 2021 Share Posted August 19, 2021 It is your spacing. You have 'if {_random} is 1 running BEFORE it's even set. Indent both if's under where you set {_random}. Because it's checking as soon as you open the GUI, not after the crate has been opened. RosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRi code, animate, develop, UI design, learn, and adapt, as well as make servers, of courseJoined Minehut sometime in 2014VIP sometime in 2018Legend in January 2021Helper on 4/11/2021♥ (Retired) on 5/17/2021 Moderator on 8/18/2023 Link to comment Share on other sites More sharing options...
belac136 Posted August 21, 2021 Author Share Posted August 21, 2021 Oh, Thank you so much! Link to comment Share on other sites More sharing options...
Alcap Posted August 23, 2021 Share Posted August 23, 2021 On 8/18/2021 at 10:00 PM, Dragon-Master said: I have this skript, and i don't know why it doesn't work... Help? command /shop: trigger: open virtual chest inventory with size 5 named "&6Crates" to player format gui slot 11 of player with {crate::1} named "&fBasic Crate" with lore "&7[&fCosts 1 &bDiamond&7]" to run: if player's inventory has 1 diamond: remove 1 diamond from player's inventory set {_random} to random integer between 1 and 2 if {_random} is 1: send "&7You opened a crate and found: &b1 diamond&7!" to player give player 1 diamond else: if {_random} is 2: send "&7You opened a crate and found: &b2 diamonds&7!" to player give player 2 diamonds command /itemset [<text>]: trigger: set {crate::%arg 1%} to player's held item the answer has already been given, but I just wanna say you can do else if {random_} is 2: Link to comment Share on other sites More sharing options...
belac136 Posted August 24, 2021 Author Share Posted August 24, 2021 thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now