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

I honestly have no clue what the heck is going on?

Asked by 9 years ago

Well I have been working on this same problem for over an hour a day, and it wont go away, I feel like its something so obvious I want to punch myself, but I cannot figure out what.

wait(5)
while true do --Just a normal while true do function so rounds happen after one round ends!
        function newmode() --Declares a function called newmode
        _G.mode = math.random(1,2) --Gets a random number between 1 and 2, change 2 to however many modes you have.
        if _G.mode == 1 then --If the mode equals 1 then
            _G.addtoolsmode1 = game.Lighting.Mode1Sword:clone() --Makes global variable addtoolsmode1 and clones Mode1Sword
            _G.addtoolsmode1.Parent = game.StarterPack --Sets parent to game.StarterPack
            _G.addtoolsmode1.Name = "Sword" --Sets its name to Sword
        elseif _G.mode == 2 then
            _G.addtoolsmode2 = game.Lighting.Mode2Sword:clone()
            _G.addtoolsmode2.Parent = game.StarterPack
            _G.addtoolsmode2.Name = "Sword"
end --End
    end --End
        function map() --Declares new function called map
            if _G.mode == 1 then --Checks if mode equals 1 and if it does then executes code
                _G.map = math.random(1,2)
                if _G.map == 1 then
                    _G.addmap = game.Lighting.ModeMaps.Mode1.Map1:clone()
                    _G.addmap.Parent = game.Workspace
                    _G.addmap.Name = "Map1"
                elseif _G.mode == 1 and _G.map == 2 then
                    _G.addmap = game.Lighting.ModeMaps.Mode1.Map2:clone()
                    _G.addmap.Parent = game.Workspace
                    _G.addmap.Name = "Map2" 
                end
            elseif _G.mode == 2 and _G.map == 1 then
                _G.addmapmode2 = game.Lighting.ModeMaps.Mode2.Map1:clone()
                _G.addmapmode2.Parent = game.Workspace
                _G.addmapmode2.Name = "Map1"
            elseif _G.mode == 2 and _G.map == 2 then
                _G.addmapmode2 = game.Lighting.ModeMaps.Mode2.Map2:clone()
                _G.addmapmode2.Parent = game.Workspace
                _G.addmapmode2.Name = "Map2"
            end

            end
        end
    _G.newroundadd = Instance.new("IntValue", game.Workspace) --Inserts an IntValue for a round counter
    _G.newroundadd.Value = 0 --The round counters value.
    _G.r = Instance.new("Hint", game.Workspace) --Inserts a new hint used throughout the function
    _G.newroundadd.Value = _G.newroundadd.Value + 1 --Adds 1 to the round counter
    _G.r.Text = "A new round is about to begin, this is round ".._G.newroundadd.Value.."!" --New round begins and tells what round it is
    wait(5) --Wait 5 seconds
    _G.r.Text = "Selecting gamemode!" --Says selecting gamemode
    newmode() --Calls function newmode
    wait(2)
    map()
    _G.r.Text = "The map loaded has succesfully loaded!"
    wait(5)
    _G.r.Text = "Killing all players."
    game.Workspace.Lobby.Parent = game.Lighting
    wait(4)
    _G.r.Text = "Begin!"
    wait(2)
    _G.timer = Instance.new("IntValue",game.Workspace)
    _G.timer.Name = "Timer"
    _G.timer.Value = 120
    repeat
        _G.timer.Value = _G.timer.Value - 1
        _G.r.Text = "You have ".._G.timer.Value.." seconds left!"
        wait(1)
    until
        _G.timer.Value == 5
    if _G.timer.Value == 5 then
        _G.r.Text = "The round ends in ".._G.timer.Value.." seconds."
        if _G.timer.Value == 1 then
            _G.timer:Remove()
        end
    end
_G.r.Text = "The round is over, killing players."
_G.addmap:Remove()
_G.addmapmode2:Remove()
game.StarterPack.Sword:Remove()
game.Lighting.Lobby.Parent = game.Workspace


wait(5)
_G.r.Text = "Intermission will now begin."
_G.inter = Instance.new("IntValue", game.Workspace)
_G.inter.Name = "Intermission"
_G.inter.Value = 20
repeat
    _G.inter.Value = _G.inter.Value - 1
    _G.r.Text = "You have ".._G.inter.Value.." seconds left of intermission."
    wait(1)
until
    _G.inter.Value == 1
if _G.inter.Value == 1 then
    _G.inter:Remove()

I've checked the output, I've tried remote error monitoring script, and nothing shows me anything.

0
This isn't even the full code, what the heck? DevShowcase 0 — 9y
0
Then fix it... SchonATL 15 — 9y
0
no. DevShowcase 0 — 9y

Answer this question