SnoopCat Posted October 16, 2010 Share Posted October 16, 2010 hey hello again im sorry to post a thing like same as others i posted but i need help cuz this time its not working well i want to do a thing like when a player write somthing on chat plays a sound like a Bip! here its my code LUA function chat (thePlayer) local sound = playSound("chat.mp3",false) setSoundVolume(sound, 0.9) end addEventHandler ( "onPlayerChat", getLocalPlayer(), chat ) META <meta> <info author="$VL$FuGa" description="this script plays sound when player chats" info="mod" type="misc" version="1.0.4" /> <script src="sonido.lua" type="client"/> <file src="chat.mp3" /> </meta> Link to comment
Castillo Posted October 16, 2010 Share Posted October 16, 2010 you are messing server event with client functions this won't work of course, you can do triggerClientEvent server: function chat (thePlayer) triggerClientEvent("sonido",getRootElement()) end addEventHandler ( "onPlayerChat", getRootElement(), chat ) client: function playSonido() local sound = playSound("chat.mp3",false) setSoundVolume(sound, 0.9) end addEvent("sonido",true) addEventHandler("sonido",getRootElement(),playSonido) meta: <meta> <info author="$VL$FuGa" description="this script plays sound when player chats" info="mod" type="misc" version="1.0.4" /> <script src="sonidoC.lua" type="client"/> <script src="sonidoS.lua" type="server"/> <file src="chat.mp3" /> </meta> Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now