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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
I dont think you can change the spawn rate but you could spawn 1 bat or how ever many you want when certain mobs spawn (maybe add a chance for them to spawn?)
Yeah i guess that would work, although instead of periodical its supposedly better to use a while loop when the server starts and have it wait 10 seconds.Could I do something like: every 10 seconds in world: spawn a bat?
Also, how would I make it so the bat only spawns in the area of the KitPvP Map, not out of it?
Thanks,
- @LoneElf
make a command or something to set the corners of the map then pick a random location between those to points
How do you get the x and y coord if you have set the location to a variable?get a random number between loc 1's x-coord and loc 2's x-coord. Repeat for y and z coord then get the location at that x y z
set {_randomLocX} to a random number between {pos1}'s x-coord and {pos2}'s x-coord
set {_randomLocY} to a random number between {pos1}'s y-coord and {pos2}'s y-coord
set {_randomLocZ} to a random number between {pos1}'s z-coord and {pos2}'s z-coord
set {_randomLocSet} to
command /pos1:
trigger:
set {pos1} to location of player
command /pos2:
trigger:
set {pos2} to location of player
command /pos1:
trigger:
set {pos1} to location of player
command /pos2:
trigger:
set {pos2} to location of player
every 2 seconds in "world":
set {_randomLocX} to a random number between {pos1}'s x-coord and {pos2}'s x-coord
set {_randomLocY} to a random number between {pos1}'s y-coord and {pos2}'s y-coord
set {_randomLocZ} to a random number between {pos1}'s z-coord and {pos2}'s z-coord
spawn a bat at location of {_randomLocX} {_randomLocY} {_randomLocZ} in "world"
06.10 03:10:26 [Server] ERROR Variables cannot be used here. (scripts.sk, line 13: spawn a bat at location of {_randomLocX} {_randomLocY} {_randomLocZ} in "world"')
Im pretty sure you just need commasAlright. So, I tried that, and it says that I can't use variables in the replacement of the x, y, and z. Here is my code:
code_language.skript:command /pos1: trigger: set {pos1} to location of player command /pos2: trigger: set {pos2} to location of player every 2 seconds in "world": set {_randomLocX} to a random number between {pos1}'s x-coord and {pos2}'s x-coord set {_randomLocY} to a random number between {pos1}'s y-coord and {pos2}'s y-coord set {_randomLocZ} to a random number between {pos1}'s z-coord and {pos2}'s z-coord spawn a bat at location of {_randomLocX} {_randomLocY} {_randomLocZ} in "world"
Here is my error:code_language.skript:06.10 03:10:26 [Server] ERROR Variables cannot be used here. (scripts.sk, line 13: spawn a bat at location of {_randomLocX} {_randomLocY} {_randomLocZ} in "world"')
Thank you,
- @LoneElf
06.10 23:04:55 [Server] ERROR There's no location in a periodical event (scripts.sk, line 13: spawn a bat at location of {_randomLocX}, {_randomLocY}, {_randomLocZ} in world')
command /pos1:
trigger:
set {pos1} to location of player
command /pos2:
trigger:
set {pos2} to location of player
every 2 seconds in "world":
set {_randomLocX} to a random number between {pos1}'s x-coord and {pos2}'s x-coord
set {_randomLocY} to a random number between {pos1}'s y-coord and {pos2}'s y-coord
set {_randomLocZ} to a random number between {pos1}'s z-coord and {pos2}'s z-coord
spawn a bat at location of {_randomLocX}, {_randomLocY}, {_randomLocZ} in world
The location function is the better version of the expressionHere is my error:code_language.skript:06.10 23:04:55 [Server] ERROR There's no location in a periodical event (scripts.sk, line 13: spawn a bat at location of {_randomLocX}, {_randomLocY}, {_randomLocZ} in world')
Here is my code:
code_language.skript:command /pos1: trigger: set {pos1} to location of player command /pos2: trigger: set {pos2} to location of player every 2 seconds in "world": set {_randomLocX} to a random number between {pos1}'s x-coord and {pos2}'s x-coord set {_randomLocY} to a random number between {pos1}'s y-coord and {pos2}'s y-coord set {_randomLocZ} to a random number between {pos1}'s z-coord and {pos2}'s z-coord spawn a bat at location of {_randomLocX}, {_randomLocY}, {_randomLocZ} in world
Thank you!
- @LoneElf
command /pos1:
trigger:
set {pos1} to location of player
command /pos2:
trigger:
set {pos2} to location of player
every 2 seconds in "world":
set {_randomLocX} to a random number between {pos1}'s x-coord and {pos2}'s x-coord
set {_randomLocY} to a random number between {pos1}'s y-coord and {pos2}'s y-coord
set {_randomLocZ} to a random number between {pos1}'s z-coord and {pos2}'s z-coord
spawn a bat at location({_randomLocX},{_randomLocY},{_randomLocZ},world)
07.10 00:47:16 [Server] ERROR Variables cannot be used here. (scripts.sk, line 13: spawn a bat at location({_randomLocX},{_randomLocY},{_randomLocZ},world)')
Try location({_randomlocx}, {_randomlocy}, {_randomlocz}, event-world) or location({_randomlocx}, {_randomlocy}, {_randomlocz}, world("world"))Sorry about that. Here is the code:
code_language.skript:command /pos1: trigger: set {pos1} to location of player command /pos2: trigger: set {pos2} to location of player every 2 seconds in "world": set {_randomLocX} to a random number between {pos1}'s x-coord and {pos2}'s x-coord set {_randomLocY} to a random number between {pos1}'s y-coord and {pos2}'s y-coord set {_randomLocZ} to a random number between {pos1}'s z-coord and {pos2}'s z-coord spawn a bat at location({_randomLocX},{_randomLocY},{_randomLocZ},world)
Here is the error:code_language.skript:07.10 00:47:16 [Server] ERROR Variables cannot be used here. (scripts.sk, line 13: spawn a bat at location({_randomLocX},{_randomLocY},{_randomLocZ},world)')
Thank you!
- @LoneElf