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

Why doesn't this work?

Asked by 10 years ago
local scripty = script.Parent.otherlogic
function display(text)
    local text2 = game.ServerStorage.text.Value
    text2 = text
    wait(3)
    text2 = ""
end

while true do
    repeat wait() until scripty.Name == "ready"

    local try = coroutine.create(function()
        repeat wait() until _G.Team2Player.Character.ingame.WalkSpeed == 0
        wait(3)
        if game.ServerStorage.try2isdone.Value == false then
        game.ServerStorage.try1isdone.Value = true
        coroutine.yield(try2)
        for i,v in pairs(game.Players:GetChildren()) do
            if v.TeamColor == "Bright blue" then
                v.leaderstats.Wins.Value = v.leaderstats.Wins.Value + 1
            end
        end

        display("Red captain has been frozen! Blue team wins!")
        elseif game.ServerStorage.try2isdone.Value == true then return end
    end)

    local try2 = coroutine.create(function()
        repeat wait() until _G.Team1Player.Character.ingame.WalkSpeed == 0
        wait(3)
        if game.ServerStorage.try1isdone.Value == false then
            game.ServerStorage.try2isdone.Value = true
            coroutine.yield(try)
            for i,v in pairs(game.Players:GetChildren()) do
            if v.TeamColor == "Bright red" then
                v.leaderstats.Wins.Value = v.leaderstats.Wins.Value + 1
            end
            end

        display("Blue captain has been frozen! Red team wins!")
        elseif game.ServerStorage.try1isdone.Value == true then return end
    end)

    coroutine.resume(try)
    coroutine.resume(try2)  
end

It doesn't give me any errors, but it doesn't work either

0
Try adding a print statement after the repeat wait() wazap 100 — 10y
0
Hmm, interesting. I tried it and it printed "nil" about 3000 times. froggodude 15 — 10y

Answer this question