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

How can i make audio play randomly? [closed]

Asked by
amalion -3
7 years ago

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?

Closed as Not Constructive by Shawnyg

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
NexeusX 137
7 years ago

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()
Ad