Kaev basically showed you an example what you could do. You cannot just take examples like:
Originally Posted by azamaqtlol
And expect them to work out of nowhere. You are required to initialize the 'player' variable or obtain the 'player' in some way. If you are intending for this "PlaySoundToPlayer" to be in "EnterCombat" only, I'd suggested getting the typeId of the target to check if it is a player and play the sound. Though, I'm not sure you want to to play the sound to all players instead of one.
However, we have to make sure our target is a player first.
Not sure if the above will work since 'target' is Unit and not Player. I can't test it, so..
function LordVictorNefarius.EnterCombat(event, creature, target)
creature:SendUnitYell("This lair once belongs to my sister, but now everything is mine.. I will...hmmm? humans, here? in my lair? most be a joking, I WILL INCINERATE YOU PATHETIC ANTS...", 0)
if target:GetTypeId() == 4 then -- If the target is a player
target:PlaySoundToPlayer(8280) -- Play sound
creature:RegisterEvent(LordVictorNefarius.sacreamsoftheDead, 40000, 0)
creature:RegisterEvent(LordVictorNefarius.Sleep, 30000, 0)
creature:RegisterEvent(LordVictorNefarius.searingFlame, 13000, 0)
creature:RegisterEvent(LordVictorNefarius.CorruptingBlight, 15000, 0)
creature:RegisterEvent(LordVictorNefarius.SpawnHounds, 90000, 0)
creature:RegisterEvent(LordVictorNefarius.DominateMind, 50000, 0)
creature:RegisterEvent(function(...) LordVictorNefarius.Phase(1, ...) end, 5000, 0)