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

how do i make a map changer with no intermission?

Asked by 6 years ago

hi, im trying to make a map change script for my game but all the tutorials i see have a intermission in them. one way i think you can do this is by having all the maps except the starting map in Lighting and having the other map already in Workspace. then after 300 seconds (5 minutes) the map goes into Lighting and the next map moves into Workspace and the process continues. i also need to make sure the script repeats itself over and over. also when the map changes i need to have it kill all the players

here is what i thought could be quite close:

wait(300)
Map1.Parent = "Lighting"
Map2.Parent = "Workspace"
Players"Humanoid".Health = 0

i know thats probably way off, thanks in advance from poopypigeon245

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

This is fairly simple, what you would need to do is make a while true do loop in serverscriptservice as your main script. That would look something like this:

--// Variables

TimePerMap = 300

--// Map Changing

while wait(TimePerMap) do
if workspace.MapStorage:FindFirstChild("Map1") then
    workspace.MapStorage.Map1.Parent = Lighting
    mapClone = game.Lighting.Map2:Clone(workspace.MapStorage)
    mapClone.Name = "Map2"
    end
end

keep repeating that if statement but change it to map2, map3, map4, etc. going up to the number of maps you have, but on the last one, change it back to map1. You can also change the variable to however many seconds you want the map to be out. Hope I helped.

EDIT: you would need to make the copies of those lines say workspace.MapStorage:ClearAllChildren() instead of setting their parent back to workspace, the reason for this is that the server would have way too many objects in lighting and lag out the game due to the fact that we are putting a clone in lighting, not the original map.

0
which lines do i need to change? poopypigeon245 22 — 6y
0
You need to change the map number every time you copy and paste it into the while loop right after the first end in the script and instead of setting their parent to workspace, destroy it. When you get to the last if statement for your last map, instead of cloning it, set it’s parent to workspace.Mapstorage cmgtotalyawesome 1418 — 6y
0
Only copy the if statement btw (from if to the first end you see after it) cmgtotalyawesome 1418 — 6y
Ad

Answer this question