How do you add a table into a table?

I’m making an assist system that gives a percentage of a reward to a player depending on how much damage they have done. I want to know how I can add a table that has the player name and then the amount of damage they have done and add it to another existing table.

Example:

Player = {}

table.insert({Player1,69})

but it doesn’t work so im not sure how to do it.

It’s actually very simple, this example is very explicit to certain case where the main table contains each entry per player, which values are tables.

local Players = {aRandomNoob = {}}
table.insert(Players["aRandomNoob"], 1337) -- lol

but i dont know who the player is or the amount of players that will damage the npc

Let’s say there’s a signal that is detecting the damage outputs. Once you have that detected, usually you would know who dealt damage. It looks like you can do this:

  • The main table holds all players indicating how much damage was dealt to them
  • The subtables will contain keys related to attackers and values to their respective damage

I’m a little tired, I’ll check back tomorrow if you still haven’t figured it out.

gotcha eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

how would ytou add the players to the main table