Inserting numbers into a table

I have a table called “playerData.ActiveBoosts”. In that table, there are boosts that are added into the table once a player uses said boost, and I want to add in a countdown (1800 seconds) into the boost. And this does not work.

Code that inserts boost/error/the table itself:

image

image

image

you could try having the key value pairs in the ActiveBoosts table being the boost/cooldown, which you could do like this:

playerData.ActiveBoosts[boost] = 1800

This would make the structure of the ActiveBoosts table look like:

{
["KeybugToken"] = 1800,
...
}
1 Like

You’re trying to index the table with the value you just inserted into it. Try doing:

table.insert(table.find(playerData.ActiveBoosts[boost]), 1800)

I would recommend the above method however.

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