Can't Find Pointers, etc.
I have a piece of code, and it... Completely fills the console with errors. The first error it makes is for the ToActor function. It says something about a "simple conversion" thing... Next is that it makes my timer, HTT, nil. Then it can't use the GetController function, so it says that I'm trying to index a nil variable. Which I am. Code:
Code:
function Create(self)
self.owner = ToActor(MovableMan:GetMOFromID(self.RootID))
self.ParCon = self.owner:GetController()
self.spell = {}
self.spell[0] = "Bunnyerified"
self.spell[1] = "Bunny Cannon"
self.Gauge = CreateMOSRotating("Mana Gauge","Mahou.rte")
self.totspl = 1
self.numref = 0
self.HTT = Timer()
self.Gauge.PosX = self.target.PosX
self.Gauge.PosY = self.target.PosY - 100
MovableMan:AddParticle(self.Gauge)
end
function Update(self)
if self.ParCon:IsState(10) then
if self.HTT:IsPastSimMS(100) then
self.HTT:Reset()
end
end
if self.ParCon:IsState(10) then
if not self.HTT:IsPastSimMS(100) then
if self.numref < totspl then
self.numref = self.numref + 1
self.SetNextMagazineName(spell[numref])
self.con:SetState(15)
else
self.numref = 0
self.SetNextMagazineName(spell[numref])
self.con:SetState(15)
end
end
end
end