Another thing that came out of my mind: if i want to be actually able to manage the bars, i need to provide some way to refer to those elements outside of the function code, right?
So, the idea was this (pseudocode again):
Code:
function createSplitBar (containerframe, [rest of arguments])
local splittable ={}
for i = 1, # do
-- create bars code here
splittable[i] = bar
end
containerframe.splittable = splittable
end
-- now i should be able to call it this way
playerframe.splittable[2]:SetStatusBarColor(.3,.4,.5)
-- or whatever other operation i want to do on bars
Is there something wrong (again, logic wise, code is just thrown there)?