✓ Accepted answer
You probably want to use math.random() instead.
cg.Orientation = Vector3.new(
cg.Orientation.X + math.random(-10,10),
cg.Orientation.Y + math.random(-10,10),
cg.Orientation.Z + math.random(-10,10)
)
Random is more for when you have the same random numbers each time.
This will print the same 30 numbers each time because we have the seed 1337
Your code doesn't work because you are creating a object of the type Random , not getting the random number from the object. random:NextInteger (1,10) gets the random number.
local seed = 1337
local random = Random.new(seed)
for i = 1, 30 do
print(random:NextInteger (1,10))
end
Technically we could use random seed, but we want new random numbers each time, so that's a lot more code to write.
2 comments
yo i honestly feel so stupid for using the new random thing instead of just "math.random"
you can use random.new() but its more work and that's not what it's made for