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 :)
function REMOVE_HATS() for _, v in pairs(char:GetChildren()) do if v:IsA('Accessory') then v:Destroy() end end end local InsertService = game:GetService('InsertService') function INSERT_HAT(hatid) local model = InsertService:LoadAssest(hatid) for _, v in pairs(model:GetChildren()) do if v:IsA('Accessory') then v.Parent = char model:Destroy() -- destroy model container end end end
Do this: char.Humanoid:RemoveAccessories()
For the adding accessories, use char.Humanoid:AddAccessory()
I presume you would have to format it like this:
local NewAccessory = Instance.new("Accessory") local Handle = Instance.new("Part") -- create the visible hat Handle.Name = "Handle" -- REQUIRED Handle.Parent = NewAccessory local Mesh = Instance.new("Mesh") -- If you're not making a brick hat -- Mesh.Texture = (whichever) Mesh.Parent = Handle local Attachment = Instance.new("Attachment") Attachment.Parent = Handle -- and so forth local Weld = Instance.new("ManualWeld") Weld.Part0 = Handle -- Weld.Part1 == blank Weld.Parent = Handle -- And so forth on char.Humanoid:AddAccessory(NewAccessory)
If they don't work, then my apologies; I never actually have used this code before.
I don't know what to do anymore, here is the whole script, basically what I want to do is that as soon as the player joins the team, all his hats are removed and a hat with the meshid "http://www.roblox.com/asset/?id=112643970" and the texture "http://www.roblox.com/asset/?id=112644004" I've never written this kind of thing yet (it's the beginning) sorry for bad english ^^ (french)
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 elseif player.TeamColor == BrickColor.new("Deep orange") then -- Searcher LVL 4 player:LoadCharacter() local char = player.Character or player.CharacterAdded:Wait() ChangeClothes(char, "rbxassetid://519722780", "rbxassetid://519722963") LVL4:Clone().Parent = game.Players[player.Name].Backpack Flashlight:Clone().Parent = game.Players[player.Name].Backpack -- Class D elseif player.TeamColor == BrickColor.new("Gold") then player:LoadCharacter() local char = player.Character or player.CharacterAdded:Wait() ChangeClothes(char, "rbxassetid://303911572", "rbxassetid://303911192") elseif player.TeamColor == BrickColor.new("Cyan") then -- SCP Guard player:LoadCharacter() local char = player.Character or player.CharacterAdded:Wait() ChangeClothes(char, "rbxassetid://519722780", "rbxassetid://519722963") LVL3:Clone().Parent = game.Players[player.Name].Backpack end end