Hi.
I made a UI to display warnings, and instead of making seperate UIs, i’m only using one.
I can acheive this by only changing what is written on the UI’s textlabel, So I made a modulescript to make that easier.
However, the modulescript refuses to co-operate by simply warning in output Attemplted to call require with invalid argument(s). I have no clue why, or how.
the modulescript’s code:
local WarningUI = {}
function WarningUI.Warn(warningMessage)
script.Parent.TextLabel.Text = tostring(warningMessage)
script.Parent.Visible = true
wait(3)
script.Parent.Visible = false
end
WarningUI.Warn()
return WarningUI
There is probably something wrong with the module script path. The error itself is stating that the argument within require() is invalid, which means whatever is in the set of parenthesis is somehow unable to be read by the script properly.
It probably exists, but the script might not realize it exists, either due to the client/server boundary or possibly something isn’t loading in fast enough.