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

Its not putting it in the CFrame I want it to with math.random?

function makePart()
	local part = Instance.new("Part")
	part.Parent = workspace
	part.CFrame = CFrame.new(math.random(118.701, 2.9, 61.094)), CFrame.new(math.random(60.81, 2.9, 94.995))
end
game.Players.PlayerAdded:Connect(makePart)
makePart()

1 answer

✓ Accepted answer

Like @Fifkee Said, you cannot put more than 3 parameters in math.random(), parameters are something like math.random(0, 0)

You also cannot create multiple CFrames for Cframe[1],[2],[3] if I am explaining that correctly.

0, 0 -- are parameters. You ALWAYS have to use 2 parameters in a math.random() or else it wouldn't run correctly, so something like:

part.CFrame = CFrame.new(math.random(1,600), math.random(1,600), math.random(1,600))

Hope this works!

1 comment

0

??? Math.random() can have an empty paremeter and return a float between 0 and 1.

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