When I touch the part, it does nothing and I don't know why.
Here is the script:
local MarketplaceService = game:GetService("MarketplaceService")
local gamepassId = 16463231
script.Parent.Touched:Connect(function(player)
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassId) then
-- Double Coins
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 16
else
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 8
end
player.Character.Humanoid.MaxHealth = 0 -- Respawn player after they collect their cash
end)
