Error trying to compare y positions with numbers

So Im trying to make a script where when the players torso’s y co-ordinate is above a specific number it shows a gui. It then doesn’t show the gui again until they go below the specific number and go back up. I realize now I probably didn’t explain it well

while true do
	Value = 0
	Player = game.Players.LocalPlayer
	wait(0.1)
	Character = Player.Character
	print(Value)
	if Character.Torso.Position.y > 1000 and Value == 0 then
		Value = 1
		local z = Player.PlayerGui.Island.TextLabel
		z.Text = "Sky Island"
		z.Position = UDim2.new(0.288, 1000, 0.157, 0)
		z:TweenPosition(UDim2.new(0.5,-170,0.5,-175),"Out","Quint",1,true) 
		wait(3)
		z:TweenPosition(UDim2.new(0.5,-1000,0.5,-175),"Out","Quint",1,true)
		z.Position = UDim2.new(0.288, 1000, 0.157, 0)
	elseif
		Character.Torso.Position.y < 100 and Value == 1 then
		Value = 0
	end
end

When I go above the position it shows the Gui telling me I’ve reached sky island but it constantly shows it to me till I go back down the specific co-ordinate. I tried to add the values to fix it but they didn’t really help.

https://gyazo.com/9c82659f214a49ee597ed3057ed69ef2

It doesn’t show any errors in the output. Is their another way I can do this?

Put the Value variable outside the loop and it should fix it.