Thanks @Pikachu.
So, I tried what you suggested but I still get this error:
Code:
So, I tried what you suggested but I still get this error:
code_language.skript:
07.10 02:12:17 [Server] ERROR Variables cannot be used here. (scripts.sk, line 13: spawn a bat at location({_randomLocX},{_randomLocY},{_randomLocZ},world)')
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)
location({_randomlocx}, {_randomlocy}, {_randomlocz}, world("world"))