This script spams a message constantly, what's wrong with it? [UNANSWERED]
So there's a problem with this script. It spams "Voting Time:", over, and over again. Just constantly. It does it even if there isn't 2 players in the game. Does anyone know the error? Here's the script.
001 | Maps = { "Wobbly Bridge" , "Tower Of Magic" } |
005 | HowLongMessageLasts = 5 |
007 | HowLongVotingPeriodLasts = 15 |
009 | MessageToBeStated = "Seconds Left: " |
017 | m = Instance.new( "Message" , Workspace) |
019 | m.Text = "Map Selected: " .. MAP .. "!" |
029 | m = Instance.new( "Message" , Workspace) |
031 | m.Text = "" .. MAP .. "____ was picked!" |
041 | m = Instance.new( "Message" , Workspace) |
043 | m.Text = "You will be playing on the " .. MAP .. " map" |
053 | m = Instance.new( "Message" , Workspace) |
063 | Players = game.Players:GetPlayers() |
065 | Ls = game.Lighting:GetChildren() |
067 | _G.MAPA = { "Wobbly Bridge" } |
069 | _G.MAPB = { "Tower Of Magic" } |
071 | _G.NothingCurrently = { } |
073 | Lasting = HowLongVotingPeriodLasts |
077 | HowLongVotingPeriodLasts = Lasting |
079 | if game.Players.NumPlayers > = 1 then |
081 | for o = 1 ,#Players do |
083 | gui = game.Lighting.Vote:Clone() |
085 | gui.Parent = Players [ o ] .PlayerGui |
091 | a = HowLongVotingPeriodLasts |
095 | m = Instance.new( "Message" , Workspace) |
097 | m.Text = "Voting Time: " |
107 | for i = 1 ,#Players do |
109 | val = Players [ i ] .Map.Value |
111 | table.insert(_G [ val ] , val) |
115 | mapn = math.max(#_G.MAPA, #_G.MAPB) |
117 | if #_G.MAPA = = mapn then |
121 | if Ls [ u ] :FindFirstChild( "A" ) ~ = nil then |
133 | Mapp.Parent = Workspace |
141 | elseif Option = = 2 then |
145 | elseif Option = = 3 then |
149 | elseif Option = = 4 then |
155 | print ( "Invalid option" ) |
159 | for y = 1 ,#Players do |
163 | Players [ y ] .TeamColor = BrickColor.new( "Really red" ) |
167 | elseif COLOR = = 2 then |
169 | Players [ y ] .TeamColor = BrickColor.new( "Really blue" ) |