Originally Posted by ravagernl
Because your syntax is wrong. You can not set a script handler using the syntactic colon operator. SetScript/HookScript expect a reference to a function. Using the colon is just a shorter way of passing the table as the first argument:
lua Code:
local someaddon = {a = 10, plus = function(self) self.a = self.a + 5 end} someaddon:plus(5) print(someaddon.a) -- prints 15 local addonb = {a = 30, plus = someaddon.plus} addonb:plus(10) print(addonb.a) -- prints 40 someaddon.plus(addonb, 5) print(someaddon.a) -- prints 20 print(addonb.a) -- prints 40
|
And if i do it like that?
Code:
local function OnUpdate(self, elapded)
PVPSound:UpdateSoundEffectEngine(self, elapsed)
end
function PVPSound:UpdateSoundEffectEngine(self, elapsed)
end
PVPSoundEffectSoundEngineFrame:SetScript("OnUpdate", OnUpdate)