Need help with a Nametag system

I’ve made a nametag system for my group and as a VIP gamepass owner, or as a Roblox Premium member, you should get an exclusive tag (ImageLabel) to show up at the top of your name. Although when I join in game, only the first “if” which is the rainbow name, works.

So far, I tried to add elseif for each except the first if, but it didn’t work.

The script is in StarterCharacterScripts.

local character = script.Parent
local nametag = script:FindFirstChild("nametag")
local group = 14650412
local plr = game.Players:GetPlayerFromCharacter(character)

local tag = nametag:Clone()
local name = tag.Frame.username
local rank = tag.Frame.rank
local special = tag.Frame.tags

tag.Parent = character:FindFirstChild("Head")
tag.Adornee = character:FindFirstChild("Head")

name.Text = character.Name
rank.Text = game.Players:GetPlayerFromCharacter(character):GetRoleInGroup(group)

if character.Name == "anvoids" or "iqoaliz" then
	while true do
		name.TextColor3 = Color3.new(255/255,0/255,0/255)
		for i = 0,255,10 do
			wait()
			name.TextColor3 = Color3.new(255/255,i/255,0/255)
		end
		for i = 255,0,-10 do
			wait()
			name.TextColor3 = Color3.new(i/255,255/255,0/255)
		end
		for i = 0,255,10 do
			wait()
			name.TextColor3 = Color3.new(0/255,255/255,i/255)
		end
		for i = 255,0,-10 do
			wait()
			name.TextColor3 = Color3.new(0/255,i/255,255/255)
		end
		for i = 0,255,10 do
			wait()
			name.TextColor3 = Color3.new(i/255,0/255,255/255)
		end
		for i = 255,0,-10 do
			wait()
			name.TextColor3 = Color3.new(255/255,0/255,i/255)
		end
	end
end

if plr.MembershipType == Enum.MembershipType.Premium then
		special.premium.Visible = true
end		

if character.Name == "anvoids" then
	tag.Frame.tags.booster.Visible = true
end

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.userId, 41776708) then
	special.vip.Visible = true
			end

Any help is appreciated.

2 Likes

Add MarketPlaceService Check if they own the Gamepass or have the rank instead of names

Question: Why are you trying to do with TextColor?

The TextColor part is for the rainbow name tag. And the MarketplaceService has already been added.

@anvoids

local character = script.Parent
local nametag = script:FindFirstChild("nametag")
local group = 14650412
local plr = game.Players:GetPlayerFromCharacter(character)

local tag = nametag:Clone()
local name = tag.Frame.username
local rank = tag.Frame.rank
local special = tag.Frame.tags

tag.Parent = character:FindFirstChild("Head")
tag.Adornee = character:FindFirstChild("Head")

name.Text = character.Name
rank.Text = game.Players:GetPlayerFromCharacter(character):GetRoleInGroup(group)

if plr.MembershipType == Enum.MembershipType.Premium then
	special.premium.Visible = true
	print("Premium")
end		

if character.Name == "anvoids" then
	tag.Frame.tags.booster.Visible = true
	print(character.Name)
end

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.userId, 41776708) then
	special.vip.Visible = true
	print("Vip")
end

if character.Name == "anvoids" or "iqoaliz" then
	while true do
		name.TextColor3 = Color3.new(255/255,0/255,0/255)
		for i = 0,255,10 do
			wait()
			name.TextColor3 = Color3.new(255/255,i/255,0/255)
		end
		for i = 255,0,-10 do
			wait()
			name.TextColor3 = Color3.new(i/255,255/255,0/255)
		end
		for i = 0,255,10 do
			wait()
			name.TextColor3 = Color3.new(0/255,255/255,i/255)
		end
		for i = 255,0,-10 do
			wait()
			name.TextColor3 = Color3.new(0/255,i/255,255/255)
		end
		for i = 0,255,10 do
			wait()
			name.TextColor3 = Color3.new(i/255,0/255,255/255)
		end
		for i = 255,0,-10 do
			wait()
			name.TextColor3 = Color3.new(255/255,0/255,i/255)
		end
	end
end

I found the issue, I needed to add task.wait() before while true do

Why is this in a local script if you want everyone on the server to see the tag?

It’s not a LocalScript, it’s a Script inside of StarterCharacterScripts.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.