View Full Version : spell:GetEntry() - syntax error near 'spell'

05-13-2014, 10:02 PM
Hello guys, I keep getting this error:

[Eluna]: Starting Lua Engine
[Eluna]: Searching scripts from `lua_scripts`
[Eluna]: Error loading file `lua_scripts/spell_check.lua`
lua_scripts/spell_check.lua:2: syntax error near 'spell'
[Eluna]: Loaded 0 Lua scripts

What I'm trying to do is getting the id/entry of the spell.

The script I made:

local function OnSpellCast(event, player, spell, skipCheck)
print spell:GetEntry()

RegisterPlayerEvent(5, OnSpellCast)

I updated my eluna/trinity revision after I got it and I still get it. (I'm running the latest version at the date of this post: commit c7dac697e83186360a69dea71607c86242b144ba)
I tried spell:GetId() and spell:GetEntry() both don't seem to work.

Am I doing something wrong or is eluna wrongly documented?

Thanks in advance,


05-13-2014, 10:04 PM
I believe you're using print wrong (using a variable.) It should be like:

local function OnSpellCast(event, player, spell, skipCheck)
print (spell:GetEntry())

RegisterPlayerEvent(5, OnSpellCast)

05-13-2014, 10:06 PM
I feel like such an idiot right now... Thanks for the help with this newbie mistake. I certainly won't make it again!

05-13-2014, 10:19 PM
Marked as solved :P