Wig Giver Not Working

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

image

The wig is inside of replicated storage

image

ALL HELP IS WELCOME! Thanks :slight_smile:

You can’t get Players.LocalPlayer if it’s a script, and if it’s a localscript, then clearly, Other players can’t see the player Welds

It’s in a local script and also that was just for now anyways.