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)
COMMUNITY QUESTION
How can I clone a part only when a humanoid touches it?
2 answers
cloned = part:Clone()
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.

2 comments
script looks fine, i believe theres just an extra end in there
I suggest only cloning the part when the humanoid touches it not at the start of the script