Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can I get help with a VIP Overhead Gui Gamepass?

Hi guys I've been busy with this problem almost all day I try that when people buy the gamepass they get the VIP Gui over they're head but there was no error in the output and it does not work(I put my BillboardGui in ServerStorage) maybe you can solve it this is the code: ~~~~~~~~~~~~~~~~~ local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")

game.Players.PlayerAdded:Connect(function(player)

player.CharacterAdded:Connect(function(character)
	
	if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,4785721) then
		local clonedgui = billboardgui:Clone()
		clonedgui.TextLabel.Text = "VIP"
		clonedgui.TextLabel.TextColor3 = Color3.fromRGB(239,184,56)
		clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head	
	end
end)

end)

Sorry about the lua I just signed in!

1 comment

1

Shoot I really messed that up!

1 answer

✓ Accepted answer

###You shouldn’t be using MarketplaceService:PlayerOwnsAsset() to check if a player owns a game pass. You should be using UserOwnsGamePassAsync.

local market = game:GetService"MarketplaceService"

game:GetService("Players").PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        if market:UserOwnsGamePassAsync(plr.UserId, 4785721) then
            
        end
    end)
end)

###That should work.

3 comments

1

Thank you very much!

0

Don't forget to mark it as answered.

0

it’s okay for op not to. i don’t need reputation. i just want the askers of the site to have their questions helped. but it’s too late rn :v

This discussion is preserved as it was. New answers, comments, and votes are closed.