It's sort of hard to explain. What I mean is, if I want to detect if someone's wearing a hat when they enter a game, the script will know it's that hat. I have the script done, but each time I want to know the name of the hat, I have to keep entering the game, checking what the player is wearing and then copy letter by letter. For example:
local hat = hit.Parent:FindFirstChild("SnipersVisor")
If I put Snipers Visor, it wouldn't work. And I wouldn't know that it would be together. So does anyone know where I could get the name?
Here this should work.
-- ServerScript. local PLAYERS = game:GetService("Players") PLAYERS.PlayerAdded:connect(function(Plr) Plr.CharacterAppearanceLoaded:connect(function(Char) for i, v in pairs(Char:GetChildren()) do if v:IsA("Hat") then -- Do whatever you want here. end end) end) end)