View difference between Paste ID: DuZHDYAn and qEWPRcE5
SHOW: | | - or go back to the newest paste.
1
local NPC_ID = 190020
2
local BUFF_IDS = {53307}
3
 
4
function BuffOnSight(event, creature, player)
5-
        if (player:GetUnitType() == "Player" and creature:IsWithinDistInMap(player, 15)) then
5+
    if (player:GetObjectType() == "Player" and creature:IsWithinDistInMap(player, 15)) then
6-
        for k, v in pairs(BUFF_IDS) do
6+
        for k, v in ipairs(BUFF_IDS) do
7-
        if not player:HasAura(v) then
7+
            if not player:GetAura(v) then
8-
                        player:AddAura(v, player)
8+
                player:AddAura(v, player)
9-
                        end
9+
            end
10
        end
11
    end
12
end
13
   
14
RegisterCreatureEvent(NPC_ID, 27, BuffOnSight)