Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make a map change script?

So i got this:

local var = "map" --Local Variable

	game.Parent.Lighting.Parent."Map 1" then --Finds Map 1 in Lighting
	game.Function.Properties.(Map 1).Visible = 0 --Makes Map 1 Visible
wait(10 * 60) --Waits 10:00 before next event/round time
	game.localHumanoid.Humanoid.Health = 0
	game.Parent.Lighting.Parent."Map 1" then --Finds Map 1 in Lighting again
	game.Function.Properties.(Map 1).Visible = 1 --Makes Map 1 Invisible
wait(3 * 60) --Intermission Time of 3:00 
	game.Parent.Lighting.Parent."Map 2" then --Finds Map 2 in Lighting
	game.Function.Properties.(Map 2).Visible = 0 --Makes Map 2 Visible
wait(10 * 60) --Waits 10:00 before next event/round time
	game.localHumanoid.Humanoid.Health = 0
	game.Parent.Lighting.Parent."Map 2" then --Finds Map 2 in Lighting again
	game.Function.Properties.(Map 2).Visible = 1 --Makes Map 2 Invisible
wait(3 * 60) --Intermission Time of 3:00 
	game.Parent.Lighting.Parent."Map 3" then --Finds Map 3 in Lighting
	game.Function.Properties.(Map 3).Visible = 0 --Makes Map 3 Visible
wait(10 * 60) --Waits 10:00 before next event/round time
	game.localHumanoid.Humanoid.Health = 0
	game.Parent.Lighting.Parent."Map 3" then --Finds Map 3 in Lighting again
	game.Function.Properties.(Map 1).Visible = 1 --Makes Map 3 Invisible
wait(3 * 60) --Intermission Time of 3:00 
	game.Parent.Lighting.Parent."Map 4" then --Finds Map 4 in Lighting
	game.Function.Properties.(Map 4).Visible = 0 --Makes Map 4 Visible
wait(10 * 60) --Waits 10:00 before next event/round time
	game.Parent.Lighting.Parent."Map 4" then --Finds Map 4 in Lighting again
	game.Function.Properties.(Map 4).Visible = 4 --Makes Map 4 Invisible
end)

So, is this right for a map change script? I haven't tested so find mistakes or problems! Going to test now! Please fix!

4 comments

0

Why are you posting a script that you've not yet tested, asking us to look for mistakes and problems and then asking for a fix? The whole point of this site is to help you when you run into a problem, Not to find the problem before you've even tested it.

0

I HAVEN'T tested BECAUSE i don't have MAPS!

1

Why the heck did you make a script if you dont have maps you idiot?

0

Hey, no need to insult him obcdino. minkanb, your script is far from working condition, check out the wiki or youtube for some scripting tutorials. This is ScriptingHelpers, we help fix small problems with scripts, and it is the end user's responsibility to explain what their script does and make the script to a decent and presentable nature.

1 answer

holder = game.Lighting -- Where maps are stored
times = {
	Int = 3,
	Rnd = 10}
maps = {
	Map1 = holder:WaitForChild("Map 1"),
	Map2 = holder:WaitForChild("Map 2"),
	Map3 = holder:WaitForChild("Map 3"),
	Map4 = holder:WaitForChild("Map 4")}

m1 = maps.Map1:Clone()
m1.Parent = workspace -- Spawns map
wait(times.Rnd*60) -- Waits round time
m1:Destroy() -- Despawns map
wait(times.Int*60) -- Waits intermission
m2 = maps.Map1:Clone()
m2.Parent = workspace
wait(times.Rnd*60)
m2:Destroy()
wait(times.Int*60)
m3 = maps.Map1:Clone()
m3.Parent = workspace
wait(times.Rnd*60)
m3:Destroy()
wait(times.Int*60)
m4 = maps.Map1:Clone()
m4.Parent = workspace
wait(times.Rnd*60)
m4:Destroy()

This discussion is preserved as it was. New answers, comments, and votes are closed.