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

Math.Random Interval Error How to fix? [solved]

Asked by 5 years ago
Edited by Shawnyg 5 years ago

So I have this error:

http://prntscr.com/kvnbnc

Here is my code

v.Position = Player.Character.UpperTorso.Position - Vector3.new(math.random(1,-20), -18, math.random(1,20))

I actually have no clue why I'm getting this error, it seems that my code looks right but it just doesn't work.. How do I solve this?

1
The error is the first call to math.random. The smallest number goes first, the biggest last. So you'd do math.random(-20, 1) User#19524 175 — 5y
0
Thanks man! LuaBloxCodeSlash 1 — 5y
0
Edit: Added the solved tag Shawnyg 4330 — 5y

Answer this question