Overhead GUI Assistance

Hello! I’m having some troubles configuring my script to allow both a group rank and a VIP tag if they own the VIP game-pass. But even re-writing the code to slightly adjusting the VIP tag didn’t work at all. Even branching out through several forum posts I still couldn’t find a fix.

local id = 0000000

wait(1)
local plr = game.Players:FindFirstChild(script.Parent.Name)
local e = game.ReplicatedStorage.Rank:Clone()
e.Parent = script.Parent.Head
e.Frame.Name1.Text = script.Parent.Name
e.Frame.TextLabel.Text = plr:GetRoleInGroup(000000)

game.Players.PlayerAdded:Connect(function(player)
    if game:GetService("GamePassService"):PlayerHasPass(player, id) then 
        e.Frame.VIP.Visible = true
 		print(player.Name .. " Owns VIP Pass")
    else
		e.Frame.VIP.Visible = false
        print(player.Name .. " doesn't have the game pass...")
    end
end)

It’ll be greatly appreciated if anyone can help me find the error inside the script.

– 4w <3

2 Likes

I don’t know if this works, but check these items:

  • I think you need to set the adornee for the BillboardGui to the Head
  • I don’t think you should use the ‘else’ function
  • Possibly if those two don’t work either write another script for the BillBoard or just use coroutine.

Tell me if this helped :wink:

I am also working with him. Let me try this for you.

1 Like

Wow. That’s a suprising twist right there!

How So? Is something off about that?

Try this. If it doesn’t work lmk.

2 Likes

Well, you chatted in my previous post last time.

Does he need to set the adornee for the billboard?

I’ve re-written your code

local id = 0000000

wait(1)
local e = game.ReplicatedStorage:WaitForChild(“Rank”):Clone()
e.Parent = script.Parent.Head
e.Frame.Name1.Text = script.Parent.Name

game.Players.PlayerAdded:Connect(function(player)
e.Frame.TextLabel.Text = player:GetRoleInGroup(000000)
if game:GetService(“GamePassService”):PlayerHasPass(player, id) then
e.Frame.VIP.Visible = true
print(player.Name … " Owns VIP Pass")
else
e.Frame.VIP.Visible = false
print(player.Name … " doesn’t have the game pass…")
end
end)

If this one not working please let me know

This entire excerpt of code is a bit confusing in itself; as an overhead UI, it would be reset everytime the player respawns. So, assuming this piece of code is not within a serverscript, what you are probably doing is running this piece of code once the character is spawn. In this case, PlayerAdded may only be fired for every other player that enters the game besides that of the client. What you should be doing to handle an overhead UI is using the CharacterAdded event (preferably within a serverscript!). I’m not sure what exactly is going on within this code, but it is a bit convoluted and should be rewritten in a more organized fashion. What I’d do is handle the VIP gamepass when their character (or player initially) loads in, and change the properties of the VIP frame accordingly.

1 Like