this is my error, and i dont know how to fix it
-----------------------------------------------------------------------------------------------------
40x _Deranjata\modules\xpbar\artxp.lua:35: attempt to call global 'SetValue' (a nil value)
_Deranjata\modules\xpbar\artxp.lua:35: in function <_Deranjata\modules\xpbar\artxp.lua:22>
Locals:
self = derArtifactBar {
0 = <userdata>
}
event = "UNIT_INVENTORY_CHANGED"
showArtifact = true
itemID = 128866
altItemID = 128867
name = "Truthguard"
icon = 1272527
totalXP = 100
pointsSpent = 0
numPoints = 1
artifactXP = 0
xpForNextPoint = 300
(*temporary) = nil
(*temporary) = derArtifactBar {
0 = <userdata>
}
(*temporary) = 0
(*temporary) = "attempt to call global 'SetValue' (a nil value)"
------------------------------------------------------------------------
here is my code
Lua Code:
derArtifactBar:RegisterEvent("PLAYER_ENTERING_WORLD")
derArtifactBar:RegisterEvent("ARTIFACT_XP_UPDATE")
derArtifactBar:RegisterEvent("UNIT_INVENTORY_CHANGED")
derArtifactBar:SetScript("OnEvent", function(self, event, ...)
local showArtifact = HasArtifactEquipped()
if not showArtifact then
if self:IsShown() then
self:Hide()
end
return
end
if not self:IsShown() then
self:Show()
end
local itemID, altItemID, name, icon, totalXP, pointsSpent = C_ArtifactUI.GetEquippedArtifactInfo()
local numPoints, artifactXP, xpForNextPoint = MainMenuBar_GetNumArtifactTraitsPurchasableFromXP(pointsSpent, totalXP)
SetValue(self, artifactXP/xpForNextPoint)
end)
my problem:
SetValue(self, artifactXP/xpForNextPoint)
is throwing an error for
derArtifactBar:SetScript("OnEvent", function(self, event, ...)