Jump to content

Help


benwilkins

Recommended Posts

Hey guys, trying to make some code:

function setBinds() 
    bindKey(source, "O", "down", toggleSirens) 
end 
  
 function toggleSirens() 
local sound = playSound("siren.mp3") 
setSoundVolume(sound, 0.5) 
  
  
end 
  
  
  

I have the siren.mp3 in the resources/sirens folder. and have this in the meta file:

I press O and it just doesnt do anything.

Link to comment

1. you never fired setBinds function

2. playSound is client side while you have used bindKey in server side syntax. I Don't know which one you set in meta.xml

3. Why did you create new topic when you have already posted topic about these sirens? Also i gave you bigger reply, and i listed all functions you will need to use to make your script work like you want it to. you used just two of them.

5. And i think you are very bad at lua. Go to wiki.multitheftauto.com and read scripting tutorial once again. Also read about debugging - you will need it many times. Keep reading until you understand it. If you don't understand the basics - don't even try to write scripts - you will just keep failing and getting angry

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