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

Block spawn randomization(like bullet spread)?

Asked by 10 years ago

Hello, if I make a lightning script I will only be able to have just 1 form of it, like 1 order of the shapes(sizes and everything). How would I make it so that it will randomize the lengths and positions and still have them connect and hitting the target?

1 answer

Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago

Use this

math.Random()

Math.Random() make's it random

targetspos = {1,2,3} -- Change it to the position of the bricks.
x =  math.random(1, #targetspos)
print(x)

As you can see you can put the position of the bricks in targetpos to it changes the position of the lightning randomly, by using math.random.

Ad

Answer this question