This error is usually an omission, You are trying to execute as a function, something that is not a function. Happens to me all the time. Must be a bug in one of the required modules, as the modules are executed upon requiring and they may contain some auto code.
No. That is not what I meant. I meant the bug is inside either:
alignElement,
createElement,
createTween
or render
modules. One common mistake with module functions is that they return the result of a function and not the function itself.
---module script
function alignElement()
print("I am aligning this, sit tight")
return true
end
--correct
return alignElement
--incorrect
return alignElement() -- this won't work, but will not error. However `Pollen.alignElement` is not a function, it is now a boolean and will give you aforementioned error.
Like I said, you are definitely trying to call (execute as a function) something that is not a function. This error is definitely in one of Your modules.
Rest is just my speculation, as You have not provided the source of the modules. I did my best to provide you with example mistakes, that is all I can do without seeing scripts.
So you want your modules to return only the function. Returning a dictionary is unnecessary and won’t work without specifying which function you want to call. I suggest to modify Your modules, but you may also modify Your local script to specify that.
--module script
-- local Pollen = {} -- remove this line
function render(element, parent, name) --modify this line this way
element.Parent = parent
if name then
element.Name = name
end
end
return render -- return the function and not the table.
And so on for other scirpts.
EDIT:
If you want Your modules to stay as they are, you will need to use them in the `LocalScript’ like this:
As for the createTween module this solution will not work, since there are more than one function that needs to be returned.
In this case, leave the module as it is. (although I would suggest to change the ‘Pollen’ word inside the module to ‘module’, as it is misleading) Then, you have to specify in local script, which tween you want to use: