Prevent Exploiters With Remote Events

I’m sorry, but I’m now kinda confused.

Oh actually? My bad wasn’t aware hahaha

For some reason I thought it did due to a recent test I did but I was probably wrong, thanks for the clearup though mate

what are you confused with? Explain in details what you’re trying to achieve etc.

I’m confused with the tables and how I would do that, sorry, I’m not very known with tables.

Basically what you do is for every coin have a key in a table thats the coin for example the table structure will look like this:

{
  [workspace.Coins.Coin1] = {},
  [workspace.Coins.Coin2] = {},
  [workspace.Coins.Coin3] = {}
}

And the value will be the list of players, for example

{
  [workspace.Coins.Coin1] = {
    game.Players.IggyDev,
    game.Players.LukaGaming_07
  }
}

and check it like this

if not table.find(CoinTable[coin], player) then
  -- give the coin
  table.insert(CoinTable[coin], player)
end

(replace coin with the coin object and player with the player object)
What the if statement is doing is

  1. Go to the coin key in the CoinTable table
  2. Is the player already in that list?
  3. No? Give the player the coin and add the player to the list
2 Likes

Using table.insert You can insert parts and such into that table using arrays I believe. using a for loop into that table or the number amount of the table you can basically get every single item inside that table. It’s useful because it’ll make it easier for you to get

edit: it’ll also stop u from manually having to add stuff because it’ll do it all for u

Thanks to everyone who responded, now I know how!

You should automatically add the coins to the table