Hey guys,
I made a custom achievement in game and I would like this achievement to reward an Item once it's obtained. I made a small script that would allow players to obtatin this item on login after obtaining the achievement.
I was wondering is there a function in LuA that allows me to award the item to the player on earning the achievement instead? if not how could i make it so the player only gets the item ONCE on the first time he logs in after obtaining the achievement instead of getting the item every time they log in.
Here is my mini script:
function CM_Complete(event, plr)
if plr:HasAchievement(2136) then
plr:AddItem(44160, 1)
end
end
RegisterServerHook(4, "CM_Complete")