function onBegin()
    if getFlag("a07permakey") == false then
        setFlag("a07off",false)
        local counter = 0
        local loop = true
        while loop do
            wait(.1)
            if getFlag("a07off") then
                loop = false
                setFlag("a07eye",false)
                setFlag("a07eyeA",false)
                setFlag("a07eyeB",false)
                setFlag("a07eyeC",false)
                setFlag("a07key",false)
            else
                counter = counter + 1
                if counter == 50 then
                    setFlag("a07eye",true)
                end
                if counter == 96 then
                    setFlag("a07eyeA",true)
                    setFlag("a07eye",false)
                end
                if counter == 139 then
                    setFlag("a07eyeB",true)
                    setFlag("a07eyeA",false)
                end
                if counter == 185 then
                    setFlag("a07eyeC",true)
                    setFlag("a07eyeB",false)
                end
                if counter == 229 then
                    setFlag("a07eyeD",true)
                    setFlag("a07eyeC",false)
                end
                if counter == 235 then
                    setFlag("a07key",true)
                    loop = false
                    setFlag("a07eyeC",false)
                end
            end  
        end
    end
end