[lua]
function rndIgnite()
local prop = ents.FindByClass( "prop_physics" )
prop[math.random(1,#prop)]:Ignite( 30 )
end
[/lua]
?
Mrkrabz, its just this?
Should I make a cl_init with this, and it will work or should I put a timer?
Ignite is a server sided command. You could create a timer to call that function if this is actually what you want.
[lua]
hook.Add( "Initialize", "StartRandomFire", function() timer.Simple( 10, rndIgnite) end)
[/lua]
Just call that in your sv_init or another server sided file. You didn't specify what you wanted to do with it, so that just starts setting random props on fire every 10 seconds when the gamemode starts.
So should I make
sv_init
hook.Add( "Initialize", "StartRandomFire", function() timer.Simple( 10, rndIgnite) end)
and
cl_init
[I]function rndIgnite()
local prop = ents.FindByClass( "prop_physics" )
prop[math.random(1,#prop)]:Ignite( 30 )
end[/I]
And every 10 seconds something would get ignited?
Sorry, you need to Log In to post a reply to this thread.