I got it guys! Because i've already done this many times in the Easy Scripts in my Basic Scripting reference its easy for me.
Make a script named whatever but ill call mine game,
make a function like you have:
Code: Select all
function grantPuzzleExp(totalExp)
local c = nil; local p = party.party; local a = {}; local exp = 0;
for i=1, 4 do
c = p:getChampion(i)
if c:getEnabled() and c:isAlive() then table.insert(a,i) end
end
exp = math.ceil(totalExp / #a)
for _,n in ipairs(a) do
p:getChampion(n):gainExp(exp)
end
end
And if you set it up correctly sense the scrip is named game you simply say
When making your own methods and code you can use globally you never put : never: ever: ever: its all dots .......
IF YOU EVER PLACE : instead of a dot . you it doesn't happen no errors but the grantPuzzleItem function won't get called because you don't use :