Instantly share code, notes, and snippets.

@mindsear mindsear/example.lua Secret
Last active Feb 13, 2018

What would you like to do?
Example Eluna Creature Spawn/Despawn GameObject
-- Example Eluna Creature Spawn/Despawn GameObject
local NPC_ID = 299 -- Diseased Young Wolf
local MailBox = 195629 -- MailBox GameObject ID
local function OnEnterCombat(event, creature, target)
creature:SummonGameObject(MailBox, creature:GetX(), creature:GetY(), creature:GetZ(), creature:GetO(), 0)
creature:SendUnitSay("Spawned GameObject successfully", 0)
local function OnDied(event, creature, killer)
local nearestGameObject = creature:GetNearestGameObject(50, MailBox)
creature:SendUnitSay("Despawned GameObject successfully", 0)
RegisterCreatureEvent(NPC_ID, 1, OnEnterCombat)
RegisterCreatureEvent(NPC_ID, 4, OnDied)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment