I have a script that's supposed to give you 500 points when you join if you have a gamepass, and 1000 points when you join if you have another or both.
game.Players.PlayerAdded:connect(function(plr) local p = Instance.new('IntValue',plr) p.Name = 'Points' if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,252253525 --[[ 500 points ]]) then if not game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,252255271) then p.Value = 500 end elseif game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,252255271 --[[ 1000 points ]]) then p.Value = 1000 else p.Value = 0 end end)
The thing is I get 0 points when I join and I have both. There are no errors either.
I'm also new to gamepasses and MarketplaceService
You have the right idea but how you're doing this is probably messing it up. Try just checking if they have the 1000, if they don't then check if they have the 500, if not then give them 0
MarketplaceService
If you do this, you won't have to type out game:GetService('MarketplaceService')
so many times
This is just for organization
If you're expecting a leaderboard setup, you need to have a 'leaderstats' value in the player, and any stats as direct descendants if that value. This is completely up to you though.
local ms = game:GetService('MarketplaceService') local passes = { Thousand = 252255271, Hundred = 252253525 } game.Players.PlayerAdded:connect(function(plr) local p = Instance.new('IntValue',plr) p.Name = 'Points' if ms:PlayerOwnsAsset(plr,passes.Thousand) then --1000 p.Value = 1000 elseif ms:PlayerOwnsAsset(plr,passes.Hundred) --500 p.Value = 500 else --0 p.Value = 0 end end)