#Play an randomized sound

1 messages · Page 1 of 1 (latest)

woven crypt
#

I'm making a 2011 recreation of Talking Tom. I want him to play second or first sound randomly when a click detector is detected

tall sedge
#

math.random

shy basin
tall sedge
woven crypt
plain rockBOT
#

studio** You are now Level 1! **studio

shy basin
tall sedge
woven crypt
shy basin
main walrus
plain rockBOT
#

studio** You are now Level 11! **studio

tall sedge
woven crypt
tall sedge
woven crypt
#

i did it like this

local rng_sound = math.random(2,3)

if rng_sound == 3 then
sound:Play()
else
sound2:Play()

but it always play the first sound instead

#

wait i have found a simliar video brb

#

ok it works but it plays the second sound if i set math.random(2, #folder) or first sound if i do math.random(1, #folder)

#

wait im just being dumb

#

im not supposed to do it like that

#

bruh

#

ok i founded a solution