game.Players.PlayerAdded:Connect(function(plr) if game.MarketplaceService:PlayerOwnsAsset(plr, 5397071) then print("Success, player has asset.") else print("Player doesn't own this asset.") end end)
Problem is it prints "Player doesn't own this asset" even when a player does have an asset. I made sure ID is correct. (Do not check what is there :P)
PlayerOwnsAsset()
not work, you need to use UserOwnsGamePassAsync()
Wiki: Roblox Wiki Page - UserOwnsGamePassAsync()
You can use this script:
local id = 5397071 -- Id of your gamepass game:GetService("Players").PlayerAdded:Connect(function(plr) print(plr.Name .. " joined") if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,id) then print("Success, player has asset.") else print("Player doesn't own this asset.") end end)
Hope it helped!
Weird thing, if I type:
roblox.com/game-pass/5397071
is not equal to roblox.com/catalog/5397071
,
it's different things! In 1 there is some awful shirt, in 1 my gamepass. Weird. Anyways, I must check it.