New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

VIP Player Billboard wont work?

Asked by
ABK2017 392 Moderation Voter
1 year ago

I'm sure I'm missing something, but I'm not sure what it is.....Here's what I have so far... If I take out the "MarketplaceService", the script works fine, but obviously gives it to everyone. Thanks.

game.Players.PlayerAdded:connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)
        wait(1)

    local allow = (
        game:GetService('MarketplaceService'):UserOwnsGamePassAsync(player.userId, 1234567) 
    )

    if allow then
        local gui=Instance.new("BillboardGui")
        gui.Parent=newPlayer.Character.Head
        gui.Adornee=newPlayer.Character.Head
        gui.Size=UDim2.new(3,0,4,0) 
        gui.StudsOffset=Vector3.new(0,1,0)
        local name=Instance.new("TextLabel")
        name.Parent = gui
        name.BackgroundTransparency = 1
        name.Text = "VIP"  
        name.Size = UDim2.new(1,0,1,0)
        name.Position=UDim2.new(0,0,-0.81,0)
        name.TextColor3=Color3.new(255,255,255)
        name.FontSize = "Size18"
        end
end
function onPlayerEntered(newPlayer)
    newPlayer.Changed:connect(function (property)
        if (property == "Character") then
            onPlayerRespawned(newPlayer)
        end
    end)
end

game.Players.PlayerAdded:connect(onPlayerEntered)

1 answer

Log in to vote
-1
Answered by
MAKKU 27
1 year ago
game.Players.PlayerAdded:connect(function(player)


    local allow = (
        game:GetService('MarketplaceService'):UserOwnsGamePassAsync(player.UserId, 1) 
    )

    if allow then
        local gui=Instance.new("BillboardGui")
        gui.Parent=player.Character.Head
        gui.Adornee=player.Character.Head
        gui.Size=UDim2.new(3,0,4,0) 
        gui.StudsOffset=Vector3.new(0,1,0)
        local name=Instance.new("TextLabel")
        name.Parent = gui
        name.BackgroundTransparency = 1
        name.Text = "VIP"  
        name.Size = UDim2.new(1,0,1,0)
        name.Position=UDim2.new(0,0,-0.81,0)
        name.TextColor3=Color3.new(255,255,255)
        name.FontSize = "Size18"
        end
end)
0
Thank you ABK2017 392 — 1y
Ad

Answer this question