Getting the error: ServerScriptService.BunnyHandler.MainBunny:28: invalid argument #1 to 'pairs' (table expected, got nil)

No errors but the icon dosent work become visible and same with the gui

Why don’t you print inside there, any strings. does it print?

Where in the if not targetGuiObject then?

yeah just print any strings like “works”, “success”, etc and see which parts of the code work.


Nothing prints not a single thing

try printing before the loop. does it print then?

No It dosent print anything. I called the function too

OH WAIT NO I FORGOT!!!

Replace this:

With:

for k, v in pairs (BunnyConfig.Bunnys) do
			    if k == bunnyName then
			         BunnyModule:CheckBunnyFromID(v)
			        break
			    end
			end

I AM EXTREMELY SORRY!

It is fine i will test this now, Mistakes happen to everyone big or small, I will forgive you :slight_smile:

now it is showing an error ServerScriptService.BunnyHandler.MainBunny:29: attempt to call a nil value

function Module:SetProperties(Parent, propertiesTable)
	for guiObjctName, labelProperties in pairs(propertiesTable) do
		local targetGuiObject = Parent:FindFirstChild(guiObjctName)
		if targetGuiObject and targetGuiObject:IsA('Frame') then
			targetGuiObject = targetGuiObject:FindFirstChild('Label')
		end
		if not targetGuiObject then
			continue
		end
		for propertyName, propertyValue in pairs(labelProperties) do
			targetGuiObject[propertyName] = propertyValue
		end
	end
end
``` this is the entire script

for guiObjctName, labelProperties in pairs(propertiesTable) do

the bottom one is the part that is erroring

when you say lets say

print(propertiesTable)

What does it output?

Before the loop.

it prints

table: 0x7969801398a99825

ok great! So the table is there, I think you need to rephrase the way you wrote the function.

how? can you tell me? If you cant then it is fine

You can start by removing the for loop:

function Module:SetProperties(Parent, propertiesTable)
	local targetGuiObject = Parent:FindFirstChild(propertiesTable.Display.Title.Text) -- I don't really know what your trying to find here
	if targetGuiObject and targetGuiObject:IsA('Frame') then
		targetGuiObject = targetGuiObject:FindFirstChild('Label')
	end
	if not targetGuiObject then
		continue
	end
	for propertyName, propertyValue in pairs(propertiesTable.Display) do
		targetGuiObject[propertyName] = propertyValue 
	end
end

Although for this line of code I don’t really know what your trying to find.

It is this

Display = {

			Rarity = Module.Rarities[1],

			Title = {

				**Text = 'Normal Bunny',**
				TextColor3 = Color3.new(1, 1, 1),
			},
		},

the bold Is what i am trying to find

Ok, I did that. You can try and see if it works.

It says ServerScriptService.BunnyHandler.MainBunny:28: attempt to call a nil value