I've got some levels already done, but I'm not very good with scripting.
In one level I decided I should have a random spawner for monsters. The player steps into a pressure plate and "puff" two random monsters appear in the next two corridors.
I've been doing this the hard way. I've set up a room with several monsters and a few teleporters deactivated. What I'm doing is activating those teleporters for a brief moment letting some monsters "squeeze" into the corridors.
What I would like to do is use a script instead. I've been looking for scripts and found something that I thought it could help me, so I modified it a bit but I'm not getting the script to work. Any help would be appreciated.
I believe the original script that I tried to adapt was for counting the number of monsters from a list.
here is what I was thinking:
Code: Select all
-- RANDOM MONSTER
function spawnR()
monsters = {"snail","herder","crowern","ogre"}
random_monster = math.random(1,#monsters)
spawn("random_monster", 16, 20, 11, 2)
end
The problem seems to be on my 3rd line of code, I believe I need something completely different in there.
Can someone help?