Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I clone a part only when a humanoid touches it?

part = script.Parent
cloned = part:Clone()

part.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		cloned.Parent = game.Workspace
		
		end
		
		end
	end
	
end)

2 comments

0

script looks fine, i believe theres just an extra end in there

0

I suggest only cloning the part when the humanoid touches it not at the start of the script

2 answers

Try this, you put 2 extra "ends" in your script

part = script.Parent
cloned = part:Clone()

part.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		cloned.Parent = game.Workspace

	end

end)

This discussion is preserved as it was. New answers, comments, and votes are closed.