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

Number map in roblox? (Upper and lower bounds)

Hi there. Is it possible to map number such as if X is 1023 then X1 is 255 and then get the values in between? pretty much upper and lower bounds

a C style Syntax would be: map(value, fromLow, fromHigh, toLow, toHigh)

Thanks,

1 answer

Fixed! Written my own function

function  map( x,in_min,in_max,out_min,out_max)
	  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
end

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