Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how to do random spawning in 5 random places
- xkellsn2
-
New Scratcher
5 posts
how to do random spawning in 5 random places
doesnt need to be exactly 5 but more than two
i want an enemy to spawn in a random place in my tank game
please provide script and reason if you have an answer
i want an enemy to spawn in a random place in my tank game
please provide script and reason if you have an answer
- An0therRand0mC0der
-
Scratcher
1000+ posts
how to do random spawning in 5 random places
You mean something like this?


- goodpersonsowow
-
Scratcher
100+ posts
how to do random spawning in 5 random places
First, add a list and name it “x positions”. Then, add 5 random x positions. Then, add another list and name it “y positions”. Then, add 5 random y positions. Then, make a variable called “random”. Last, make this code:
when green flag clicked
set [random v] to (pick random (1) to (5))
go to x: (item (random) of [x positions v] :: list) y: (item (random) of [y positions v] :: list)
- xkellsn2
-
New Scratcher
5 posts
how to do random spawning in 5 random places
Thanks ima make a couple edits to that code
update: it works yes
update: it works yes
- Discussion Forums
- » Help with Scripts
-
» how to do random spawning in 5 random places