Reflex# Posted May 14, 2012 Posted May 14, 2012 function muteMapMusic() if not mapMusicMute then mapMusicMute = true checkForExternalSounds() outputChatBox("#ff9d00[OFF]#FFFFFFMap music is now #FF0000disabled#FFFFFF, press M to enable it.",255,255,255,true) else mapMusicMute = false outputChatBox("#ff9d00[ON]#FFFFFFMap music is now #00FF00enabled#FFFFFF, press M to disable it.",255,255,255,true) for i,k in ipairs(pausedExternalSounds) do if isElement(k) then setSoundPaused(k,false) end end checkForExternalSounds() end end bindKey("m","down",muteMapMusic) WARNING:Bad argument @'bindKey'
Castillo Posted May 14, 2012 Posted May 14, 2012 Check in the meta.xml if the script is set to server side or client side. P.S: It must be client side ( type = "client" ).
Reflex# Posted May 14, 2012 Author Posted May 14, 2012 Check in the meta.xml if the script is set to server side or client side.P.S: It must be client side ( type = "client" ). All work thx i forgot But when map music disabled in chatbox dont write message,but when enable,all work
Castillo Posted May 14, 2012 Posted May 14, 2012 local mapMusicMute = false function muteMapMusic ( ) if ( not mapMusicMute ) then mapMusicMute = true checkForExternalSounds ( ) outputChatBox ( "#ff9d00[OFF]#FFFFFFMap music is now #FF0000disabled#FFFFFF, press M to enable it.", 255, 255, 255, true ) else mapMusicMute = false outputChatBox ( "#ff9d00[ON]#FFFFFFMap music is now #00FF00enabled#FFFFFF, press M to disable it.", 255, 255, 255, true ) for i, k in ipairs ( pausedExternalSounds ) do if isElement ( k ) then setSoundPaused ( k, false ) end end checkForExternalSounds ( ) end end bindKey ( "m","down",muteMapMusic )
Reflex# Posted May 14, 2012 Author Posted May 14, 2012 (edited) local mapMusicMute = false function muteMapMusic ( ) if ( not mapMusicMute ) then mapMusicMute = true checkForExternalSounds ( ) outputChatBox ( "#ff9d00[OFF]#FFFFFFMap music is now #FF0000disabled#FFFFFF, press M to enable it.", 255, 255, 255, true ) else mapMusicMute = false outputChatBox ( "#ff9d00[ON]#FFFFFFMap music is now #00FF00enabled#FFFFFF, press M to disable it.", 255, 255, 255, true ) for i, k in ipairs ( pausedExternalSounds ) do if isElement ( k ) then setSoundPaused ( k, false ) end end checkForExternalSounds ( ) end end bindKey ( "m","down",muteMapMusic ) Dont work debugscript: ERROR: script.lua : 6 :attempt to call global 'checkForExternalSounds(a nil value)' ERROR: script.lua :11:bad argument #1 to 'ipairs'(table expected,got nil) Edited May 14, 2012 by Guest
Castillo Posted May 14, 2012 Posted May 14, 2012 You have the function: checkForExternalSounds ( ) right? because if you use it without it, it'll just "enable" it.
Reflex# Posted May 14, 2012 Author Posted May 14, 2012 You have the function: checkForExternalSounds ( ) right? because if you use it without it, it'll just "enable" it. right,when music enabled it write in chat,but when disabled,write nothing
Castillo Posted May 14, 2012 Posted May 14, 2012 Is this script even yours? or you stole it from some server?
Reflex# Posted May 15, 2012 Author Posted May 15, 2012 Is this script even yours? or you stole it from some server? My friend give it to me and say that this script dont work.I try to fix it..but as you see...not good I think he do this. idk
Castillo Posted May 15, 2012 Posted May 15, 2012 That's the oldest story ever: "A friend gave it to me, it wasn't me!". We don't help people with stolen scripts. Topic locked.
Recommended Posts