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

I’m not exactly sure how you want to get the values of the module from the Id, and how would you get the id. Is there a specific id for each bunny or??

Edit: I assume its by name so you could just do:

local bunnyName = Bunny.Name
local bunnyID

for k, v in pairs (BunnyConfig.Bunnys) do
    if v.ID == bunnyName then
        v.ID == bunnyID
        break
    end
end

Where would I put this script?

Before you call this function.

Also put:

BunnyModule:CheckBunnyFromID(BunnyID)

Also it is about the ID for example on the BunnyModule

are the IDs the same as the Bunny Names?

No The name is the ID without the _ should I just delete it

I mean it just makes things more complex, and your code longer since it would have to use some kind of string match. Yeah, I suggest deleting the _.

Ok also I added your script and it is saying “Incomplete statement expected assignment or a function call.”

Did you remove the _ on all of the IDs?

Yes i did. What else do i need to do

for i, Bunny in pairs(BunnyFolder:GetChildren()) do
	if Bunny:IsA('Part') and Bunny.Parent == BunnyFolder then
		Bunny.Touched:Connect(function(Hit)
			local bunnyName = Bunny.Name
			local bunnyID

			for k, v in pairs (BunnyConfig.Bunnys) do
			    if v.ID == bunnyName then
			        v.ID == bunnyID
			        break
			    end
			end
			local LocalPlayer = Players:GetPlayerFromCharacter(Hit.Parent)
			BunnyModule:CheckBunnyFromID(bunnyID)
		end)
	else
		warn('Touched Part Not From Bunny Folder')
	end
end

It is still saying “Incomplete statement expected assignment or a function call.”

which line of code is popping up that error?

On the part v.ID == bunnyID do you know how to fix.

Oh whoops! My bad I added 2 = signs when i was supposed to add only 1
remove 1 of the =.

Edit: Wait hold on

bunnyID = v.ID

replace it to this. My bad. I’m just tired

Now it is just saying “Variable ‘bunnyID’ is defined on line 21 is never initialized or assigned; initialize nil to silence”

Oh never mind it is working now let me test it

Still, the same error invalid argument #1 to ‘pairs’ (table expected, got nil)

when you print “bunnyID” what does it give you. after that loop is done.

Where do i put print(bunnyID)?