Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

If a player has a gamepass, player does not receive +20%, why?

This is my code:

(Ends and variables are defined in my script)

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id) then
			player.leaderstats.Money.Value = player.leaderstats.Money.Value + player.CashCollected.Value * .20

3 comments

0

multiplying by a decimal shortens the number

0

How would i change the script to make it only add 20% to the number?

0

Instead of .20, do 1.20. Anything below 1 reduces the number

1 answer

✓ Accepted answer
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id) then
            player.leaderstats.Money.Value = player.leaderstats.Money.Value + player.CashCollected.Value * 1.2 -- 1 represents 100% of the original value + .2 (the .20 you tried multiplying) adding 20% more based off the players current cash
end

7 comments

0

Still not adding.

0

add this: print(player.leaderstats.Money.Value = player.leaderstats.Money.Value + player.CashCollected.Value)

0

and this: print(player.leaderstats.Money.Value = player.leaderstats.Money.Value + player.CashCollected.Value * 1.2)

0

to check if the value was increased/not

0

it increases, but does not multiply by 1.2

0

Are you using an IntValue?

0

Yeah

This discussion is preserved as it was. New answers, comments, and votes are closed.