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
	Character = Player.Character
	if Character.Torso.Position.y > 1000 and Value == 0 then
		Value = 1
		local z = Player.PlayerGui.Island.TextLabel
		z.Text = "Sky Island"
		z.Position =, 1000, 0.157, 0)
		z.Position =, 1000, 0.157, 0)
		Character.Torso.Position.y < 100 and Value == 1 then
		Value = 0

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.

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.