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

after i added this function the script stopped working?

Asked by 7 years ago

It stopped working after i added the "ChooseColor()" function...

--//Values

Intermission = 5

--//Functions

function ChangeText(Text)
    local Players = game.Players:GetPlayers()
    for i = 1, #Players do
    Players[i].PlayerGui.CountdownGui.MainFrame.ActivityLabel.Text = Text
end
end

function StartIntermission()
    local Players = game.Players:GetChildren()
    for i = Intermission, 0, -1 do
    ChangeText("Choose your Color: " ..i)
    wait(1)
end
end

function ChooseColor()
    local Players = game.Players:GetChildren()
    local Colors = {"Blue", "Red", "Yellow", "Purple"}
    local n = math.random(1, 4)
    local Color = Colors[n]
    print("Color Chosen: "..Color)
        for i = 1, #Players do
        Players[i].PlayerGui.CountdownGui.MainFrame.ActivityLabel.Text = "Color Chosen: "..Color
    wait(1)
    local ColorPart = game.Workspace.Colors:FindFirstChild(""..Color)
    wait(0.1)
    ColorPart.Transparency = 1
    ColorPart.CanCollide = false
end

--//Main

while true do
    StartIntermission()
    ChangeText("Choosing Color...")
    ChooseColor()
    wait(1)
end
end

1 answer

Log in to vote
0
Answered by 7 years ago

This is a pretty easy issue that can be hard to notice, you need to have "end" on line 36 and remove "end" from line 45

Ad

Answer this question