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.
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.