:UserOwnsGamepassAsync not working?

I need help with my overhead GUI!

  1. What do you want to achieve? I want to give a person who purchases my VIP game-pass to get a overhead GUI.

  2. What is the issue? I am getting an error saying 'UserOwnsGamepassAsync is not a valid member of MarketplaceService “MarketplaceService” ’

  3. What solutions have you tried so far? I have looked all over the Dev Forums, and the Dev Hub.

local bbg = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
local GamepassId = 30880118
 
game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		
		--[[if plr.Name == "jahoobas" then
			local clonedgui = bbg:Clone()
			clonedgui.TextLabel.Text = "Developer"
			clonedgui.Parent = game.Workspace:WaitForChild(plr.name).Head
		end]]
		if plr.Name == "skelezzzz" then
			local clonedgui = bbg:Clone()
			clonedgui.TextLabel.TextColor3 = Color3.fromRGB(180,170,50)
			clonedgui.TextLabel.Text = "Streamer"
			clonedgui.Parent = game.Workspace:WaitForChild(plr.name).Head
		end
		if game:GetService("MarketplaceService"):UserOwnsGamepassAsync(plr.UserId, GamepassId) then
			local clonedgui = bbg:Clone()
			clonedgui.TextLabel.TextColor3 = Color3.fromRGB(180,170,50)
			clonedgui.TextLabel.Text = "VIP"
			clonedgui.Parent = game.Workspace:WaitForChild(plr.name).Head
		end
	end)
end)

Help is appreciated!

I commented the developer part for testing the VIP GUI.

spelling error with UserOwnsGamePassAsync the P in GamePass

Edit: the capitalization gets me as well

Thank you, did not notice! I’ll use this in my game.

1 Like

Weird. The prompt that shows up when you type it it shows “UserOwnsGamePassAsync” and I have a separate game that still works when you use “UserOwnsGamePassAsync”.

sometimes roblox intellisense doesnt work for who knows what reason so you type it out on your own.

then you mess-up capitalization

1 Like