Im looking for a way to spawn multiple props around a map by a script. There wont just be one or two there will be 50+ needing to be spawned in specific places.
I am needing this to be neat as possible.
I dont want to be using:
barrel=ents.Create("prop_physics")
barrel:SetModel("models/props_c17/oildrum001.mdl")
barrel:SetPos(Vector(0,0,0))
barrel:Spawn()
On every prop I want. is this the way to go about it or is there a neater more efficient way?
I would use a for loop and a table.
[code] props = {
["models/props_c17/oildrum001.mdl"] = Vector(0, 0, 0),
["PROP PATH"] = Vector(POSITON),
["PROP PATH"] = Vector(POSITON) -- Just add more entries to the table to add props.
}
for path, pos in pairs(props) do
ent = ents.Create("props_physics") -- Not sure if that is the right entity, its been awhile
ent:SetModel(path)
ent:SetPos(pos)
ent:Spawn()
end [/code]
Sorry, you need to Log In to post a reply to this thread.