Getting strange table which is used as key in dictonary

Hello there! I have a dictionary where’s table used as key. But when I loop through the dictionary, my table looks something like this: < Table> (table: 0x90b2affff6aef925). And I can’t access any values using indexes because it returns nil. what should I do?

In the output window top right, there should be a settings/3 dots or something. Click it and there is an option about the table. Forgot the name but you’ll find it.

I turned these things on:
image
But I still get output like this
image

Turn of show memory address to get rid of those numbers, has the table got anything in it?

Turned it off but still table is corrupted. Tables have 3 int values which I can’t get in local script

Also I found out it’s not a table but a string

What do you mean? You’re printing a string not a table and it shows
image
?

It should be a table but when I tried to loop through the it it shows me an error that you can’t loop through strings

could you show full code or the important parts with table?

code where table is used(don’t mind variable x I used it to not get lots of lags because there’re lots of values)

rs.RemoteEvents.RenderWorld.OnClientEvent:Connect(function(blocks)
	x=0
	for i,v in blocks do
		x+=1
		local pos=v['position']
		if x%100==0 then
			print(i)
		end
		for d in {1,-1} do
			local block=blocks[{pos[1]+d,pos[2],pos[3]}]
			if not block or block=='Air' then
				blockmodule.PlaceBlock(v['name'],pos)
				break
			end
			local block=blocks[{pos[1],pos[2]+d,pos[3]}]
			if not block or block=='Air' then
				blockmodule.PlaceBlock(v['name'],pos)
				break
			end
			local block=blocks[{pos[1],pos[2],pos[3]+d}]
			if not block or block=='Air' then
				blockmodule.PlaceBlock(v['name'],pos)
				break
			end
		end
	end
end)

module where script puts values

local module = {}

module.BlockList={}

function module.AddBlockToList(name,pos,data)

module.BlockList[{pos[1],pos[2],pos[3]}]={['name']=name,['position']=pos,['data']=data}

end

return module

is this showing as string?
could you show the script firing the event?

for x = 0,150,1 do
	for z = 0,150,1 do
		--for y = 60,150,1 do
		--	--print(math.noise(x,z,0.9))
		--	block=generationmodule.GetBlock(x,y,z,0.1)
		--	--print(block)
		--	blockmodule.PlaceBlock(block,x,y,z)
		--end
		for y = 78,80,1 do
			--blockmodule.PlaceBlock('Stone',x,y,z)
			blockdata.AddBlockToList('Stone',{x,y,z},{})
		end
	end
end
rs.RemoteEvents.RenderWorld:FireAllClients(blockdata.BlockList)
for i,v in pairs(blocks) do

you forgot the pairs

Really, thank you. Forgot about them

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.