Problems With X2 Coins GamePass

so I’m making a gamepass which allows you to have 2 times the amount of coins you get when you win a round, but for some reason I do not know how to script it properly. I have tried using various method including bindable function but still no success, can somebody tell me what I have done wrong here? It will be greatly appreaciated.

Checking if person have gamepass

Giving out reward

Am a new scripter so please don’t judge if my coding here is complete rubbish

Predifine a tbl named PlayerRewards.

Whenever the player joins, first check if they have the gamepass, if yes then set the players reward as 200 inside the tbl.

PlayerRewards[player] = 200

Else just set it to 100.

Then in your victory royale function, add the shards value with PlayerRewards[plrs[1]].

Also, is this a server script?

yes this is a server script,

and also after your suggestion it now pops a error saying “cannot perform arithmatic (add) on number and nil”

where is the error coming from?

What is inside plrs[1]? A Player instance?

plrs is a table that puts together all the people in the game in one table, the [1] stands for the last person in the game left

Yes,I understand but wt r the values u input in the table?

unfortunately your method still didn’t work

I just told my cousin about this problem and he helped me figure out this problem, but thanks for trying to help me out!