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

Help, this just spams stuff...

--[[This is the rounds script. It will create different rounds, and will give players the vote gui when needed
This must be located in workspace, follow all these instructions.--]]

Maps = {game.Lighting:FindFirstChild("Tower of Magic"),game.Lighting:FindFirstChild("Wobbly Bridge")} --Place the maps in here (WHEN I SAID USE _ DOWN BOTTOM, I MEANT IN THE NAMES OF THEM, but don't worry I fixed this. No need to change them.

Time_Per_Round = 160 --How long each round lasts

HowLongMessageLasts = 5 --How long the message will last

HowLongVotingPeriodLasts = 15 --How long they have to vote

--Option 1. Map picked: ____

--Option 2. ____ was picked!

--Option 3. You will be playing on the ____ map

--Option 4. Custom Message

--Pick which option (1, 2, 3 or 4)

MessageToBeStated = "Seconds Left: " --What should be said during voteing period, make sure to have a space!

Option = 1

COLOR = 1 --What team should the first be assigned? Red is 1, Blue is 2

function Op1()
	m = Instance.new("Message", Workspace)
	m.Text = "Map picked: ".. MAP .."!"
	wait(3)
	m:Destroy()
function Op2()
	m = Instance.new("Message", Workspace)
	m.Text = "".. MAP .."____ was picked!"
	wait(3)
	m:Destroy()
function Op3()
	m = Instance.new("Message", Workspace)
	m.Text = "You will be playing on the ".. MAP .." map"
	wait(3)
	m:Destroy()
function Op4()
	m = Instance.new("Message", Workspace)
	m.Text = "Map:" --Change this to what the message should be, if you want the name do this; ".. MAP .."
	wait(3)
	m:Destroy()
end
end
end
end
Players = game.Players:GetPlayers()

Ls = game.Lighting:GetChildren()

_G.MAPA = {"Tower of Magic"} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP A, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "A" IN THIS MAP)
_G.MAPB = {"Wobbly Bridge"} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP B, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "B" IN THIS MAP)
_G.MAPC = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP C, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "C" IN THIS MAP)
_G.MAPD = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP D, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "D" IN THIS MAP)
_G.MAPE = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP E, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "E" IN THIS MAP)
_G.MAPF = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP F, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "F" IN THIS MAP)
_G.MAPG = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP G, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "G" IN THIS MAP)
_G.MAPH = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP H, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "H" IN THIS MAP)
_G.MAPI = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP I, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "I" IN THIS MAP)
_G.MAPJ = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP J, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "J" IN THIS MAP)
_G.MAPK = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP K, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "K" IN THIS MAP)
_G.MAPL = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP K, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "L" IN THIS MAP)
_G.MAPM = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP M, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "M" IN THIS MAP)
_G.MAPN = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP N, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "N" IN THIS MAP)
_G.MAPO = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP O, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "O" IN THIS MAP)
_G.MAPP = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP P, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "P" IN THIS MAP)
_G.MAPQ = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP Q, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "Q" IN THIS MAP)
_G.MAPR = {} --Name these the name of the map, instead of spaces use _ (THIS WILL BE MAP R, THIS IS WHERE YOU MAKE A STRING VALUE CALLED "R" IN THIS MAP)
_G.NothingCurrently = {}
Lasting = HowLongVotingPeriodLasts
while true do
	wait()
	HowLongVotingPeriodLasts = Lasting
	if #Players > 1 then
		for o = 1,#Players do
			game.Lighting.Vote:Clone()
			gui.Parent = Players[o].PlayerGui
		end
		end
		repeat
			a = HowLongVotingPeriodLasts
			wait(1)
			m = Instance.new("Message", Workspace)
			m.Text = "Waiting time"
			wait(1)			
		until a == 0
		m:Destroy()
		for i = 1,#Players do
			val = Players[i].Map.Value
			table.insert(_G[val], val)
		end
			mapn = math.max(#_G.MAPA, #_G.MAPB, #_G.MAPC, #_G.MAPD, #_G.MAPE, #_G.MAPF, #_G.MAPG, #_G.MAPH, #_G.MAPI, #_G.MAPJ, #_G.MAPK, #_G.MAPL, #_G.MAPM, #_G.MAPN, #_G.MAPO, #_G.MAPP, #_G.MAPQ, #_G.MAPR)
			if #_G.MAPA == mapn then
				for u = 1,#Ls do
					if Ls[u]:FindFirstChild("A") ~= nil then
						Picked = Ls[u]
					end
				end
			end
		Mapp = Pick:Clone()
		Mapp.Parent = Workspace
		MAP = Mapp.Name
		if Option == 1 then
			Op1()
		elseif Option == 2 then
			Op2()
		elseif Option == 3 then
			Op3()
		elseif Option == 4 then
			Op4()
		else
			print("Invalid option")
		end
		for y = 1,#Players do
			if COLOR == 1 then
				Players[y].TeamColor = BrickColor.new("Really red")
				COLOR = 2
			elseif COLOR == 2 then
				Players[y].TeamColor = BrickColor.new("Really blue")
				COLOR = 1
			end
		end
		end

2 comments

0

I made this for a friend, but when we tested it, it just spammed "Waiting time:", and all the messages. I couldn't see so I don't know if it spammed the maps.

0

The instructions are for my friend.

1 answer

On line 82 you are trying to set the parent of variable "gui" but there is no variable named "gui". Perhaps you intended to create one on line 81

On line 85 you begin a repeat loop that will not ever end because you are setting "a" to a value that is not changing.

On line 105 , you are cloning a variable named "Pick" which does not exist in the code you provided.

Good luck!

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