Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is Clothing a nil value?

Asked by
Chronomad 180
9 years ago

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 answer

Log in to vote
0
Answered by
Scriptecx 124
9 years ago

If you are trying to find the Value property of the value that wont work. Use this instead:

local Clothing = PlayerAttire:FindFirstChild('OutfitHelmet').Value
0
I'm not looking for something inside of PlayerAttire. I'm looking to match the value within PlayerAttire to a model in OutfitStorage.Helmets Chronomad 180 — 9y
Ad

Answer this question