I'm trying to get a random middle point between the base and somewhere far, which is also slightly random.
local bezierStart = workspace.Base.CFrame+Vector3.new(math.random(-4000,4000),math.random(2000,2000),math.random(-4000,4000)) local z1=bezierStart.p.Z/2 local z2=bezierStart.p.Z/5 local z3=math.random(z1,z2) print(z3)
This works half the time. Refer to https://i.gyazo.com/d6763e26d1a447f9fae83d4dfe8c639f.mp4
any help would be appreciated - thank you
Your z1 is larger than z2, therefore the randomization doesn't work. You divide z1 by 2 and z2 by 5. The first number in math.random needs to be lower than the other one, so it'll find a number between the lowest to the highest number.