I have a simple team change script that also changes the clothes but always changes the clothes to the terrorist side clothes, any help is appreciated.
Video: https://streamable.com/b3al2c
Explorer: https://imgur.com/a/Ltseznk
Code:
local TC = Instance.new("RemoteEvent") TC.Name = "TeamChanger" TC.Parent = game.ReplicatedStorage local teams = game.Teams TC.OnServerEvent:Connect(function(Player, TeamName) Player.Team = game.Teams[TeamName] Player:LoadCharacter() char = Player.Character if Player.Team == "Counter Terrorists" then if char:FindFirstChild("Shirt") then char.Shirt:Destroy() end if char:FindFirstChild("Pants") then char.Pants:Destroy() end local shirt = teams["Counter Terrorists"].Shirt:Clone() shirt.Parent = char local pants = teams["Counter Terrorists"].Pants:Clone() pants.Parent = char else if char:FindFirstChild("Shirt") then char.Shirt:Destroy() end if char:FindFirstChild("Pants") then char.Pants:Destroy() end local shirt = teams["Terrorists"].Shirt:Clone() shirt.Parent = char local pants = teams["Terrorists"].Pants:Clone() pants.Parent = char end end)
As explained in my comment...
local TC = Instance.new("RemoteEvent") TC.Name = "TeamChanger" TC.Parent = game.ReplicatedStorage local teams = game.Teams TC.OnServerEvent:Connect(function(Player, TeamName) Player.Team = game.Teams[TeamName] Player:LoadCharacter() char = Player.Character if Player.Team.Name == "Counter Terrorists" then if char:FindFirstChild("Shirt") then char.Shirt:Destroy() end if char:FindFirstChild("Pants") then char.Pants:Destroy() end local shirt = teams["Counter Terrorists"].Shirt:Clone() shirt.Parent = char local pants = teams["Counter Terrorists"].Pants:Clone() pants.Parent = char else if char:FindFirstChild("Shirt") then char.Shirt:Destroy() end if char:FindFirstChild("Pants") then char.Pants:Destroy() end local shirt = teams["Terrorists"].Shirt:Clone() shirt.Parent = char local pants = teams["Terrorists"].Pants:Clone() pants.Parent = char end end)