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

How to fix this transparency changing script?

Asked by 10 years ago

This script changes the transparency based on what the transparency already is. I need it to change by what the transparency already is because it is a snow script, and it needs to be compatible with the snow plows.

while true do
    wait (10)
    if script.Parent.Transparency == 0 then script.Parent.Transparency = 0.9
    else if script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
    else if script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
    else if script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
    end
    wait (10)
    if script.Parent.Transparency == 0 then script.Parent.Transparency = 0.9
    else if script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
    else if script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
    else if script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
    end
    wait (10)
    lse if script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
    else if script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
    else if script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
    end
    wait (10)
    else if script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
    else if script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
    else if script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
    end
    wait (10)
    else if script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
    else if script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
    else if script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
    end
    wait (10)
    else if script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
    else if script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
    else if script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
    else if script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
    end
end

1 answer

Log in to vote
1
Answered by 10 years ago

Change else if to one word. Its elseif, not else if.

while true do
        wait (10)
        if script.Parent.Transparency == 0 then script.Parent.Transparency = 0.9
        elseif script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
        elseif script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
        elseif script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
        end
        wait (10)
        if script.Parent.Transparency == 0 then script.Parent.Transparency = 0.9
           elseif script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
        elseif script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
        elseif script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
        end
        wait (10)
        elseif script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
        elseif script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
        elseif script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
        end
        wait (10)
        elseif script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
        elseif script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
        elseif script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
        end
        wait (10)
        elseif script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
        elseif script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
        elseif script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
        end
        wait (10)
        elseif script.Parent.Transparency == 0.9 then script.Parent.Transparency = 0.7
        elseif script.Parent.Transparency == 0.7 then script.Parent.Transparency = 0.5
        elseif script.Parent.Transparency == 0.5 then script.Parent.Transparency = 0.3
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.3 then script.Parent.Transparency = 0.1
        elseif script.Parent.Transparency == 0.1 then script.Parent.Transparency = 0
        end
    end
Ad

Answer this question