Table Problems Saying that Something nil with Debounce or any Variable Type Name

So I am Having Problems with my Table System
I am also having this error It is in output-copied here to find below:

16:40:38.419 - ServerStorage.Server-Modules.Modules.Internals.SkillsModule:9: attempt to index nil with 'Debounce'
16:40:38.422 - Stack Begin
16:40:38.423 - Script 'ServerStorage.Server-Modules.Modules.Internals.SkillsModule', Line 9
16:40:38.424 - Script 'ServerScriptService.Server-Scripts.Scripts.Skills.SkillsScript', Line 13
16:40:38.425 - Stack End

and here is my Code Snippet of where the Error Happens

table.insert(BigTable, Player.Name) -- Line 13!
BigTable[Player.Name].Debounce = false

Full Code:

local module = {}

local BigTable = {}
local SIGNAL_EVENT = game.ReplicatedStorage.Events.Signal

module.Boomerang = function(Player)
	if Player then
		table.insert(BigTable, Player.Name)
		BigTable[Player.Name].Debounce = false
		if BigTable[Player.Name].Debounce == true then return end
		
		SIGNAL_EVENT:InvokeClient(Player, "Boomerang")
		
		BigTable[Player.Name].Event = function()
			SIGNAL_EVENT.OnServerInvoke = function(Player, SignalType)
				if SignalType == "TweenPlaying" then
					BigTable[Player.Name].FinishedSignal = true
					BigTable[Player.Name].Debounce = true
				end
			end
		end
		
		repeat wait() until BigTable[Player.Name].FinishedSignal == true
		BigTable[Player.Name].FinishedSignal = false
		
		pcall(function()
			BigTable[Player.Name].Event = nil
		end)
		
		for _, ToolsAvailable in pairs(Player.Character:GetChildren()) do
			if ToolsAvailable:IsA("Tool") then
				BigTable[Player.Name].CurrentTool = ToolsAvailable
			end
		end
		
		BigTable[Player.Name].CurrentTool.Handle.Spinning.Disable = false
		
		BigTable[Player.Name].Event = BigTable[Player.Name].CurrentTool.Handle.Touched:Connect(function(hit)
			if hit.Parent:IsA("Model") then
				local PlayerReal = game.Players:GetPlayerFromCharacter(hit.Parent)
				
				if PlayerReal and PlayerReal.Name ~= Player.Name then
					if BigTable[PlayerReal.Name].HitDebounce == false then
						local Humanoid = hit.Parent.Humanoid
						
						BigTable[Player.Name].CurrentTarget = PlayerReal.Name
						BigTable[PlayerReal.Name].HitDebounce = true
						Humanoid:TakeDamage(30)
						
						delay(1, function()
							BigTable[PlayerReal.Name].HitDebounce = false
						end)
					end
				end
			end
		end)
		
		BigTable[Player.Name].Event = function()
			SIGNAL_EVENT.OnServerInvoke = function(Player, SignalType)
				if SignalType == "TweenFinished" then
					delay(2, function()
						BigTable[Player.Name].Debounce = false
						BigTable[Player.Name].Event = nil
						BigTable[Player.Name].CurrentTool.Handle.Spinning.Disable = true
						BigTable[Player.Name].CurrentTool.Handle = nil
						
						if BigTable[Player.Name].CurrentTarget ~= nil then
							local PlayerTargetObject = game.Players:FindFirstChild(BigTable[Player.Name].CurrentTarget)
						end
					end)
				end
			end
		end
	end
end

return module

and based on one of my topics here:
https://devforum.roblox.com/t/how-to-insert-an-table-into-an-table/812344/9

that anything you insert into an table will exist and not be null

Is there anyway to fix this issue or not?
Any Help is Appreciated Thanks!

That’s because you didn’t put the debounce in the BigTable

Ur table is like that:

local BigTable = {"nam1", "name2"} 

And see there is not debunce here

Its inserted not manually inserted

No It’s automatically not manually inserted

Wait is it actually true that debounce in inserted in all tables you make? If so then you can’t locate the debounce in the table that way since the table isn’t a dictionary

have you looked on the thread I gave on this topic?

I did but you can’t make add a dictionary member inside of a dictionary member since this isn’t json
I mean sure you can turn dictionaries into json but that’s used for httpRequest stuff not to make a working dictionary

but its needed for my coding tho :confused:

Then i don’t know how to fix it sorry

Is there still a way of getting this bug removed completely?
Or there is just none because I just can’t insert things into an dictionary for some reason

table.insert adds items into an array - it doesn’t add the item as an index.
Perhaps you meant to do the following?

BigTable[Player.Name] =
{
    Debounce = true,
    ...
};

EDIT

That’s how you’re doing it in your code though lol

You’re indexing the BigTable of the player’s name.

EDIT2
I’m going to expand upon what I stated earlier - table.insert adds a new item into an array, not set a new index as the item.

local Table = {};
for Count = 1, 10 do
    table.insert(Table, 1, Count); -- Adds a new item at index 1, moving existing items forward
end

for Count, Number in ipairs(Table) do
    print(Count, Number); -- 1 10, 2 9, 3 8, ...
end

To add a new index to a dictionary you have to set it as an index

local Table = {};
Table.Hello = "World!"; -- "Hello" being the index, and "World!" being the value it's set to

that adds more layers of tables though

Solved
By using this piece of snippet code

BigTable[Player.Name] = {}
1 Like