I'm using whoward's dll. I want to run an action when a great person is born, but it says "attempt to index local iUnit (a number value), isn't this the right way to ask?
Code:
function TestGiveGPFaith(iPlayer, iUnit, iUnitType, iPlotX, iPlotY)
print("unit spotted")
if iUnit:IsGreatPerson() == true then --Or if iUnit:IsGreatPerson() then
print("The unit is a great person my dudes")
end
end
GameEvents.UnitCreated.Add(TestGiveGPFaith)