Why does this script crash the game
Posted: Sat Mar 02, 2013 4:31 pm
When the script below executes it crashes the game in the editor preview ... no warnings/errors .. just stops.
I'm probably missing something really obvious here but I just can't see why it's crashing. Any help is appreciated.
Edit: Just to note... the AwardXp function works when used elsewhere.
I'm probably missing something really obvious here but I just can't see why it's crashing. Any help is appreciated.
Code: Select all
function AwardXp(XpToAward)
XpToAward = math.floor((XpToAward / 4) + 0.5)
party:getChampion(1):gainExp(XpToAward)
party:getChampion(2):gainExp(XpToAward)
party:getChampion(3):gainExp(XpToAward)
party:getChampion(4):gainExp(XpToAward)
end
Level = 2
XP = 100 * Level
AwardXP(XP)