I have basically tried doing
elseif Hit:IsA("Hat") then
end
then the error keep coming up. This error doesn't effect anything but I really want to remove it from happening. My script doesn't break when a hat touches it and this is a Script inside of a Part Parented to Workspace! Here's the Script I made:
UniTop = "rbxassetid://227007415"
UniBottom = "rbxassetid://227007712"
script.Parent.Touched:connect(function(Hit)
if Hit.Parent.Humanoid then
local FindS = Hit.Parent:FindFirstChild("Shirt")
if FindS and FindS.ShirtTemplate ~= UniTop then
Hit.Parent.Shirt.ShirtTemplate = UniTop
elseif not FindS then
local S = Instance.new("Shirt", Hit.Parent)
S.ShirtTemplate = UniTop
end
local FindP = Hit.Parent:FindFirstChild("Pants")
if FindP and FindP.PantsTemplate ~= UniBottom then
FindP.PantsTemplate = UniBottom
elseif not FindP then
local P = Instance.new("Pants",Hit.Parent)
P.PantsTemplate = UniBottom
end
end
end)
I can give more information if needed, Just comment Bellow
