Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Number map in roblox? (Upper and lower bounds)

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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
Ad

Answer this question