#working on a game

4 messages · Page 1 of 1 (latest)

hollow cliff
#

struggling with the 2x gamepasses, got some code written, but it doesnt seem to work.

#
local marketplaceService = game:GetService("MarketplaceService")

local gamepassID = 96627364

players.PlayerAdded:Connect(function(player)
    local gamepassValue = Instance.new("IntValue")
    gamepassValue.Name = "2x Coins"
    gamepassValue.Value = 1
    gamepassValue.Parent = player
    if marketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassID) then
        gamepassValue.Value = 2
    end
end)```
#

that is in my 2x coins script

#
    player.leaderstats.coins.Value += (1 * player:FindFirstChild("2x Coins").Value)
end```