Math.random not working on weld.C0

So i am trying to randomize the position of the bandage on the hand, it works if i set cframe like Cframe.new(0,.0.5,0) but when i try do use math.random it doesnt work. Does anyone know why this happends?


That’s because math.random() can only take integers. To get a random number using non integers though, try using Random.new():NextNumber. It should look something like this:

Weld.C0 = CFrame.new(0, Random.new():NextNumber(-0.5, 0.5), 0)
1 Like

its working now, i didnt know it can only take integers, thank you

1 Like

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