Table erases itself

The table cannot retain its data between remote event receiving even though it is outside the embedded function.

In the code, the bottom most print statement prints the table and it’s data properly. However, the top most print statement consistently prints empty tables.

There is no where else in any of the game’s code that removes the data from the table without an additional event firing (which has not been programmed yet)

local billboarded = {}
--the event is fired twice, so it should print an empty table only once
event.OnClientEvent:Connect(function(method:string, name:string)
	print(method)
	if string.lower(method) == "create" then
		local list
		print(billboarded) --prints empty table twice
		if not table.find(billboarded, name) then
			--cut code
			table.insert(billboarded, name)
            print(billboarded) --prints the table properly
		else
--this else statement never executes
list = playergui:FindFirstChild(billboarded[table.find(billboarded, part)])
end
		--cut code

I think that there might be something that you missed, because when I changed the code you provided into a valid function and ran it, it got to the if statement just fine.


How rapidly are you firing it?