Jump to content

little help


Blaawee

Recommended Posts

local soundsTable = { 
    [1]="sound1.mp3", 
    [2]="sound2.mp3", 
} 
  
function Music() 
   local soundPath = soundsTable[math.random(#soundsTable)] 
   sound = playSound3D("sound/"..tostring(soundPath), 568.89764, -1857.21130, 4.7015, true) 
   setSoundMaxDistance(sound, 30) 
end 
addEventHandler("onClientResourceStart", resourceRoot, Music) 

Link to comment
local soundsTable = { 
    "sound1.mp3", 
    "sound2.mp3", 
} 
  
function Music() 
   local soundPath = soundsTable[math.random(#soundsTable)] 
   sound = playSound3D("sound/"..tostring(soundPath), 568.89764, -1857.21130, 4.7015, true) 
   setSoundMaxDistance(sound, 30) 
end 
addEventHandler("onClientResourceStart", resourceRoot, Music) 

Try that, I don't know if it'll make any difference.

Link to comment

Tripleposting is not allowed, nor is doubleposting.

It is pretty unlikely that it will play the second sound as you only have two sounds. It will mostly just be the other one, hardly the second one.

So, I suggest more sounds.

That script that Castillo made, should be working in my opinion.

What I understood was that the script was working but it only plays the other sound. If it's not working at all, check your meta.xml, debugscript, folders.

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...