UserOwnsGamepassAsync returns false even though i own the gamepass

I have looked for help everywhere, but i cannot find it. I might just be dumb, but i can’t figure this out for the life of me!
Here is the code(in a server script)

local Players = game:GetService("Players")
 local MarketPlaceService = game:GetService("MarketplaceService")
 local GamepassID = 15740874696
 local ToolName = "Gravity Coil"

 Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
 		if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then
 			script[ToolName]:Clone().Parent = player.Backpack
 		end
 	end)
end)

Is the Gamepass ID correct? I tried it but it redirects me to an 404 page. (here)

Also you could move the topic to #help-and-feedback:scripting-support instead of #help-and-feedback:platformusagesupport .

You are right! i used the asset ID instead of the GamepassID. Thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.