hello, or even hello again for some I'm still a beginner for the LUA script, I know a few tricks but I don't know how to do it, so I'm here to ask you for a little help.
local function ChangeClothes(char, shirtid, pantsid)
local shirt = char:FindFirstChildOfClass"Shirt" or Instance.new("Shirt", char)
local pants = char:FindFirstChildOfClass"Pants" or Instance.new("Pants", char)
shirt.ShirtTemplate = shirtid
pants.PantsTemplate = pantsid
end
local remote = game.ReplicatedStorage.TeamChange
LVL2 = game.ReplicatedStorage["[SCP] Card-L2"]
LVL4 = game.ReplicatedStorage["[SCP] Card-L4"]
LVL3 = game.ReplicatedStorage["[SCP] Card-L3"]
Flashlight = game.ReplicatedStorage.Flashlight
function remote.OnServerInvoke(player, TeamName)
player.TeamColor = BrickColor.new(TeamName) -- Team Change
if player.TeamColor == BrickColor.new("New Yeller") then -- Searcher LVL 2
player:LoadCharacter()
local char = player.Character or player.CharacterAdded:Wait()
ChangeClothes(char, "rbxassetid://334887799", "rbxassetid://359977613") --replace with your desired ids
LVL2:Clone().Parent = game.Players[player.Name].Backpack
Flashlight:Clone().Parent = game.Players[player.Name].Backpack
-- I WANT ADD THE SCRIPT PART HERE :D
I had already asked for the change of clothes but it was only just after I realized that I had to wear hats. lol
thanks you :)

3 comments
You can use a loop to remove accessories and use InsertService to insert a hat from ROBLOX's catalog into the player's character.
Get the player's hat by using :IsA("Hat") then :Destroy() and Instance.new("Accessory",Character) also Character.DescendantAdded:Connect() as well as :IsAncestorOf("Hat")
how can i put it in my script ? (im a big noob with LUA ^^)