just a quick reply:
1. it's Lua, not LUA
2. "a = b == c" is the same as "a = (b == c)", so a = true if b equals c
3. regarding your error:
It's caused by this statement: BB = tonumber(casterGUID:sub(5,5), 16);
What it does is trying to convert the 5th char in the string to a number by interpreting it as a hexadecimal value.
Since your string starts with "creature", the 5th char is a t which has no hexadecimal meaning.
Why does this happen?
Well, GUID changed for WoW 6.x (see:
http://wow.gamepedia.com/GUID, old:
http://wow.gamepedia.com/index.php?t...&oldid=2939882 ).
Fix: adapt the code to the new GUID format (e.g. get the first part and match it against the desired values)