Jump to content

math.random chooses the same text always


Cronoss

Recommended Posts

Basically I wanted to create an script that could make possible choose a random song from the table "songs". The problem is that the math.random always choose the same song, I don't know what it's happening;

(client-side)

--------------Table-------------------------
local songs = {"a.mp3", "b.mp3", "c.mp3"}



---------------This part chooses randomly the song
play = songs[math.random(#songs)]
song = playSound(play, true)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...