mirror of
https://github.com/araxiaonline/RandomScriptsforAzerothCore.git
synced 2026-06-13 02:22:19 -04:00
Add files via upload
This commit is contained in:
16
KillCred.lua
Normal file
16
KillCred.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
local function OnKillCredit(event, killer, killed)
|
||||
-- Check if the killed unit is a creature
|
||||
if killed:IsCreature() then
|
||||
-- Loop through all players in the world
|
||||
for _, player in pairs(GetPlayersInWorld()) do
|
||||
-- Check if the player has attacked the creature
|
||||
if player:GetUnitByGUID(killed):HasAura(2) then
|
||||
-- Give the player kill credit for the creature
|
||||
player:KilledMonsterCredit(killed:GetEntry())
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Register the event handler
|
||||
RegisterPlayerEvent(7, OnKillCredit)
|
||||
Reference in New Issue
Block a user