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

Have a Clone() Problem?

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

1 comment

0

You're defining "Scripts" as a number.

1 answer

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!

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