Problem with giving clothes when touching a door

Hello! I’m working on a project for a group and I feel like I shouldn’t be this stuck. This is just simply when a player touches the door, it gives them group clothes. But, for some reason, these clothes are not given. Not sure if what I’m doing is wrong(probably) or if Roblox is having trouble with loading assets. Either way, I’m stuck. If possible please help!

local open = script.Parent.Open
local debounce = false

script.Parent.Trigger1.Touched:Connect(function(p)
	if debounce == false then
		debounce = true
		if p.Parent:FindFirstChild("StaffCard") ~= nil then
			if open.Value == false then
				
				local player = tostring(p.Parent)
				local children = workspace:FindFirstChild(player)

				if children:FindFirstChild("Shirt") == nil then
					local shirt = Instance.new("Shirt", children)
					shirt.Name = "Shirt"
					print("giving shirt")
				else
					print("player has a shirt")
				end

				local rank = game.Players:FindFirstChild(player):GetRankInGroup(6017147)

				if rank < 6 and rank >= 12 then
					print("would give LowRank+ shirt.")
					workspace:FindFirstChild(player):FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5059324295"
					workspace:FindFirstChild(player):FindFirstChild("Pants").PantsTemplate = "rbxassetid://5184185481"
					
				elseif rank > 12 then
					print("would give HighRank+ shirt.")
					workspace:FindFirstChild(player):FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5059324295"
					workspace:FindFirstChild(player):FindFirstChild("Pants").PantsTemplate = "rbxassetid://3869153810"
				end

				local f = script.Parent.Door1.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0)
				for i = 0,1,0.1 do
					local cfm = script.Parent.Door1.PrimaryPart.CFrame:lerp(f,i)
					script.Parent.Door1:SetPrimaryPartCFrame(cfm)
					wait()
				end
				open.Value = true
				wait(3)
				local f3 = script.Parent.Door1.PrimaryPart.CFrame*CFrame.Angles(0,-math.rad(90),0)
				for i = 0,1,0.1 do
					local cfm = script.Parent.Door1.PrimaryPart.CFrame:lerp(f3,i)
					script.Parent.Door1:SetPrimaryPartCFrame(cfm)
					wait()
				end
				open.Value = false
			end
		else
			print("error")
		end
		debounce=false
	end
end)

So did either would give HighRank+/LowRank+ is printed?

Yes, it prints my rank, my rank is printed as 21. So it does print would give HighRank+ shirt.

Wait so it’s printing out your rank and not giving you the asset?

Correct, the assets are not given to me. Instead, it makes all my clothes invisible.

Wait I tried your asset id and it brought me to the shirt not the actual asset…

Sorry, I’m confused what you mean.

Ok so 5059324295 is the shirt id not the asset id. To find the asset id you’d have to subtract one until you got to the template.

Ohh, is there another way to get the asset id?

They are correct, when I manually put the HigherRank shirt id in the shirt class, it gives me out the asset id for it

http://www.roblox.com/asset/?id=5059324266

basically, you can convert the id to asset id by putting them in the ShirtTemplate/PantsTempalte property manually in the explorer

Only other way was if you were to wear it and go test mode in studio and get asset id from your shirt.

Ohh! okay, this worked thank you!