Let x and y be arbitrary positive integers. In this while loop, how do I make every new part get destroyed after it has existed for y seconds?
while true do
p = Instance.new("Part",game.Workspace)
wait(x)
end
Let x and y be arbitrary positive integers. In this while loop, how do I make every new part get destroyed after it has existed for y seconds?
while true do
p = Instance.new("Part",game.Workspace)
wait(x)
end
Easy here: Destroy() command lets thing disappear from game. Here is it:
function creating()
p = Instance.new("Part",game.Workspace)
wait(y)
p:Destroy()
end
while true do
creating()
wait(x)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
A better solution would be to use the debris service