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

What do i do if my else statement doesnt work as expected? [closed]

Asked by 3 years ago
Edited 3 years ago

Hey there, I am having a problem with if statements, short answer my else does not work, long answer

    for i = 20,0,-1 do
        if script.Parent.Parent.Count.Value ~= 0 then
            script.Parent.Parent.Text2.SurfaceGui.SIGN.Text = i
            wait(1)
        elseif script.Parent.Parent.Count.Value == 0 then
            script.Parent.Parent.Text2.SurfaceGui.SIGN.Text = "Waiting for players..."
            break
        end
    end
    script.Parent.Parent.Text2.SurfaceGui.SIGN.Text = "Waiting for players..." -- reseting the system and teleporting the player to another game

This script should trigger the else statement when the Count.Value = 0, but it doesnt trigger the else statement even if the Count.Value is set to 0 can anyone help me please?

0
You're not being specific. Where is it placed? Send screenshots if possible, did you use prints? And post more of a descriptive question. Please read the community guidelines for help. This question will be closed. JesseSong 3916 — 3y

Closed as Non-Descriptive by JesseSong

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?