For some reason, whenever this script fires , Clothing comes back as nil. Everything is where it should be and spelled right..Thanks for any help.
local co = game.Lighting.OutfitStorage.Helmets
function WeldHelmet()
local PlayerAttire = player.PlayerGui:FindFirstChild("Outfit")
local Clothing = co:FindFirstChild(PlayerAttire.OutfitHelmet.Value)
local char = player.Character or player.CharacterAdded:wait()
local OutfitTop = Clothing:Clone()
OutfitTop.Parent = game.Workspace
for _,v in pairs(OutfitTop:GetChildren()) do
if v.ClassName == "Part" or v.ClassName == "UnionOperation" then
v.Anchored = true
end
end
OutfitTop.Parent = workspace
for _,v in pairs(OutfitTop:GetChildren()) do
if v.ClassName == "Part" or v.ClassName == "UnionOperation" then
if v ~= OutfitTop["HelmetCore"] then
weld(v, OutfitTop["HelmetCore"])
end
end
end
local OutfitTopWeld = weld(OutfitTop["HelmetCore"], char["FakeHead"], CFrame.new())
for _,v in pairs(OutfitTop:GetChildren()) do
if v.ClassName == "Part" or v.ClassName == "UnionOperation" then
v.Anchored = false
v.CanCollide = false
end
end
end

1 comment
I'm not looking for something inside of PlayerAttire. I'm looking to match the value within PlayerAttire to a model in OutfitStorage.Helmets