Tag script working on developer only

So i made a Tag command and it just doesnt work.
PLACES
image
SCRIPTS
TagModule

local Data = {
	["Colors"] = {
		red = Color3.fromRGB(255, 0, 0);
		green = Color3.fromRGB(0, 255, 0);
		blue = Color3.fromRGB(0, 179, 255);
		yellow = Color3.fromRGB(255, 255, 0);
		orange = Color3.fromRGB(255, 140, 0);
		white = Color3.fromRGB(255, 255, 255);
		purple = Color3.fromRGB(187, 0, 255);
		RED = Color3.fromRGB(100, 0, 0);
		GREEN = Color3.fromRGB(0, 100, 0);
		BLUE = Color3.fromRGB(0, 72, 100);
		YELLOW = Color3.fromRGB(100, 100, 0);
		ORANGE = Color3.fromRGB(100, 53, 0);
		WHITE = Color3.fromRGB(100, 100, 100);
		PURPLE = Color3.fromRGB(73, 0, 100);
	},
	["Models"] = {
		Tag = script.Tag;
	}
}

return Data

Command

local Moderators = {"Fik0sz_Master"}
local Data = require(script.Parent)

game.Players.PlayerAdded:Connect(function(Player)
	if table.find(Moderators,Player.Name) then
		Player.Chatted:Connect(function(Message)
			local Cmds = Message:split(" ")
			if Cmds[1]:lower() == "/tag" then
				if game.Players[Cmds[2]] then
					local tag = Data.Models["Tag"]:Clone()
					local color: Color3 = Data.Colors[Cmds[4]:lower()]
					local text = Cmds[3]
					tag.TXT.Text = text
					tag.TXT.UIGradient.Color = ColorSequence.new(Data.Colors[Cmds[4]:upper()],Color3.fromRGB(0,0,0))
					tag.TXT.UIStroke.UIGradient.Color = ColorSequence.new(color,color)
					if game.Players[Cmds[2]].Character.Head:FindFirstChild("Tag") then
						game.Players[Cmds[2]].Character.Head:FindFirstChild("Tag"):Destroy()
					end
					wait(0)
					tag.Parent = game.Players[Cmds[2]].Character.Head
					tag.Adornee = game.Players[Cmds[2]].Character.Head
				end
			end
		end)
	end
end)

ERRORS
Absolutely nothing.
NOTE: It works, but only on me. when i test it on others it doesnt give errors and doesnt show up above the players head.

Early thanks
~Fikusz Master

local Moderators = {"Fik0sz_Master"} and if table.find(Moderators,Player.Name) then or what?

Should i replace it with if Player.Name == "Fik0sz_Master" then ?

This means who the /tag command will only work for those who are in the Moderators table. Or what exactly is not working for you?

In my experience, you shouldn’t reference the “tag-holders” by their username, but instead do it by their userId. Something like:

local moderators = {2685960374}

-- When checking if a player is a moderator:
game.Players.PlayerAdded:Connect(function(player)
    for _, userId in moderators do
        if player.UserId == userId then
            -- Give them their tag
        end
    end
end

The reason I do it this way is because your UserId is something that will never change, unlike your username.

Thats why i made it like that, so only mods can use /Tag.
i want to achieve that when i say SOMEONE ELSES NAME it shows up above their head.
The tag only shows up above my head.

Its still not the solution :frowning: . the problem is with the tag only showing up if i want it above MY head.

That is if you enter /tag 3YbuKtOp Mod, it will not appear above the player’s head?

no it wont even if i put the color there like /tag 3YbuKtOp Mod green

Perhaps you are not entering the correct nickname? since you need to enter it exactly

I did that. Even with my alt it just doesnt work

Here you can see me with the tag i gave myself
image
i know i look so cool lol
If i want to give someone else this tag it wouldnt show up above them.

1 Like

I have ONE idea what could be the problem.
Maybe cuz its in workspace. Ima put it in SSS and see what it does.

Attempt to use if game.Players:FindFirstChild(Cmds[2]) then, idk

Is it because you are setting the parent of the tag to a player’s head and then destroying it? Try destroying it before you set the Parent of the tag to the player’s head.

1 Like

Oh okk il try that! also SSS didnt change it

1 Like

And how then it works in his screenshot, I don’t understand what

I take that back, turns out you have both uppercase and lowercase colors in the table.

He has both lower and upper letters

local Data = {
	["Colors"] = {
		red = Color3.fromRGB(255, 0, 0);
		green = Color3.fromRGB(0, 255, 0);
		blue = Color3.fromRGB(0, 179, 255);
		yellow = Color3.fromRGB(255, 255, 0);
		orange = Color3.fromRGB(255, 140, 0);
		white = Color3.fromRGB(255, 255, 255);
		purple = Color3.fromRGB(187, 0, 255);
		RED = Color3.fromRGB(100, 0, 0);
		GREEN = Color3.fromRGB(0, 100, 0);
		BLUE = Color3.fromRGB(0, 72, 100);
		YELLOW = Color3.fromRGB(100, 100, 0);
		ORANGE = Color3.fromRGB(100, 53, 0);
		WHITE = Color3.fromRGB(100, 100, 100);
		PURPLE = Color3.fromRGB(73, 0, 100);
	},
	["Models"] = {
		Tag = script.Tag;
	}
}

return Data

Changed it to destroy before setting parent; It worked!!!
image
Me and a random guy with tags
TYSMM
<333

1 Like