Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: Kobiesan on May 23, 2017, 07:32:28 am
-
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?
-
Your argument spell is nil/null. Error says you can't get the target from something that doesn't exist. Make sure spell is not nil/null, e.g. by adding if (spell) then {code} end
-
Your argument spell is nil/null. Error says you can't get the target from something that doesn't exist. Make sure spell is not nil/null, e.g. by adding if (spell) then {code} end
Can you elaborate a bit more?