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

Can I make this regenerate faster using different methods?

Asked by 10 years ago

Hey I have seen other games have a faster map regeneration than me with much bigger maps, One of them being "Battlefield" which only takes around 4 seconds!

I'm wondering if there's a faster method of regenerating the map using a different method.

Here's all the regenerating map script.

map = game.Workspace.Map 
mapclone = map:Clone()
done = false

function regenmap()
    message = Instance.new("Message",game.Workspace)
    message.Text = "Regenerating the map. . . "
    mapclone.Parent = map.Parent
    map:Destroy()
    map = mapclone
    mapclone = map:Clone()
    message:Destroy()
    message:Destroy()
    message:Destroy()
end

function finish()
    if #alive == 1 then
        message = Instance.new("Message",game.Workspace)
        message.Text = "The winner was "..alive[1].Name
        alive[1].leaderstats.Wins.Value = alive[1].leaderstats.Wins.Value+1
        data:SetAsync(alive[1].userId.."_data",alive[1].leaderstats.Wins.Value)
        alive[1].Character:MoveTo(game.Workspace.SpawnLocation.Position)
        table.remove(alive,1)
        wait(2)
        message:Destroy()
        wait()
        message:Destroy()
    end
    regenmap()
    done = true

Thanks!

1 answer

Log in to vote
0
Answered by
OniiCh_n 410 Moderation Voter
10 years ago

Remove the unnecessary message:Destroy() maybe?

0
That will apporiximently make it 0.33 seconds faster :P I need a way use a different method like perhaps having it in Lighting and cloning it over or something? I think that's what others are doing User#2154 0 — 10y
Ad

Answer this question