im working on a "tower of hell" styled game and when the timer runs out the section does not regen it does work when generating the section of the tower but it won't regen when the timer runs out.
local clonedmap -- the variable
game.ReplicatedStorage.ResetEvent.OnServerEvent:Connect(function() -- checking if the event has been fired
local Section = math.random(1,3)
if clonedmap then -- these 3 lines don't work
clonedmap:Destroy()
end
if Section == 1 then -- randomizing the map no problems with this
local map = game.ReplicatedStorage.Upwards
clonedmap = map:Clone()
clonedmap.Parent = workspace
clonedmap:SetPrimaryPartCFrame(script.Parent.CFrame)
elseif Section == 2 then
local map = game.ReplicatedStorage.Bonjour
clonedmap = map:Clone()
clonedmap.Parent = workspace
clonedmap:SetPrimaryPartCFrame(script.Parent.CFrame)
elseif Section == 3 then
local map = game.ReplicatedStorage.Spinners
clonedmap = map:Clone()
clonedmap.Parent = workspace
clonedmap:SetPrimaryPartCFrame(script.Parent.CFrame)
end
end)
also have no console errors

2 comments
so, where is the code for the timer?
its splitted into multiple scripts i can post them