Lua Help with error please
With this code I get an error could you please tell me what is wrong with it. Thanks.
function GRM_BriefListOnClick() -------------------------------------------------------------- if ( GRM_BriefLast_Selected ) then _G[GRM_BriefLast_Selected]:UnlockHighlight(); end GRM_BriefLast_Selected = self:GetName(); _G[GRM_BriefLast_Selected]:LockHighlight(); local title = _G[GRM_BriefLast_Selected.."_Text"]:GetText(); GRM_ClearBriefText(); GRM_BriefTitle_Edit:SetText(title); GRM_BriefBodyScrollText:SetText(GRM_BriefList[title]); GRM_BriefTitle_Edit:ClearFocus(); GRM_BriefBodyScrollText:ClearFocus(); end ERROR MESSAGE 1x GoldRaidManager-4.0.1.0\GoldRaidManager.lua:1278: attempt to index global 'self' (a nil value) <string>:"*:OnClick":1: in function <[string "*:OnClick"]:1> Locals: self = GRM_BriefList_Entry3 { 0 = <userdata> } button = "LeftButton" down = false |
Try changing function GRM_BriefListOnClick() to function GRM_BriefListOnClick(self) - the error stems from the self referenced a few lines down being nil.
|
Quote:
No that did not correct it I still get. This error when clicking on it. 1x GoldRaidManager-4.0.1.0\GoldRaidManager.lua:1278: attempt to index local 'self' (a nil value) <string>:"*:OnClick":1: in function <[string "*:OnClick"]:1> Locals: self = GRM_BriefList_Entry1 { 0 = <userdata> } button = "LeftButton" down = false --- |
Yeah, think I got it wrong.
The action is probably defined in an associated .xml-file, try to find the <OnClick> part that calls the function and add the 'self' there. I'm guessing it would end up looking like: xml Code:
|
All times are GMT -6. The time now is 03:08 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI