Im trying to make a script that gives a regular player 10 dollars every 3 seconds, and a player with a specific gamepass 20 dollars every 3 seconds. I have written up a script that doesnt seem to work and I'd like some assistance. It doesnt seem to give anyone money at all.
print("2X Money Activated")
local MarketplaceService = game:GetService("MarketplaceService")
local gamePassID = 5068130
function onPlayerEntered(newPlayer)
local money = newPlayer.BRB
if MarketplaceService:UserOwnsGamePassAsync(newPlayer.UserId, gamePassID) then
wait(3)
money.Value = money.Value + 20 else
money.Value = money.Value + 10
end
end
game.Players.ChildAdded:connect(onPlayerEntered)

2 comments
Sorry for the indentation
Thank you