Hey guys!
this is the code i have now! , this code does so if mybutton2 is clicked it will run the second code below the line and print out "HelyaAssist is now Disabled" , nothing with the code broken so far but that will be printed everytime i release from graveyard, reloadui manually and so on.. I only want that code to go off if mybutton2 is clicked. How do i do this? have tried alot of things like if statements and stuff but then i get an error ingame saying that it failed cuz it is trying to call frame a global nil value.
Lua Code:
mybutton2:SetScript("OnClick", function(self, button, down)
local playerName = UnitName("player")
DisableAddOn(folder, playerName)
ReloadUI()
eventHandlerE();
end)
------------------------------------
local frame = CreateFrame("FRAME", "FooAddonFrame");
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
local function eventHandlerE(self, event, ...)
print('|cffffff00HelyaAssist is now Disabled')
end
frame:SetScript("OnEvent", eventHandlerE);
tried this for example but did not work :/
Lua Code:
local ds = 0
mybutton2:SetScript("OnClick", function(self, button, down)
local playerName = UnitName("player")
DisableAddOn(folder, playerName)
ReloadUI()
ds = 1
end)
------------------------------------
if ds == 1 then
local frame = CreateFrame("FRAME", "FooAddonFrame");
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
local function eventHandlerE(self, event, ...)
print('|cffffff00HelyaAssist is now Disabled')
end
end
frame:SetScript("OnEvent", eventHandlerE);
Best regards!