I want to make a game that allows you to destroy blocks but they are respawned in like 20 seconds, I’m not sure how you would go about and do this, could anybody help?
Yes, you can put the same block in replicated storage, then when the one in workspace gets deleted, clone the block in replicated storage to workspace
Detect if the part gets deleted, and when it does, wait however long you want then parent the part back to workspace (or where ever it was to begin)
ex.
local part = workspace.Part
part.Changed:Connect(function()
if not part~=nil then
wait(1)
part.Parent = workspace
end
end)
When the part is deleted, how would you check the deleted part’s name matches the original part?
Would it be like:
script.Parent.Parent.Parent.List.DescendantAdded:Connect(function(descendant)
if descendant.Name == "Block"
then
-- code here
end
end)
I can’t really write out the whole thing for you, but generally you’re gonna want to replace the Block:Destroy()
code. Instead of destroying it, reparent it to a folder. Then every 20 seconds put all the stuff inside the folder into Workspace.
You can do what @BullfrogBait said, you can put the block in a folder called DeletedParts, then when you want to put it back, just put it in workspace again
Fixed: I used DescendantRemoved or something can’t really remember. Then cloned the part into ReplicatedStorage and re-added in workspace!