Nametag Gamepass Script not working?

So I made a custom nametag but wasn’t able to get the nametag text colour to change.

The issue is whenever I start up the game, the nametag itself works, but
the gamepass part doesn’t change the text colour. There are no warnings or errors of whatsoever.

I looked around and couldn't find away around this, perhaps somebody can help me?

Here is a picture of the nametag

This is the code for the gamepass.

--

local plr = game.Players.LocalPlayer
local change = script.Parent
--local gamepassID = 7384823

local PlayerID = plr.UserId

wait(.5)

change.Text = plr.Name

--GamePass--


local gamepassId = 7384823
local service = game:GetService("MarketplaceService")
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local Priority = script.Parent

Players.PlayerAdded:Connect(function(Player)
	if MarketplaceService:UserOwnsGamePassAsync(Player.UserId,7384823) then
		Priority.TextColor3.new = {255, 255, 255}
	end
end)

3 Likes
Priority.TextColor3 = Color3.fromRGB(255, 255, 255)
2 Likes

Just tested it, doesn’t seem to work.

Try debugging it by adding print statements for each line.

Ok, so this part doesn’t work.

Players.PlayerAdded:Connect(function(Player)
	print("PlayerAddedFunction")
	if MarketplaceService:UserOwnsGamePassAsync(Player.UserId,7384823) then
		print("GamePassSearch")
		Priority.TextColor3 = Color3.fromRGB(255, 255, 255)
		print("Color should change?")
	end
end)

Try:

Priority.TextColor3 = Color3.new(255, 255, 255)

I think it’s because this is in a local script. Put it in a server script, otherwise remove PlayerAdded

1 Like

Thank you so much, it wasn’t working because of PlayerAdded!

1 Like