I am trying to make a vest made out of a mesh that will be put on the player when they touch it. Here is the script I have tried to make:

debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Vest")
		p = Instance.new("Part")
		h.Name = "Desert Camo"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Body").Position
		p.Name = "Handle" 
		p.formFactor = 2
		p.Size = Vector3.new(2, 2, 2) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0, 0.05, 0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)

1 comment

1

how hard is it to put a vest in replicated storage then clone it?