Weld not connecting in scripts

I am making a tower upgrading system like in a tower defense game, and when I fire a function to weld a accessory to a character, it doesn’t weld to the character and just falls through the ground.
One thing that I find confusing about this is that when I run the same exact function in the command bar, it works perfectly but for some odd reason it wont work in the script either way.

function module.CloneWeld(Tower,Object,Weld,otherPart,Part)
	local clone = Object:Clone()
	clone.Parent = Tower.Appearance
	Weld.Part0 = otherPart
end

weld the accessory’s handle instead, since an accessory isn’t a part

1 Like

I figured it out. Its because I was welding the part in replicated storage, not the clone of it.

Sorry I’m an idiot lol.