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

Why is this happening?ServerScriptService.Script:7: bad argument #2 to 'random' (interval is empty)

Asked by 7 years ago

The code is Starts Here:

local explosionPart = game.ServerStorage.ExplosionPart local explosionPartDropHeight = 100

local function createExplosionPartCopy() local explosionPartCopy = explosionPart:Clone() explosionPartCopy.Parent = game.Workspace local xPosition = math.random(440, 292) local zPosition = math.random(440, 292) explosionPartCopy.Position = Vector3.new(xPosition, explosionPartDropHeight, zPosition) end

while true do createExplosionPartCopy() wait (0.7) end

Ends Here. After i run it comes up with this: ServerScriptService.Script:7: bad argument #2 to 'random' (interval is empty) Pls someone help.

0
Format your code in Lua Code block. Goulstem 8144 — 7y
0
And accept his answer Goulstem 8144 — 7y

1 answer

Log in to vote
3
Answered by 7 years ago

You have to have the smallest number first, and the largest number second.

math.random(292, 440)
0
omg thank you sooo much BunnyJumpGaming 0 — 7y
Ad

Answer this question