I have a audio on 3 different bricks (B1, B2, B3) I want that audio to play randomly on each brick.. How do i do that?
COMMUNITY QUESTION
How can i make audio play randomly?
1 answer
Here try this, it should work o.o
B1 = game.Workspace.B1
B2 = game.Workspace.B2
B3 = game.Workspace.B3
--I put it into a table
Table1 = {B1,B2,B3}
--Random function
Num = math.random(1,#Table1)
--Choose item
ITEM = Table1[Num]
--Play Audio
ITEM.Sound:Play()
--or :Stop()
This discussion is preserved as it was. New answers, comments, and votes are closed.
