But still now working properly. Here is my code snippet:
Code:
if (aura.model == true) then
texture:Hide()
model:ClearModel()
model:SetModel(PowaAurasModels[aura.texture])
elseif (aura.modelcustom == true) then
texture:Hide()
if (aura.modelcustom ~= nil and aura.modelcustom ~= "") then
if (string.find(aura.modelcustompath, "%.m2")) then
model:ClearModel()
model:SetModel(aura.modelcustompath)
elseif (string.lower(aura.modelcustompath) == "player" or string.lower(aura.modelcustompath) == "target" or string.lower(aura.modelcustompath) == "focus") then
model:ClearModel()
model:SetUnit(string.lower(aura.modelcustompath))
end
end
end
PowaAurasModels[aura.texture] is a table with predefinied models.
aura.modelcustompath holds a model file or units like "player", "target", "focus".
EDIT: Okay i was derping around, and it seems like if i use model:SetUnit("none") instead or model:ClearModel() that does the trick. I'm not sure thats a proper API or not tho. :P