Why am I getting an error?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?

I want the script to work and stuff

  1. What is the issue? Include screenshots / videos if possible!

I keep getting these errors and I do not know why:

image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

ModuleScript error area

function types:Label(name)
    local order = self:GetOrder()
    local determinedSize = UDim2.new(1, 0, 0, 25)
    local determinedPos = UDim2.new(0, 0, 0, 4)
    local secondarySize = UDim2.new(1, 0, 0, 20)
    if order == 0 then
        determinedSize = UDim2.new(1, 0, 0, 21)
        determinedPos = UDim2.new(0, 0, 0, -1)
        secondarySize = nil
    end
    local check = library:Create("Frame", {
        Name = 'Label',
        BackgroundTransparency = 1,
        Size = determinedSize,
        BackgroundColor3 = library.options.sectncolor,
        BorderSizePixel = 0,
        LayoutOrder = order,
        library:Create("TextLabel", {
            Name = "label_lbl",
            Text = name,
            BackgroundTransparency = 0,
            BorderSizePixel = 0,
            BackgroundColor3 = library.options.sectncolor,
            TextColor3 = library.options.textcolor,
            Position = determinedPos,
            Size = (secondarySize or UDim2.new(1, 0, 1, 0)),
            Font = library.options.font,
            TextSize = library.options.fontsize,
            TextStrokeTransparency = library.options.textstroke,
            TextStrokeColor3 = library.options.strokecolor
        }),
        Parent = self.container
    })
    self:Resize()
	local label = check:FindFirstChild("label_lbl")
	return {
		Set = function(str)
			label.Text = str
			return label
		end,
		label
	}
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

SOMEONE PLEASE HELP ME I WOULD BE VERY GREATFULL

Note: The Whole ModuleScript is a Ui Library.

Error Area:

Set = function(str)
	label.Text = str
	return label
end,
label

The whole modulescript can be found here:-- Forked From wally.local vers = "0.45" -- https://api.roblox.com/assets/4133 - Pastebin.com

The error appears to be implying that you are calling the function with a table parameter, rather than a string. Can you show the LocalScript you are using to call the function?

2 Likes

Its because you are not using str but self instead. So just add before the str parameter another parameter and name it self. Then it should work:

Set = function(self, str)
	label.Text = str
	return label
end

If you want to understand self, check out this post!