So I have this part that falls when you touch it, for an obby. But I want it to clone in the exact same place after 3 seconds so if you die you can do it again. What do I do? code:
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid")then script.Parent.Anchored = false end end)
wait(3)
also btw my powers about to go off so.. But I will respond after it comes back on.
local part = script.Parent --your part, i just made a variable for it local origPos = part.Position --we're just saving your part's position for later use local debounce = false --i also added debounce part.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not debounce then local clonedPart = part:Clone() --clones our part debounce = true part.Anchored = false wait(3) clonedPart.Parent = workspace --parents the clone to workspace clonedPart.Position = origPos --position the clone to the position of your original part part = clonedPart --sets the clone part as the *part* so touched event can trigger from it (not really sure about this one tbh) debounce = false end end)
Hoping you learned something! <3