Any way of improving tables of restricted areas?

I want restricted areas to be live, i need to sometimes delete the parts and restore them, but if its not live its just gonna return nil. Any improvements?

local Storage = {
    ["SpawnVehicleTimeout"]={},
}
local Settings = {
    ["RestrictedAreasForSpawningVehicles"] = {
        function(player)return game.Workspace.Prison.PrisonDetection end,
    }
}

ps. i am using this to restrict vehicle spawning

Can’t you just set it to game.Workspace.Prison.PrisonDetection and update it whenever you readd it?

2 Likes

That would be smart, but how do i reference it?

local Find = game.FindFirstChild
-- [...]
function(player)
    return Find(Find(game.workspace, "Prison"), "PrisionDetection")
end

Use FindFirstChild(), that might work for you.