Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont these random CFrame angles work?

Asked by
neoG457 315 Moderation Voter
9 years ago
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

Log in to vote
2
Answered by 9 years ago

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
0
I deleted my answer. You're right, math.random does not work on decimals. XAXA 1569 — 9y
0
c: puppy knows CailThePuppy 70 — 9y
0
:) XAXA 1569 — 9y
0
... Please don't use the third person BlueTaslem 18071 — 9y
View all comments (3 more)
0
Puppy is awesome! neoG457 315 — 9y
0
puppy is using the first puppy because he is the first puppy CailThePuppy 70 — 9y
0
#PuppySavagery neoG457 315 — 9y
Ad

Answer this question