How to get a number between a negative and a positive number

So I am trying to get a number between a negative and a positive number but it just rounds.

I have tried this:

local random = Random.new()
local changeCooldown = (random:NextInteger(-0.5, 0.5))

but that rounds the number.

1 Like

For those wondering, this is how he did it:

local random = Random.new();
local changeCooldown = random:NextNumber() - 0.5;

That’ll get you a decimal between -0.5 to 0.5

2 Likes

I used :NextNumber and it worked!

1 Like

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