Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Vxpper 101
5 years ago

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
0
multiplying by a decimal shortens the number User#19524 175 — 5y
0
How would i change the script to make it only add 20% to the number? Vxpper 101 — 5y
0
Instead of .20, do 1.20. Anything below 1 reduces the number ProtectoidZ 42 — 5y

1 answer

Log in to vote
0
Answered by
hellmatic 1523 Moderation Voter
5 years ago
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
0
Still not adding. Vxpper 101 — 5y
0
add this: print(player.leaderstats.Money.Value = player.leaderstats.Money.Value + player.CashCollected.Value) hellmatic 1523 — 5y
0
and this: print(player.leaderstats.Money.Value = player.leaderstats.Money.Value + player.CashCollected.Value * 1.2) hellmatic 1523 — 5y
0
to check if the value was increased/not hellmatic 1523 — 5y
View all comments (3 more)
0
it increases, but does not multiply by 1.2 Vxpper 101 — 5y
0
Are you using an IntValue? ProtectoidZ 42 — 5y
0
Yeah Vxpper 101 — 5y
Ad

Answer this question