So… I have a gamepass handler that handles every gamepass.
local marketPlaceService = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(player)
local folder = Instance.new("Folder",player)
folder.Name = "Gamepasses"
local cashMultiplier = Instance.new("NumberValue",folder)
cashMultiplier.Name = "Cash"
if marketPlaceService:UserOwnsGamePassAsync(player.UserId, 8349933) then
cashMultiplier.Value = cashMultiplier.Value + 2
end
local crystalsMultiplier = Instance.new("NumberValue",folder)
crystalsMultiplier.Name = "Crystals"
if marketPlaceService:UserOwnsGamePassAsync(player.UserId, 8583196) then
crystalsMultiplier.Value = crystalsMultiplier.Value + 2
end
local cocoaMultiplier = Instance.new("NumberValue",folder)
cocoaMultiplier.Name = "Cocoa"
if marketPlaceService:UserOwnsGamePassAsync(player.UserId, 8628892) then
cocoaMultiplier.Value = cocoaMultiplier.Value + 2
end
local xpMultiplier = Instance.new("NumberValue",folder)
xpMultiplier.Name = "XP"
if marketPlaceService:UserOwnsGamePassAsync(player.UserId, 8583218) then
xpMultiplier.Value = xpMultiplier.Value + 2
end
if marketPlaceService:UserOwnsGamePassAsync(player.UserId, 8628910) then
xpMultiplier.Value = xpMultiplier.Value + 2
cashMultiplier.Value = cashMultiplier.Value + 2
cocoaMultiplier.Value = cocoaMultiplier.Value + 2
crystalsMultiplier.Value = crystalsMultiplier.Value + 2
end
local autoCollectCash = Instance.new("BoolValue",folder)
autoCollectCash.Name = "Auto Collect Cash"
if marketPlaceService:UserOwnsGamePassAsync(player.UserId, 8583215) then
autoCollectCash.Value = true
end
end)
So if the player owns a gamepass, the value goes up by 2. I just realized that if the player doesn’t own the gamepass the values default to 0.
How would I make the values stack? For example: 2x goes to 4x, 4x to 6x, etc. There is a stat bundle and if you own both gamepasses, 2x Cash would go to 4x Cash.