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

How to make a random x point for a volcano? [SOLVED]

I have made a script(not even close to done) and when I make the x point random, it uses the same point each time. Here it is:

local serverstorage = game:GetService("ServerStorage")
local f = game.ServerStorage.Fire
local fCopy = f
local i = 1
local j = 1
local y = 0
local z = 15

repeat
	math.randomseed(tick())
	for _ = 0, 1 do
		x = (math.random(100))
		wait()
		break
	end

		print(x)
		f.Position = Vector3.new(x, y, z)
		local fCopy = f:Clone()
   		fCopy.Parent = game.Workspace
		wait(.1)
		i = i + 1
		print(i)
		
	
until i==100
	repeat
	game.Workspace.Fire:Remove()
	j = j + 50
	until j == 1000

I also have the blocks disappear after about 10 seconds. I also have it print the x position and it turns up the same every time. Try to make the fix as simple as possible because I just started coding Lua a week ago.

1 comment

0

I had the same problem awhile ago, the same time frame always uses the same (math.random), in a way its not completely random. Maybe you could make a script that makes the volcano when the first player to join the game moves,

1 answer

I think your problem is that you only passed 1 argument to math.random. Try this:

x = (math.random(0, 100))

1 comment

0

And then i realize it's solved. Meh

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