I want to achieve a wig giver gui where if you click a image button it gives that certain wig
It won’t work and idk why? I’ve tried to change the welds and the IDs and it’s just not working
player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local Parts = {game.ReplicatedStorage.Wigs.Short1}
for _,Part in pairs (Parts:GetChildren()) do
local Class = Part.ClassName
if Class == "Part" or Class == "WedgePart" or Class == "UnionOperation" then
table.insert(Parts,Part)
if Part.Name ~= "Handle" then
local Weld = Instance.new("Weld",Part)
Weld.Part0 = Part
Weld.Part1 = Part.Handle
Weld.C0 = Weld.Part0.CFrame:inverse()
Weld.C1 = Weld.Part1.CFrame:inverse()
end
end
wait()
end
for _,Part in pairs (Parts) do
Part.Anchored = false
end
end)
The script is above
The wig is inside of replicated storage
ALL HELP IS WELCOME! Thanks