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

Have a Clone() Problem?

Asked by 10 years ago

How could i get the scripts to not spawn in the same brick and only 5 different scripts to spawn in 5 different bricks? Below i tried to do something along that, but i'm really failing...

Scripts = math.random(5,#Game.Lighting.Scripts)
mod[Scripts]:Clone().Parent = Game.Workspace.Model.Parts
mod[Scripts] = nil
0
You're defining "Scripts" as a number. GoldenPhysics 474 — 10y

1 answer

Log in to vote
-1
Answered by
Gamenew09 180
10 years ago

I believe you should change the first argument in math.random to 1 because the count in the model Scripts is 5 and you are putting 5 for the minimum number value.

The math.random should look like this: math.random(1, #game.Lighting.Scripts)

Please upvote me and put me as the answer if i helped! Thanks!

Ad

Answer this question