function main(self)
	if self.State == 0 then
		self.Flags.AlwaysActive = true
		self.HitTypeFlags, self.HitRect = 2, {-9,-24,9,24}
		self.hitDelay = 0
		self.frameTime = 0
		self.State = 7
	end

	if self.State == 5 then -- stay down
		self:SetFrame(3)
	end
	if self.State == 6 then -- go up
		if GetTime() > self.frameTime then self.State = 7 end
	end
	if self.State == 7 then -- stay up
		self:SetFrame(1)
	end
	if self.State == 8 then -- go down
		if GetTime() > self.frameTime then self.State = 5 end
	end
end

function hit(self)
	if GetTime() > self.hitDelay then
		self.hitDelay = GetTime() + 300
		self.frameTime = GetTime() + 80
		PlaySound("CUSTOM_LEVER")
		self:SetFrame(2)
		if self.State == 5 then
			self.State = 6
		elseif self.State == 7 then
			self.State = 8
		end
	end
end