• Entity Spawning Script
    2 replies, posted
Hey, First I'm going to start off that I'm VERY new to Lua, so if there are many things wrong with what I need help, please cut me some slack. I'm trying to get this script to work to place entities on a map to get crafting materials to build stuff, it was working at a time but the timer did the exact same when I wanted it to randomize, and it also didn't work the next time I tried it, so if you could please help a lua newb I would gladly appreciate the help :D [CODE]if SERVER then return spawnTimer() end function spawnTimer() timer.Create( "Entity Spawn", math.random(5,10), 0, entitySpawn) end local EntityList = { "weapon_ar2", "weapon_physgun", "weapon_crowbar" } local PositionList = { Vector(184, -541, -55), Vector(-1136.8, -1425, 304) } function entitySpawn() print("Entities Spawning") for _, pos in pairs( PositionList ) do local ent = ents.Create(EntityList[math.random(#EntityList)]) ent:SetPos(pos) ent:Spawn() end end[/CODE]
-bump-
[QUOTE=JDeaverBeaver;44015170]it was working at a time but the timer did the exact same when I wanted it to randomize, and it also didn't work the next time I tried it[/QUOTE] [url]http://facepunch.com/showthread.php?t=1367951&p=44008600&viewfull=1#post44008600[/url]
Sorry, you need to Log In to post a reply to this thread.