Jump to content

Original Sound Effects


ThePCGuy

Recommended Posts

A other question, how can i make a list of groups so it fetches it from there instead of doing this:

setWorldSoundEnabled( 5, false )

setWorldSoundEnabled( 5, 31, true )

setWorldSoundEnabled( 5, 32, true )

But doing like:

numberOfGroups = {

{5},

{4}}

setWorldSoundEnabled( numberOfGroups, false )

I know its totally wrong but i dont know how to do something like that since i am new to scripting.

Link to comment

Why is this not working ?

local numberOfGroups = { 5, 3 } 
local numberOfIndex = { 5, 4, 3, 53, 14, 33 } 
  
addEventHandler("onClientResourceStart", resourceRoot, function() 
    setWorldSoundEnabled ( #numberOfGroups, #numberOfIndex, false ) 
    setDevelopmentMode (true) 
  end 
end 
) 

Link to comment

I did a mistake on code, my bad, but now I fixed it.

local numberOfGroups = { 5, 3 } 
local numberOfIndex = { 5, 4, 3, 53, 14, 33 } 
  
addEventHandler("onClientResourceStart", resourceRoot, function() 
    setWorldSoundEnabled ( numberOfGroups [ ( #numberOfGroups ) ], numberOfIndex [ ( #numberOfIndex ) ], false ) 
    setDevelopmentMode (true) 
end 
) 

Edited by Guest
Link to comment
local numberOfIndex = { 5, 4, 3, 53, 14, 33 } 
  
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        for _, index in ipairs ( numberOfIndex ) do 
            setWorldSoundEnabled ( 3, index, false ) 
            setWorldSoundEnabled ( 5, index, false ) 
        end 
        setDevelopmentMode ( true ) 
    end 
) 

Try it.

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