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

Why wont this script work? It's been in output and it says nothing is wrong.

Asked by 10 years ago
--[[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()
end
function Op2()
    m = Instance.new("Message", Workspace)
    m.Text = "".. MAP .."____ was picked!"
    wait(3)
    m:Destroy()
end
function Op3()
    m = Instance.new("Message", Workspace)
    m.Text = "You will be playing on the ".. MAP .." map"
    wait(3)
    m:Destroy()
end
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

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
        repeat
            a = HowLongVotingPeriodLasts
            wait(1)
            m = Instance.new("Message", Workspace)
            m.Text = MessageToBeStated .. a
            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
end
0
By the way this is not a free model I was making it for someone but it wont work.. Lem0nzz 5 — 10y
0
Have you looked at the output? Were there any errors? Thewsomeguy 448 — 10y
0
I did look at the output, it just doesn't function correctly. Not only it doesn't function, it wont work AT ALL... Like, it wont even say nothing.. Lem0nzz 5 — 10y
0
You need to connect the 4 functions that happens to me all the time lol. lolguy951753 60 — 10y

Answer this question