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

Help with math.random?

I am not good with math.random() This works but I want the part to be everywhere.

	--\\Made by PreyStar//--
--I am not good w/ math.random()--

while true do
	wait(1)
	Part = Instance.new("Part", game.Workspace)
	Part.Anchored = true
	Part.Position = Vector3.new(math.random(100))
	
end

1 comment

0

This Question has been answered multiple times, please use the Websites search engine to see if your Question has already been answered. :) Search Engine - https://scriptinghelpers.org/search

1 answer

You need to add another value to compare it to, 1,100 would get a random value between 1 and 100. You also need to add it 2 more time's since there's a X Y and Z value in Position's.

Sorry I can't explain it any better. =\

    --\\Made by PreyStar//--
--I am not good w/ math.random()--

while wait(1) do -- Replaced while true do with while wait(1) do
	Part = Instance.new("Part", game.Workspace)
	Part.Anchored = true
	Part.Position = Vector3.new(math.random(1,100),math.random(1,100),math.random(1,100))
end

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