Why does my team change script not change clothes?
Asked by
4 years ago Edited 4 years ago
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:
01 | local TC = Instance.new( "RemoteEvent" ) |
02 | TC.Name = "TeamChanger" |
03 | TC.Parent = game.ReplicatedStorage |
04 | local teams = game.Teams |
06 | TC.OnServerEvent:Connect( function (Player, TeamName) |
07 | Player.Team = game.Teams [ TeamName ] |
08 | Player:LoadCharacter() |
09 | char = Player.Character |
12 | if Player.Team = = "Counter Terrorists" then |
13 | if char:FindFirstChild( "Shirt" ) then |
17 | if char:FindFirstChild( "Pants" ) then |
21 | local shirt = teams [ "Counter Terrorists" ] .Shirt:Clone() |
23 | local pants = teams [ "Counter Terrorists" ] .Pants:Clone() |
26 | if char:FindFirstChild( "Shirt" ) then |
30 | if char:FindFirstChild( "Pants" ) then |
34 | local shirt = teams [ "Terrorists" ] .Shirt:Clone() |
36 | local pants = teams [ "Terrorists" ] .Pants:Clone() |