local players = game:GetService("Players")
local plr = players.LocalPlayer
local plrteam = game:GetService("Teams").Red
game.ReplicatedStorage.Team.OnServerEvent:Connect(function()
if game.Players.LocalPlayer.Character:FindFirstChild("Shirt") then
game.Players.LocalPlayer.Character.Shirt:Destroy()
end
if game.Players.LocalPlayer.Character:FindFirstChild("Shirt Graphic") then
game.Players.LocalPlayer.Character:FindFirstChild('Shirt Graphic'):Destroy()
end
if game.Players.LocalPlayer.Character:FindFirstChild("Pants") then
game.Players.LocalPlayer.Character.Pants:Destroy()
end
local Shirt = Instance.new('Shirt',game.Players.LocalPlayer.Character)
local Pant = Instance.new('Pants',game.Players.LocalPlayer.Character)
Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=144076357"
Pant.PantsTemplate = "http://www.roblox.com/asset/?id=144076759"
end)
This is my script. The point of this is to change the players shirt and pants when an event is fired. When I run it , it tells me "Attempt to index nil "Character"" in the output. I spent 2 hrs fixing this script but now this is a problem I cant fix so it would be appreciated if you could help me. Thanks!

1 comment
Thanks so much , you let me learn something new. Thanks again and I have fixed it