I made a gamepass that gives the player 1500 points when joining but when i test it it stays at 500 points and doesn't give me a error or anything
local MarketplaceService = game:GetService("MarketplaceService")
function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local score = Instance.new("IntValue")
score.Name = "Points"
score.Value = 500
score.Parent = stats
stats.Parent = newPlayer
if MarketplaceService:PlayerOwnsAsset(newPlayer, 15884145) then
score.Value = 1500
end
while true do
wait(60)
score.Value = score.Value + 15
end
end
game.Players.ChildAdded:connect(onPlayerEntered)

3 comments
I made a mistake on else if not hasPass statement, it should be "else".
:connect is just a deprecated version of :Connect
:connect still works