NoPulp Posted February 28, 2022 Share Posted February 28, 2022 I want to make a skript where every few seconds you get a item out of a selection of items but the only thing i could find was this and its not working. command /toggle trigger: if {toggleoff::%player%} exists: delete {toggleoff::%player%} else: set {toggleoff::%player%} to true every 15 seconds: loop all players if {toggleoff::%loop-player%} does not exist: loop until {item::%loop-player%} is true: chance of 90%: give loop-player 1 of dirt set {item::%loop-player%} to true stop chance of 80%: give loop-player 1 of oak_wood set {item::%loop-player%} to true stop delete {item::%loop-player%} Link to comment Share on other sites More sharing options...
Pixel_Pengu Posted February 28, 2022 Share Posted February 28, 2022 Hey! I've just moved this post to the proper category. Feel free to continue the conversation here. Thanks! Pixel Pengu Minehut Moderator Link to comment Share on other sites More sharing options...
NoPulp Posted February 28, 2022 Author Share Posted February 28, 2022 (edited) Ok thx Edited February 28, 2022 by NoPulp Link to comment Share on other sites More sharing options...
S_Mango Posted March 1, 2022 Share Posted March 1, 2022 This should do what you want : ) every 15 seconds: loop all players: set {_num} to a random integer between 1 and 3: if {_num} is equal to 1: give 1 dirt to loop-player else if {_num} is equal to 2: give 1 stone to loop-player else if {_num} is equal to 3: give 1 gold ingot to loop-player Link to comment Share on other sites More sharing options...
NoPulp Posted March 1, 2022 Author Share Posted March 1, 2022 @S_Mango It says line 3 cant be understood Link to comment Share on other sites More sharing options...
S_Mango Posted March 1, 2022 Share Posted March 1, 2022 (edited) @NoPulp oops, remove the : set {_num} to a random integer between 1 and 3 Edited March 1, 2022 by S_Mango Link to comment Share on other sites More sharing options...
NoPulp Posted March 1, 2022 Author Share Posted March 1, 2022 oh ok thx so much i dont know how to explain how happy i am Link to comment Share on other sites More sharing options...
S_Mango Posted March 1, 2022 Share Posted March 1, 2022 No problem Link to comment Share on other sites More sharing options...
NoPulp Posted March 1, 2022 Author Share Posted March 1, 2022 hey @S_Mangoits still not working it says for line 6 and 8 "else if has to be placed just after another if or else if section" Link to comment Share on other sites More sharing options...
NoPulp Posted March 1, 2022 Author Share Posted March 1, 2022 Never mind lol it works i just relized Link to comment Share on other sites More sharing options...
NoPulp Posted March 1, 2022 Author Share Posted March 1, 2022 @S_MangoIs there by any chance that you could make it like a 25% chance of getting a item, that would be great thx! Link to comment Share on other sites More sharing options...
S_Mango Posted March 1, 2022 Share Posted March 1, 2022 (edited) @NoPulp of course! every 15 seconds: loop all players: chance of 25%: set {_num} to a random integer between 1 and 3 if {_num} is equal to 1: give 1 dirt to loop-player else if {_num} is equal to 2: give 1 stone to loop-player else if {_num} is equal to 3: give 1 gold ingot to loop-player Edited March 1, 2022 by S_Mango Link to comment Share on other sites More sharing options...
NoPulp Posted March 1, 2022 Author Share Posted March 1, 2022 (edited) @S_Mangoit gives the blocks all at the same time, if you could make it where like gold ingot has 25% chance and stone 50% chance that would be great thx! Edited March 1, 2022 by NoPulp Link to comment Share on other sites More sharing options...
S_Mango Posted March 1, 2022 Share Posted March 1, 2022 @NoPulp The previous skript should only give 1 item when it triggers, would you like it so it always gives you 1 item each with a different chance or a chance to get all or none of the items? Link to comment Share on other sites More sharing options...
S_Mango Posted March 1, 2022 Share Posted March 1, 2022 (edited) @NoPulp This skript you can get multiple or none of the items every 15 seconds: loop all players: chance of 25%: give 1 gold ingot to loop-player chance of 50%: give 1 stone to loop-player chance of 80%: give 1 dirt to loop-player This skript means you will always get 1 item every 15 seconds but gold is the rarest and dirt is the most common every 15 seconds: loop all players: set {_Gifted} to "false" while {_Gifted} is not equal to "true": chance of 25%: give 1 gold ingot to loop-player set {_Gifted} to "true" if {_Gifted} is not equal to "true": chance of 50%: give 1 stone to loop-player set {_Gifted} to "true" if {_Gifted} is not equal to "true": chance of 80%: give 1 dirt to loop-player set {_Gifted} to "true" Edited March 1, 2022 by S_Mango 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