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

How would I make a script so that after a certain period of time parts regenerate?

How would I make a script that would regenerate parts which have a certain name in the workspace after a certain period of time?

Thank You and help is appreciated

4 comments

0

clone it and after period of time destroy other one and put cloned one in

0

how would I script that

0

workpace.Part:clone() idk

0

um would it be wait(60) then function createSand() workspace.Part.Clone() and then function destroySand() workspace.Part.Destroy()

3 answers

local Clone = workspace.NAMEOFPARTORMODEL:Clone()
wait(SECONDS)
workspace.NAMEOFPARTORMODEL:Destroy()
Clone.Parent = workspace

you can put this in a while loop :)

Hope i Helped

1 comment

0

so while true do loop

You can do something like this. If you can script it should be easy to make this clone the item u want.

local regentimer = 1
local replicatedstorage = game:WaitForChild("ReplicatedStorage")

while wait(regentimer) do
print("Cloning")
local oldclone = game.Workspace:FindFirstChild("Part")
if oldclone ~= nil then
	game.Workspace.Part:Destroy()
end
wait(1)
local newclone = replicatedstorage.Part:Clone()
newclone.Parent = workspace

end

Try using this script:

local model = --the name of the object you want to clone
local modelParent = --where you want to put the cloned object]
local seconds = --time in between cloning in seconds

while true do
	local modelClone = model:Clone()
	modelClone.Parent. modelParent
	wait(seconds)
	modelParent.model:Destroy()
end

Hope this helped!

3 comments

0

How would I say to put the model I want to clone in the same position as it was before

0

it would do that

0

wouldn't it? I don't get why it wouldn't

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