I have this dummy script for a spell that strangles the target. I've attempted to do this by using this dummy script (eluna):
local function onCast(effectIndex, spell)
local target = spell:GetTarget()
if (spell:GetTarget():IsPlayer() == true) then
while player:IsCasting(81076) do
target:EmoteState(474)
end
end
end
RegisterPlayerEvent(PLAYER_EVENT_ON_SPELL_CAST, onCast)
However, when it's cast I get a "Attempt to call method 'GetTarget' (a nil value)" does anyone know what this error means?