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

Why does my Overhead Gamepass script not work?

Asked by 4 years ago
Edited 4 years ago

I have a script where it gives an overhead UI. There are 2 versions of it, one that has a rainbow color and the other that is normal. I am trying to check to see if the player has the game pass and give them the rainbow color one. The code will not give me a rainbow. The weird thing is, when I change the ID to a different gamepass I own, it works. The way I get the gamepass is by going to the gamepass page and right-clicking "View Source" and find the "data-item-id" code.

Here is the code:



game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:connect(function() if game:GetService("MarketplaceService"):PlayerOwnsAsset(Player,4879950087) then local Tag = script.BHG:Clone() Tag.Parent = Player.Character Tag.Adornee = Player.Character:WaitForChild("Head") Tag.Frame.Rank.Text = Player:GetRoleInGroup(2973368) Tag.Frame.User.Text = Player.Name else local Tag = script.BH:Clone() Tag.Parent = Player.Character Tag.Adornee = Player.Character:WaitForChild("Head") Tag.Frame.Rank.Text = Player:GetRoleInGroup(2973368) Tag.Frame.User.Text = Player.Name end end) end)

Any help will be appreciated.

Answer this question