Repeat function not working with server events

so i want a block to rise until a remote event is called, but for the process to repeat when another event is called

game.ReplicatedStorage.Rise.OnServerEvent:Connect(function()
repeat
	Brick.Position = Brick.Position + Vector3.new(0,.1,0)
until
game.ReplicatedStorage.SwitchStage.OnServerEvent
end)

The brick only rises once when the rise event is called and then stops

im not sure what im doing wrong here

I would just connect a function for the remote event and repeat until a variable is true.

local varb = false
game.ReplicatedStorage.SwitchStage.OnServerEvent:Connect(function()
   varb = true
end)
game.ReplicatedStorage.Rise.OnServerEvent:Connect(function()
   repeat Brick.Position = Brick.Position + Vector3.new(0,.1,0) until varb == true
end)