Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Can I get help with a VIP Overhead Gui Gamepass?

Asked by 5 years ago
Edited 5 years ago

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
Shoot I really messed that up! DaSonicRules 13 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

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.

1
Thank you very much! DaSonicRules 13 — 5y
0
Don't forget to mark it as answered. kees31ALT 5 — 5y
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 User#19524 175 — 5y
Ad

Answer this question