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

Why wont these random CFrame angles work?

local	Debri = Instance.new("Part")
		Debri.BrickColor = part.BrickColor
		Debri.Material = part.Material
		Debri.Anchored = true
		Debri.CanCollide = true	
		Debri.Size = Vector3.new(math.random(5, 20), 4, math.random(5, 20))
		Debri.CFrame = CFrame.new(Carbons[DMGSelect].Position) * CFrame.Angles(math.random(math.pi/1.2 , -math.pi/1.2), math.random(math.pi/1.2 , -math.pi/1.2), math.random(math.pi/1.2 , -math.pi/1.2))
		Debri.Parent = workspace	
		Debri.TopSurface = 10
		Debri.BottomSurface = 10

It keeps giving me an error that says Players.Player.Backpack.DebriScript:07: bad argument #2 to 'random' (interval is empty)

I don't know why this happens please help.

1 answer

✓ Accepted answer

Puppy thinks that the first bit of random has to be smaller than the second bit so maybe put the pi first but maybe it is not that puppy has an idea

math.random(math.pi/1.2 , -math.pi/1.2)

Should become

(math.random()-0.5)*math.pi*2.4

that will be better because random doesn't work on decimals


woof woof

7 comments

0

I deleted my answer. You're right, math.random does not work on decimals.

0

c: puppy knows

0

:)

0

... Please don't use the third person

0

Puppy is awesome!

0

puppy is using the first puppy because he is the first puppy

0

#PuppySavagery

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