Is there a good way to continuously generate random numbers?

Right now I’m just using this and it works. Is there any other way to generate new random numbers for the variables other than redefining the variables every time?

	if Game1.Value == 1 then
		repeat
			local BrickNumber  = math.ceil(Timer.Value/50)
			DanceFloor.Parent = workspace.Stage1
			fart.Parent = workspace
			fart2.Parent = workspace
			fart3.Parent = workspace
			fz = math.random(-47,51)
			fx = math.random(-101,-5)
			x2 = math.random(-101,-5)
			z2 = math.random(-47,51)
			x3 = math.random(-101,-5)
			z3 = math.random(-47,51)

			fart.CFrame = CFrame.new(fx,2,fz)
			fart2.CFrame = CFrame.new(x2,2,z2)
			fart3.CFrame = CFrame.new(x3,2,z3)
			glowTween()
			DanceFloor.Parent = nil
			wait(2)
		until Game1.Value == 0
	end
1 Like

nevermind… i forgot i could just put math.random() in the CFrame.new()

I don’t understand what you mean, but you can just do
math.random(-os.clock(),os.clock())

1 Like