what’s good, i have this script where i clone model with clothing item. i’m wondering why when i click on shirt it loads fine but when i clicck on pants it does not. not sure what i’m over looking.
local function open_frame(curr)
frame:TweenPosition(UDim2.new(), "Out", "Quint", .5, true)
menu_open = true
local found_leg
for i, v in pairs(all_leg_parts) do
if v == curr.Name then
found_leg = true; break
end
end
if found_leg then
selected_type = "Pant"
else
selected_type = "Shirt"
end
local current = mouse.Target
local model = current:FindFirstAncestorWhichIsA("Model")
if model and model:FindFirstChild(selected_type) then
local selected_item = model:FindFirstChild(selected_type)
if selected_item:isA("Shirt") then
local model = current.Parent
local model_clone = model:Clone()
model_clone.Parent = vpf
model_clone:FindFirstChildWhichIsA("Pants"):Destroy()
selected = model_clone
local vp_camera = Instance.new("Camera")
vpf.CurrentCamera = vp_camera
vp_camera.Parent = frame
vp_camera.CFrame = model_clone.HumanoidRootPart.CFrame * CFrame.Angles(0, math.rad(180), 0) + (model_clone.HumanoidRootPart.CFrame.LookVector * 5)
elseif selected_item:isA("Pants") then
local model = current.Parent
local model_clone = model:Clone()
model_clone.Parent = vpf
model_clone:FindFirstChildWhichIsA("Shirt"):Destroy()
selected = model_clone
local vp_camera = Instance.new("Camera")
vpf.CurrentCamera = vp_camera
vp_camera.Parent = frame
vp_camera.CFrame = model_clone.HumanoidRootPart.CFrame * CFrame.Angles(0, math.rad(180), 0) + (model_clone.HumanoidRootPart.CFrame.LookVector * 5)
end
end
end