I need somebody to look over my Lua Script for me, and correct errors/ Fix it so that it will work... Mainly because the Random Aspect is totaly new and i know nothing about it other than what the command is.
I just dont know how to use it so Im going to post this and if anybody wishes to Fix it, then it would be very much appreciated.
Code:
math.randomseed(os.time())
SpawnRand = Math.Random(1,2)
function Wolf_Spwn(pUnit, Event)
if (SpawnRand == 1)
x = GetX()
y = GetY()
z = GetZ()
o = GetO()
pUnit:SpawnCreature(NPCID, x, y, z, o, 360000)
end
function Elemental_Spwn(pUnit, Event)
if (SpawnRand == 2)
x = GetX()
y = GetY()
z = GetZ()
o = GetO()
pUnit:SpawnCreature(NPCID, x, y, z, o, 360000)
end
function SRSC_OnCombat(pUnit, Event)
pUnit:RegisterEvent("Wolf_Spwn",60000, 0)
pUnit:RegisterEvent("Elemental_Spwn",60000, 0)
end
function SRSC_OnLeave(pUnit, Event)
pUnit:RemoveEvents();
end
RegisterUnitEvent(76001, 1, "SRSC_OnCombat")
RegisterUnitEvent(76001, 2, "SRSC_OnLeave")
Im trying to make it so the Mob will spawn one of 2 different mobs every minute, but as i said i have no idea how to put the random aspect in.
I do know i dont have the Unit Id for the spawned units, because i havnt created them yet.
P.S. I also know that to some people this will look completely rediculous...I am laughing at it right now....