I need help with this script

So I have this script, and its supposed to equip the player with the Shirt Graphic, but when I change the team to equip it it doesnt give it to the player

function chooseuniform(char)
local player = game.Players:GetPlayerFromCharacter(char)

if player.Team.Name == “Prisoner” then
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=10638451486”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=10638453450”)

elseif player.Team.Name == “Solitary Prisoner” then
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=10638685889”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=10638693007”)

elseif player.Team.Name == “Max Security Prisoner” then
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
shirt.ShirtTemplate = (“rbxassetid://10638475151”)
pants.PantsTemplate = (“rbxassetid://10638478034”)

elseif player.Team.Name == “Facility Staff” then
player.CharacterAppearanceLoaded:Connect(function(loaded)
local Humanoid = loaded:WaitForChild(“Humanoid”)
Humanoid:RemoveAccessories()
wait(1)
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
local shirtgraphic = char:WaitForChild(“Shirt Graphic”)
if player:GetRankInGroup(10919513) >= 30 then
shirt.ShirtTemplate = ("")
pants.PantsTemplate = ("")
shirtgraphic.ShirtGraphic = (“rbxassetid://6537804246”)
elseif player:GetRankInGroup(10919513) >= 13 then
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=10957439882”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=10638466217”)
else
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=10638463476”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=10638466217”)
end
for _, v in pairs(script.Staff:GetChildren()) do
local cloned = v:Clone()
cloned.Parent = char
end
end)

elseif player.Team.Name == “Rapid Response Team” then
player.CharacterAppearanceLoaded:Connect(function(loaded)
local Humanoid = loaded:WaitForChild(“Humanoid”)
Humanoid:RemoveAccessories()
wait(1)
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=10905749592”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=10905752378”)
for _, v in pairs(script.RRT:GetChildren()) do
local cloned = v:Clone()
–warn(“CLONED”)
cloned.Parent = char
–warn(“PARENTED”)
end
end)

elseif player.Team.Name == “Facility Operations Command” then
player.CharacterAppearanceLoaded:Connect(function(loaded)
local Humanoid = loaded:WaitForChild(“Humanoid”)
Humanoid:RemoveAccessories()
wait(1)
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=11121624965”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=10905752378”)
for _, v in pairs(script.FOC:GetChildren()) do
local cloned = v:Clone()
–warn(“CLONED”)
cloned.Parent = char
–warn(“PARENTED”)
end
end)

elseif player.Team.Name == “Infirmary Staff” then
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=7118286245”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=7118360519”)

–[[
elseif player.Team.Name == “Criminal” then
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=4914206560”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=4914218575”)
]]–
end
end

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:connect(function(character)
wait(3)
chooseuniform(character)
end)
end)

Here is a screenshot of the output

Could you please format it correctly, it’s almost unreadable

1 Like

Yea sure, hold on. Let me paste it.

–MoldedPlate
function chooseuniform(char)
local player = game.Players:GetPlayerFromCharacter(char)

if player.Team.Name == "Prisoner" then
	local shirt = char:WaitForChild("Shirt")
	local pants = char:WaitForChild("Pants")
	shirt.ShirtTemplate = ("http://www.roblox.com/asset/?id=10638451486")
	pants.PantsTemplate = ("http://www.roblox.com/asset/?id=10638453450")
	
end
if player.Team.Name == "Solitary Prisoner" then
	local shirt = char:WaitForChild("Shirt")
	local pants = char:WaitForChild("Pants")
	shirt.ShirtTemplate = ("http://www.roblox.com/asset/?id=10638685889")
	pants.PantsTemplate = ("http://www.roblox.com/asset/?id=10638693007")
	
end
if player.Team.Name == "Max Security Prisoner" then
	local shirt = char:WaitForChild("Shirt")
	local pants = char:WaitForChild("Pants")
	shirt.ShirtTemplate = ("rbxassetid://10638475151")
	pants.PantsTemplate = ("rbxassetid://10638478034")
	
end
if player.Team.Name == "Facility Staff" then
	player.CharacterAppearanceLoaded:Connect(function(loaded)
	local Humanoid = loaded:WaitForChild("Humanoid")
	Humanoid:RemoveAccessories()
	wait(1)
	local shirt = char:WaitForChild("Shirt")
	local pants = char:WaitForChild("Pants")
	local shirtgraphic = char:WaitForChild("Shirt Graphic")
		if player:GetRankInGroup(10919513) >= 30 then
			shirt.ShirtTemplate = ("")
			pants.PantsTemplate = ("")
			shirtgraphic.ShirtGraphic = ("rbxassetid://6537804246")
		elseif player:GetRankInGroup(10919513) >= 13 then
			shirt.ShirtTemplate = ("http://www.roblox.com/asset/?id=10957439882")
			pants.PantsTemplate = ("http://www.roblox.com/asset/?id=10638466217")
		else
			shirt.ShirtTemplate = ("http://www.roblox.com/asset/?id=10638463476")
			pants.PantsTemplate = ("http://www.roblox.com/asset/?id=10638466217")
		end
	for _, v in pairs(script.Staff:GetChildren()) do
		local cloned = v:Clone()
		cloned.Parent = char
	end
	end)
	
end
if player.Team.Name == "Rapid Response Team" then
	player.CharacterAppearanceLoaded:Connect(function(loaded)
		local Humanoid = loaded:WaitForChild("Humanoid")
		Humanoid:RemoveAccessories()
		wait(1)
		local shirt = char:WaitForChild("Shirt")
		local pants = char:WaitForChild("Pants")
		shirt.ShirtTemplate = ("http://www.roblox.com/asset/?id=10905749592")
		pants.PantsTemplate = ("http://www.roblox.com/asset/?id=10905752378")
		for _, v in pairs(script.RRT:GetChildren()) do
			local cloned = v:Clone()
			--warn("CLONED")
			cloned.Parent = char
			--warn("PARENTED")
		end
	end)
	
end
if player.Team.Name == "Facility Operations Command" then
	player.CharacterAppearanceLoaded:Connect(function(loaded)
		local Humanoid = loaded:WaitForChild("Humanoid")
		Humanoid:RemoveAccessories()
		wait(1)
		local shirt = char:WaitForChild("Shirt")
		local pants = char:WaitForChild("Pants")
		shirt.ShirtTemplate = ("http://www.roblox.com/asset/?id=11121624965")
		pants.PantsTemplate = ("http://www.roblox.com/asset/?id=10905752378")
		for _, v in pairs(script.FOC:GetChildren()) do
			local cloned = v:Clone()
			--warn("CLONED")
			cloned.Parent = char
			--warn("PARENTED")
		end
	end)

end
if player.Team.Name == "Infirmary Staff" then
	local shirt = char:WaitForChild("Shirt")
	local pants = char:WaitForChild("Pants")
	shirt.ShirtTemplate = ("http://www.roblox.com/asset/?id=7118286245")
	pants.PantsTemplate = ("http://www.roblox.com/asset/?id=7118360519")

–[[
elseif player.Team.Name == “Criminal” then
local shirt = char:WaitForChild(“Shirt”)
local pants = char:WaitForChild(“Pants”)
shirt.ShirtTemplate = (“http://www.roblox.com/asset/?id=4914206560”)
pants.PantsTemplate = (“http://www.roblox.com/asset/?id=4914218575”)
]]–
end
end

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:connect(function(character)
wait(3)
chooseuniform(character)
end)
end)