Rat3440 Posted October 18 Share Posted October 18 So I made a skript that spawns items at a specific place but it adds up too much. I can't figure out how to add a limiter to the skript. I need it to start generating again after it has been collected. This is some of my code: every 10 ticks: if {summon} is "enabled": drop {boost::gen} of sand at location(27.5, -57, 2.5, world "testworld") without velocity drop {boost::gen} of stone at location(17.5, -55, -32.5, world "testworld") without velocity drop {boost::gen} of iron ingots at location(-37.5, -47, -20.5, world "testworld") without velocity (this is for 3 dif gens) Any help would be great Link to comment Share on other sites More sharing options...
gabinun Posted Sunday at 01:48 PM Share Posted Sunday at 01:48 PM (edited) i cant really understand you want to spawn it every 10 tick but make it so if there is 3 of them spawned it well spawn another one? also this is better every 10 ticks: {summon} is enabled drop {boost::gen} of sand at location(27.5, -57, 2.5, world "testworld") without velocity drop {boost::gen} of stone at location(17.5, -55, -32.5, world "testworld") without velocity drop {boost::gen} of iron ingots at location(-37.5, -47, -20.5, world "testworld") without velocity so you want there to be only 1 {boost::gen} at 1 loaction at all time? Edited Sunday at 01:49 PM by gabinun Link to comment Share on other sites More sharing options...
Rat3440 Posted Sunday at 05:50 PM Author Share Posted Sunday at 05:50 PM Basically it is a "gen" that spawns items at those cords. The boost variable is for a different skript that lets me change the output of the gens but, the gens add up way too much before my item clear. So I was wondering if I can limit how much can be in the stack before it stops spawning. Link to comment Share on other sites More sharing options...
Dead07 Posted Monday at 03:44 PM Share Posted Monday at 03:44 PM (edited) 21 hours ago, Rat3440 said: Basically it is a "gen" that spawns items at those cords. The boost variable is for a different skript that lets me change the output of the gens but, the gens add up way too much before my item clear. So I was wondering if I can limit how much can be in the stack before it stops spawning. options: prefix: replace with your prefix function checkGenLimit(loc: location, type: string) :: boolean: loop dropped items in radius 2 around {_loc}: set {_drop} to "%loop-entity%" if {_drop} contains {_type}: set {_split::*} to split {_drop} by " " set {_amount} to {_split::2} parsed as integer add 1 to {_i} if {_amount} is set: add {_amount} - 1 to {_i} if {_i} >= {genLimit::%{_type}%}: return true command /genlimit [<string>] [<integer>]: trigger: if player has permission "gen.limit": if arg 1 is set: if arg 2 is set: if arg 2 >= 1: set {genLimit::%arg 1%} to arg 2 send "{@prefix} Set the &e%arg 1% &fgen limit to &e%arg 2%&f!" else: send "{@prefix} Limit must be greater than 0!" else: send "{@prefix} Enter the number limit!" else: send "{@prefix} Enter the gen you want to set a limit for!" every 10 ticks: if {summon} is "enabled": set {_check} to checkGenLimit(location(27.5, -57, 2.5, world "testworld"), "sand") if {_check} isn't true: drop {boost::gen} of sand at location(27.5, -57, 2.5, world "testworld") without velocity set {_check} to checkGenLimit(location(17.5, -55, -32.5, world "testworld"), "stone") if {_check} isn't true: drop {boost::gen} of stone at location(17.5, -55, -32.5, world "testworld") without velocity set {_check} to checkGenLimit(location(-37.5, -47, -20.5, world "testworld"), "iron ingot") if {_check} isn't true: drop {boost::gen} of iron ingots at location(-37.5, -47, -20.5, world "testworld") without velocity (Not tested) Edited Monday at 03:47 PM by Dead07 Discord: dead_is4 Anime Enthusiast! Link to comment Share on other sites More sharing options...
Rat3440 Posted Monday at 07:44 PM Author Share Posted Monday at 07:44 PM 3 hours ago, Dead07 said: options: prefix: replace with your prefix function checkGenLimit(loc: location, type: string) :: boolean: loop dropped items in radius 2 around {_loc}: set {_drop} to "%loop-entity%" if {_drop} contains {_type}: set {_split::*} to split {_drop} by " " set {_amount} to {_split::2} parsed as integer add 1 to {_i} if {_amount} is set: add {_amount} - 1 to {_i} if {_i} >= {genLimit::%{_type}%}: return true command /genlimit [<string>] [<integer>]: trigger: if player has permission "gen.limit": if arg 1 is set: if arg 2 is set: if arg 2 >= 1: set {genLimit::%arg 1%} to arg 2 send "{@prefix} Set the &e%arg 1% &fgen limit to &e%arg 2%&f!" else: send "{@prefix} Limit must be greater than 0!" else: send "{@prefix} Enter the number limit!" else: send "{@prefix} Enter the gen you want to set a limit for!" every 10 ticks: if {summon} is "enabled": set {_check} to checkGenLimit(location(27.5, -57, 2.5, world "testworld"), "sand") if {_check} isn't true: drop {boost::gen} of sand at location(27.5, -57, 2.5, world "testworld") without velocity set {_check} to checkGenLimit(location(17.5, -55, -32.5, world "testworld"), "stone") if {_check} isn't true: drop {boost::gen} of stone at location(17.5, -55, -32.5, world "testworld") without velocity set {_check} to checkGenLimit(location(-37.5, -47, -20.5, world "testworld"), "iron ingot") if {_check} isn't true: drop {boost::gen} of iron ingots at location(-37.5, -47, -20.5, world "testworld") without velocity (Not tested) Excuse me as I am new to skript but i pasted this in and it gave me a few errors on the messages so I just got rid of the {@prefix} but now when I do it and run the command nothing seems to be happening. I'm not sure if i'm doing something wrong some more help would be great. I also still don't understand functions so this is difficult for me. Link to comment Share on other sites More sharing options...
Dead07 Posted Tuesday at 03:05 PM Share Posted Tuesday at 03:05 PM (edited) 19 hours ago, Rat3440 said: Excuse me as I am new to skript but i pasted this in and it gave me a few errors on the messages so I just got rid of the {@prefix} but now when I do it and run the command nothing seems to be happening. I'm not sure if i'm doing something wrong some more help would be great. I also still don't understand functions so this is difficult for me. It does work as I just tested it so you probably just used the command wrong or {summon} isn't "enabled". I probably should have made it lower case all the time but oh well. To use the command you do /genlimit (the gen block in lower case) (number limit). Example: /genlimit sand 10 would limit the sand gen to 10 blocks. lmk if it still doesn't work Edited Tuesday at 03:06 PM by Dead07 Discord: dead_is4 Anime Enthusiast! Link to comment Share on other sites More sharing options...
Rat3440 Posted Wednesday at 06:46 PM Author Share Posted Wednesday at 06:46 PM On 10/22/2024 at 11:05 AM, Dead07 said: It does work as I just tested it so you probably just used the command wrong or {summon} isn't "enabled". I probably should have made it lower case all the time but oh well. To use the command you do /genlimit (the gen block in lower case) (number limit). Example: /genlimit sand 10 would limit the sand gen to 10 blocks. lmk if it still doesn't work I figured out how to use it thanks so much! Link to comment Share on other sites More sharing options...
Dead07 Posted Wednesday at 06:58 PM Share Posted Wednesday at 06:58 PM 12 minutes ago, Rat3440 said: I figured out how to use it thanks so much! Discord: dead_is4 Anime Enthusiast! Link to comment Share on other sites More sharing options...
Rat3440 Posted Wednesday at 07:26 PM Author Share Posted Wednesday at 07:26 PM 27 minutes ago, Dead07 said: Sorry to bother you but is there a way I can make this work with entities like mobs? 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