I can see that similar questions has been asked, however I'm not really that familiar with lua coding. I'm trying to fix an old World of Warcraft vanilla addon, to run in the Classic client.
The code is as follows:
function FHH_OnLoad()
this:RegisterEvent("PLAYER_ENTERING_WORLD");
this:RegisterEvent("UPDATE_MOUSEOVER_UNIT");
-- Register Slash Commands
SLASH_FHH1 = "/huntershelper";
SLASH_FHH2 = "/hh";
SlashCmdList["FHH"] = function(msg)
FHH_ChatCommandHandler(msg);
end
local version = GetAddOnMetadata("GFW_HuntersHelper", "Version");
GFWUtils.Print("Fizzwidget Hunter's Helper "..version.." initialized!");
end
And it throws the following errors;
Message: Interface\AddOns\GFW_HuntersHelper\HuntersHelper.lua:27: attempt to index global 'this' (a nil value)
Time: Tue Jun 30 09:25:14 2020
Count: 1
Stack: Interface\AddOns\GFW_HuntersHelper\HuntersHelper.lua:27: attempt to index global 'this' (a nil value)
Interface\AddOns\GFW_HuntersHelper\HuntersHelper.lua:27: in function `FHH_OnLoad'
[string "*:OnLoad"]:1: in function <[string "*:OnLoad"]:1>
Locals: (*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index global 'this' (a nil value)"
I've tried playing around with the "this" statement but I'm not really sure what to do, and thought I'd see if anyone of you bright people in here would know what's going on