So, i've been testing this regen script, that selects a random model between the 2 that exist for now(Model1 and Model0). The script begins by checking if X equals to 0 or 1, to select which map will be choosen in the next round. Then the choosen model will clone itself, and here is where the trouble is.
No errors, the Model is archivable, and it wont clone. What did i do wrong?
Script:
local ServerStorage = game.ServerStorage
function Regen()
local X = math.random(0,1)
if X == 1 then
ServerStorage.Model1:Clone()
ServerStorage.Model1.Parent = workspace
wait(2)
workspace.Model1:Destroy()
print("X was 1")
end
if X == 0 then
ServerStorage.Model0:Clone()
ServerStorage.Model0.Parent = workspace
wait(2)
workspace.Model0:Destroy()
print("X was 0")
end
end
while true do
Regen(Regen())
wait(2)
end
Cheers!

7 comments
On line 22 it should just be "Regen()" not "Regen(Regen)" since your function doesn't take any arguments.
thank you.
Why are you destorying the clone after you clone it?
wait.
i want to delete the clone, that the Parent is workspace, which is supposed to be deleted, and replaced with another clone later.
I don't understand. What do you mean.
i the model to be cloned, then it will be moved to workspace, so it can be the next map, then, after some time, it would be deleted, so that another map can take place.