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

How do i randomize between 0 and 0.8?

I wanted to make part change its transparency between 0 and 0.8 but for some reason it only selects 0

Here is my script

while wait(0.1) do
	local randomize = math.random(0, 0.8)
	print(randomize)
end

1 answer

✓ Accepted answer
local randomize = math.random(0, 8) / 10
-- or
local randomize = Random.new():NextNumber(0, 0.8)

1 comment

0

math.random only generates whole numbers (0, 1, 2, 3, 4) not numbers like 2.22, the only exception is math.random() which generates random number from 0 to 1

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