Quote Originally Posted by clifton
I do not know if someone already posted it, i looked everywhere on the internet and couldn't find it :S so ill give you my own version.
Code:
local function On_Gossip_Talk(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(3, "Level me to 80!", 0, 0)
    unit:GossipMenuAddItem(3, "Grant Me One Level!", 1, 0)
    unit:GossipMenuAddItem(3, "Grant Me Two Levels!", 2, 0)
    unit:GossipMenuAddItem(3, "Grant Me Three Levels!", 3, 0)
    unit:GossipSendMenu(player)
end

local function On_Gossip_Select(unit, event, player, id, intid, code)
    if(intid == 0) then
        if(player:GetLevel() < 80 and player:GetItemCount(88980) >= 1) then
            player:SetLevel(80)
            player:RemoveItem(88980, 1)
        end
    elseif(intid == 1) then
        if(player:GetLevel() < 80 and player:GetItemCount(88981) >= 1) then
            player:SetLevel(player:GetLevel()+1)
            player:RemoveItem(88981, 1)
        end
    elseif(intid == 2) then
        if(player:GetLevel() < 80 and player:GetItemCount(88982) >= 1) then
            player:SetLevel(player:GetLevel()+2)
            player:RemoveItem(88982, 1)
        end
    elseif(intid == 3) then
        if(player:GetLevel() < 80 and player:GetItemCount(88983) >= 1) then
            player:SetLevel(player:GetLevel()+3)
            player:RemoveItem(88983, 1)
        end
    end
end

RegisterUnitGossipEvent(90000, 1, On_Gossip_Talk)
RegisterUnitGossipEvent(90000, 2, On_Gossip_Select)
Credits:
clifton
rochet2 for helping




› See More: [LUA] NPC Level up with tokens