Local variable = Boolean and IntValue or IntValue?

Hi, was looking through the Roblox TouchJump script and saw this. What does this do exactly?

		local minAxis = math.min(screenSize.X, screenSize.Y)
		local isSmallScreen = minAxis <= 500 -- Is the screen to small for big mobile buttons?
		local jumpButtonSize = isSmallScreen and 70 or 120
1 Like

It’s basically setting JumpButtonSize either 70 or 120 depending on what the value of isSmallScreen is:

isSmallScreen = minAxis <= 500 - This sets isSmallScreen to true or false depending on screen size

jumpButtonSize = isSmallScreen and 70 or 120
This is a quicker way of writing
if isSmallScreen==true then jumpButtonSize=70 else jumpButtonSize=120 end

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