Hey there,
I've got this script that checks if a player owns the gamepass then would pass the code, But if you buy the gamepass while in-game it would not give the correct coins until they rejoin?
Is there a simple way to check if they bought it?
Script:
local MarketplaceService = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(player)
local amount = 2
local timedelay = 5
local currencyname = "Coins"
local gamepassId = 14144444
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,gamepassId) then
while true do
wait(timedelay)
player.leaderstats[currencyname].Value = player.leaderstats[currencyname].Value + amount*2
end
else
while true do
wait(timedelay)
player.leaderstats[currencyname].Value = player.leaderstats[currencyname].Value + amount
end
end
end)
Thank you,

2 comments
Worked, Thanks alot!
happy to help