Ad
Log in to vote
0

How do I make multiple parts inside an accessory visible?

Asked by 5 days ago

I have a character creation script but only makes the handle visible, I tried replacing the line of code about handle with :GetDescendants() and it didnt work.

local MaleTable = require(game.ReplicatedStorage:WaitForChild("MaleHairModule"))

script.Parent.Hair.Changed:Connect(function()
    for i, v in pairs(workspace.CharCustom.Humanoid:GetAccessories()) do
        if v:IsA("Accessory") then
            v.Handle.Transparency = 1
        end
    end
    workspace.CharCustom:FindFirstChild(MaleTable[script.Parent.Hair.Value]).Handle.Transparency = 0
end)

script.Parent.Parent.Forward.MouseEnter:Connect(function()
    local Camera = workspace.CurrentCamera
    local TweenService = game:GetService("TweenService")
    local TI = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0)
    local Target = {CFrame = workspace.CameraParts.Hair.CFrame}
    local Tween = TweenService:Create(Camera,TI,Target)
    Tween:Play()
end)
script.Parent.Parent.Forward.MouseLeave:Connect(function()
    local Camera = workspace.CurrentCamera
    local TweenService = game:GetService("TweenService")
    local TI = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0)
    local Target = {CFrame = workspace.CameraParts.Part2.CFrame}
    local Tween = TweenService:Create(Camera,TI,Target)
    Tween:Play()
end)

Example directory of the hair: Accessory -> Handle Accessory -> Part Yes, the part is in the same directory as Handle.

Answer this question