Hi,
I'm trying to port the Meteor Storm from DarkRP to my own game I'm creating. So far I moved the entities from DarkRP and the main code to my own project. I can spawn the meteor entity fine with ent_create but my code here doesn't work (However, I don't receive any errors).
[lua]
elseif (int1 == 3) then
PrintMessage( HUD_PRINTTALK, "(EVENT) The beast summons the power of the cosmos! A meteor shower is approaching!" )
timer.Start("stormControl") --start storms
local function ControlStorm()
timeLeft = timeLeft - 1
if timeLeft < 1 then
if stormOn then
timeLeft = math.random(300,500)
stormOn = false
timer.Stop("start")
StormEnd()
else
timeLeft = math.random(60,90)
stormOn = true
timer.Start("start")
StormStart()
end
end
end
local function AttackEnt(ent)
meteor = ents.Create("meteor")
meteor.nodupe = true
meteor:Spawn()
meteor:SetMeteorTarget(ent)
end
local function StartShower()
timer.Adjust("start", math.random(.1,1), 0, StartShower)
for k, v in pairs(player.GetAll()) do
if math.random(0, 2) == 0 and v:Alive() then
AttackEnt(v)
end
end
end
timer.Create("start", 1, 0, StartShower)
timer.Create("stormControl", 1, 0, ControlStorm)
--timer.Stop("start")
--timer.Stop("stormControl")
timer.Create( "event", 30, 1, event, ply )
end
[/lua]
Bump?
Sorry, you need to Log In to post a reply to this thread.