Is there a way to make my map changing script performance more better? From what I heard is that as the server is getting older, people will experience frame dropping (or high ping idk). From me I get frame drops until I rejoin and everything is all good. Any thoughts?

local maps = game.Lighting.Maps:GetChildren()
local Death = game.Workspace.Baseplate
local event = game.ReplicatedStorage
 
while true do
wait()
    Death.CanCollide = true -- just incase line 24 fails
    event.MapIsLoading:FireAllClients()
    wait(9)
    chosenmap = maps[math.random(1,#maps)]
    chosenmap:Clone().Parent = workspace
    wait(1)
    event:WaitForChild("LoadingIsDone"):FireAllClients()
    wait(1)
    Death.CanCollide = false
    wait(600)
    workspace:WaitForChild(chosenmap.Name):Destroy()
    Death.CanCollide = true 
    wait(.1)
end

1 comment

0

Yeah I use lighting as storage lol