General > Developers Corner
Last Help to Finish Zombie RP Project Version: 1.0
MrPresident:
THIS CODE IS IN REGARDS TO THE FUEL CAN SPAWNING
--- Code: ---function GascanFunction()
PrintMessage( HUD_PRINTTALK, "Gas cans have spawned around the map" )
local cans = ents.FindByClass( "ent_mad_fuel" )
for k, v in pairs( cans )
v:Remove()
end
local locs = { Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) } --add all vectors here.. seperated with commas.
for i=1, #locs do
local ent = ents.Create("ent_mad_fuel")
ent:SetPos(loc[i])
ent:Spawn()
end
end
timer.Create("eventtimer", 120, 0, GascanFunction)
--- End code ---
I really hope those above 2 posts of code work for you.. if not, let me know what errors you get and I can try and work through it. I'm writing untested code from memory... some of it is bound to fail! :)
An Error Has Occurred!
array_keys(): Argument #1 ($array) must be of type array, null given
[0] Board index
Go to full version