Make Frame Visible if in certain sections?

Essentially I have an obby and I made frames for each section where if you are in, lets say the very easy section which is 26-50, it’ll pop up on top to say you are in that section:


The only problem is that I am not sure how to set it up to where it checks within those stages because this is the way I am doing it now:

players.PlayerAdded:Connect(function(player)
	local playerStats = player:WaitForChild("leaderstats")
	local stageStat = playerStats:WaitForChild("Stage")
	while task.wait(1) do
		if stageStat.Value <= 50 then
			player.PlayerGui.StageSelector.VERYEASYFrame.Visible = true
		else
			player.PlayerGui.StageSelector.VERYEASYFrame.Visible = false
		end
	end
end)

For the:

if stageStat.Value <= 50

Is there a way to make it something like this:

if stageStat.Value == (26-50)

I just want it to display between those stages but by doing the “<=” it just makes it so that whatever frame shows up since the term is so broad. Any help is much appreciated!

maybe something like,

if stageStat.Value >= 50 and stageStat.Value <= 26 then
     --code
end
2 Likes

Oh, okay! I’ll try that out! Thanks for the suggestion

1 Like

So this method worked but it was actually switched with the signs so like this instead:

if stageStat.Value <=50 and stageStat.Value >=26 then

Thanks for the direction! It helped a lot!

1 Like

i cant do basic logic sorry lol

2 Likes

No! It’s totally okay! What you put really helped me regardless so thanks anyways :smiley:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.