Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I use this IF?

Hello! I am making a custom health billboard gui for my game. I can make the gui be inserted into the player and it works! I am trying to make it so that that different parts of the gui are visible depending on the health. with this part I want the first gui to be visible when the health is in between 75 and 100. I don't know How I can make the two in one if statement. I tried <= 100, >=75 but it does not know what the comma is. How can I do this?

if script.Parent.Parent.Humanoid.Health == 100 then -- I want to make this so that it works when it is between 75 and 100
	script.Parent.Light100.Visible = true
else
	script.Parent.Light100.Visible = false
end


1 answer

✓ Accepted answer
if script.Parent.Parent.Humanoid.Health >=75 and script.Parent.Parent.Humanoid.Health <= 100 then

Good luck on your project!

3 comments

0

Okay this clears it up! Thanks!

0

To elaborate (you really should explain your answers), >= means 'greater than or equal to' and <= is the opposite. You probably learned about less-than/greater-than in basic arithmetic. This is just that. It's checking if the health is greater than or equal to 75 and less than or equal to 100.

0

@Perci1, he clearly knows what those mean already. He mentions using those previously in his script, and I do explain my answers most of the time.

This discussion is preserved as it was. New answers, comments, and votes are closed.