Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Wait() Being Random?

Asked by 6 years ago
Edited 6 years ago

I am trying to have a block when you press "E" it disappears waits 20 seconds and reappears ready to be picked up again. But it appears my script is being random without using math.random. I would like it to just be 20 seconds. I don't know much about part regeneration and would like to know what's causing the problem so I can fix it. This is a server script should it be local idk. Thanks!

local model = script.Parent


if model ~= workspace then 

    local backup = model:clone() 

    while true do 
        wait(20) 

        model:Destroy()



        model = backup:clone() 
        model.Parent = game.Workspace 
        model:makeJoints()
    end
else
    print('oof')
end

Answer this question