#Spawning Zombies on random red wool (Function)

1 messages · Page 1 of 1 (latest)

unborn pendant
#

Example this was the first wave:

#

And then this is also the first wave:

#

As you can see it is random

No matter what wave the zombie swill spawn randomly on a random red wool

How would I begin to create this?
(My code so far):

function Wave(n: number, n2: number):
    loop all players:
        send title "&2Wave &6%{_n}%" to loop-player
        spawn {_n2} of zombies # red wool code here
    
# the command is only for testing purposes it will soon be changed to when a zombie dies so it can check if there is none and will start the next wave.

command /wave:
    trigger:
        Wave(1, 10)
#

Spawning Zombies on random red wool (Function)

terse ermine
#

SKU is gonna give better feedback than here

unborn anchor
# unborn pendant As you can see it is random No matter what wave the zombie swill spawn randomly...
function Wave(n: number, n2: number, l:location):
    loop all players:
        send title "&2Wave &6%{_n}%" to loop-player
    loop 360 times:
        add spherical vector radius 5, yaw loop-value * 8, pitch 0 to {_l::*}
    loop {_n2} times:
        set {_} to random element of {_l::*}
        spawn zombie at {_l} ~ {_}
        remove {_} from {_l::*}
        
    
# the command is only for testing purposes it will soon be changed to when a zombie dies so it can check if there is none and will start the next wave.

command /wave:
    trigger:
        Wave(1, 10, player's location)
#

you could use a spherical vector like i showed here

unborn pendant
#

wait what

unborn anchor
#

?

unborn pendant
#

is it possible to adjust this?

#

I might make the square bigger

unborn anchor
unborn pendant
#

woah

unborn anchor
#

woah fr

unborn pendant
#

okay, this is like a new level of skript

#

i gotta study this

unborn anchor
#

its simple math mike

unborn pendant
#

yeah but the variables and vectors are confusin

unborn anchor
#

just saying

unborn anchor
unborn pendant
#

okay

#

the {}

unborn anchor
#

the {}?

#

variables r super easy

unborn pendant
#

lol

#

your just better

#

wait

#

is it possible

#

to make it when a zombie spawns, it just spawns on a red wool?

#

a random red wool?

unborn anchor
#

yeah i guess

unborn pendant
#

how would i make the red wool random?

unborn anchor
#

you'd get the locations of the red wool, add to a list then get some random locations of the list

#

then spawn the zombies at those locations

unborn pendant
#

wait

#

how do i get a random location of the list?

unborn anchor
#

set {_} to random element of {_l::*}

unborn pendant
#

oh cool

#

wait

#

can i only spawn 1 zombie

#

at the location

#

and then repeat the code?

unborn anchor
#

sure

unborn pendant
#

so

#

wait

#

sorry, how would I get the locations of the red wool?

unborn anchor
#

all blocks in radius x of y where [input = red wool]

unborn anchor
#

and i recommend doing it this way

#

do it however u want

unborn pendant
#

okay, i'll listen to you

unborn anchor
#

🍇

unborn pendant
#

why do you need to loop it 360

#

times

unborn anchor
#

i dont

#

i just forgot to change it

#

lol

unborn pendant
#

so just remove it?

unborn anchor
#

no

unborn pendant
#

oh

unborn anchor
#

you need the loop for it to get all the vectors

#

u just dont need it to be 360

unborn pendant
#

so whats the best integer?

unborn anchor
#

hm

#

lets just keep it at 360

#

360 should be fine

unborn pendant
#

okay

#

wait 360 to get to the vectors?

#

thats so confusing

unborn anchor
#

no its not

#

because

unborn pendant
#

your smart

unborn anchor
#
loop 360 times:
        add spherical vector radius 5, yaw loop-value * 8, pitch 0 to {_l::*}
#

look

#

the yaw moves

#

with the loop

#

thats how it works

unborn pendant
#

huh

#

thats

#

cool

#

whats loop value again

unborn anchor
#

the thing thats being looped

#

in this case a number

unborn pendant
#

so the number being 360?

#

or n2?

unborn anchor
#

360

#

n2 is the amount of zombies spawning

unborn pendant
#

okay

unborn anchor
#

has nothing to do with getting the vectors

unborn pendant
#

do you have a tutorial on vectors?

#

that I could read?

brazen ridge
#

whats a spherical vector

unborn anchor
#

a vector

unborn pendant
#

but do you have one?

brazen ridge
#

wats the difference

unborn pendant
#

a tutorial?

unborn anchor
#

wait

#

lemme finish chess gmae

#

game

unborn pendant
#

apologies

#

goodluck

unborn anchor
#

ok he resgined

unborn pendant
#

ggs

unborn anchor
#

in a winning position

unborn pendant
#

oh

#

guess he didnt know that

unborn anchor
#

made by wizard boy

unborn pendant
#

the guy from adventure time?

#

yes

#

okay

brazen ridge
#

wats the difference between spherical vector and normal vector

unborn pendant
unborn anchor
unborn pendant
#

oh

unborn anchor
#

a spherical vector just makes getting vectors from a sphere easier

unborn pendant
#

is it possible

#

to make particles

unborn anchor
#

yes

unborn pendant
#

in a spher

unborn anchor
#

yes

unborn pendant
#

using

#

that

#

?

unborn anchor
#

yes

unborn pendant
#

wow

brazen ridge
unborn pendant
#

or

unborn anchor
#

but getting the vector is easier with spherical vectors

unborn anchor
#

because grabbing a spherical vector without using spherical vector expressions would take a lot more lines + effort

#

with the spherical vector expression it takes 2 lines

unborn anchor
# unborn pendant using
function sphere() :: vectors:
    loop 360 times:
        loop 360 times:
            set {_v} to spherical vector radius 1, yaw loop-number-1, pitch loop-number-2
            add {_v} to {_vectors::*}
    return {_vectors::*}
unborn anchor
#

it just grabs the locations in a radius

#

that radius u can change

unborn pendant
#

okay

#

where is the center>

#

?

unborn anchor
#

player's location

unborn pendant
#

oh

brazen ridge
#

but i see

unborn anchor
#

¯_(ツ)_/¯

unborn pendant
unborn anchor
#

no i don't have mine ready

#

i just stole it

brazen ridge
unborn anchor
unborn pendant
#

oh alright

#

how did you learn skript?

unborn pendant
unborn anchor
unborn pendant
#

wow

#

those are

#

nice people

unborn anchor
#

yes

unborn pendant
#

I just get bullied

#

with sometimes help

unborn anchor
#

we all did

unborn pendant
#

lol

unborn anchor
#

anyways

#

imma go now

brazen ridge
#

wats yo server

unborn pendant
#

yo wait

unborn anchor
#

?

unborn anchor
unborn pendant
#

can i friend you? i just wanna y'know ask you tips and stuff whenever you are free or available or have the time

#

or just message you

unborn anchor
unborn anchor
#

i am not on much on this account

unborn pendant
#

okay thanks

#

for everything

#

tysm

unborn pendant
#

im going to bed

#

thank you for helping

unborn pendant
brazen ridge
unborn anchor
unborn anchor
#
function sphere() :: vectors:
    loop 360 times:
        loop 360 times:
            set {_v} to spherical vector radius 1, yaw loop-number-1, pitch loop-number-2
            add {_v} to {_vectors::*}
    return {_vectors::*}
#

actually wait

#

that might be a little laggy

#

bad code

#

gimme a sec