Technology (Read Only) > Programming

Multiple Scripting Problems

<< < (2/3) > >>

mdew355:
I think you can only use math.random with numbers like math.random(0, 10)
I don't know zombie survival's LUA that well (if that's whats this for) but I don't know where you got #spawns from 0.o

StartedBullet:
This is for a single-player LFD last stand mode. Ive seen multiple examples of random spawning through this method on the wki. If not this, how will I randomly spawn zombies.
_______
function GM:PlayerSelectSpawn( pl )
 
    local spawns = ents.FindByClass( "info_player_start" )
    local random_entry = math.random(#spawns)
 
    return spawns[random_entry]
 
end
_________
Thats the wiki script.

Кrаsher:
I really don't think it is needed to run that on GMod lua, as info_player_start is the main set of spawn points and will automatically be selected. (Randomly)

StartedBullet:
No, Im trying to use it to randomly spawn npcs.

Tomcat:

--- Quote from: StartedBullet on September 06, 2010, 11:02:06 AM ---No, Im trying to use it to randomly spawn npcs.

--- End quote ---


find all of the npc spawns then




put them into a table lol

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version