SkabaYay
(SkabaYay)
August 11, 2022, 7:18am
#1
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
Mystxry12
(Mystxry)
August 11, 2022, 7:21am
#2
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?
SkabaYay
(SkabaYay)
August 11, 2022, 7:26am
#3
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”
GlitchedAli
(AltOfalirobloxerpro)
August 11, 2022, 7:27am
#4
where is the error coming from?
Mystxry12
(Mystxry)
August 11, 2022, 7:27am
#5
What is inside plrs[1]? A Player
instance?
SkabaYay
(SkabaYay)
August 11, 2022, 7:28am
#6
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
Mystxry12
(Mystxry)
August 11, 2022, 7:29am
#7
Yes,I understand but wt r the values u input in the table?
SkabaYay
(SkabaYay)
August 11, 2022, 7:40am
#10
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!