Jump to content

Team Chat


ZeyadGTX

Recommended Posts

Hey Guys , i have script which make sound in chat , but i have something i want this sounds Plays onTeamChat only

because it plays on Any Chat

Client :)

function playSonido() 
local sound = playSound("chat.mp3",false) 
setSoundVolume(sound, 0.9) 
end 
addEvent("sonido",true) 
addEventHandler("sonido",getRootElement(),playSonido) 

Server

function chat (thePlayer) 
triggerClientEvent("sonido",getRootElement()) 
end 
addEventHandler ( "onPlayerChat", getRootElement(), chat ) 

Link to comment

Next Time , Make sure your in the Scripting Section ,

addEventHandler('onPlayerChat', root, 
function ( msg, msgType ) 
if ( msgType == 2 ) then 
    triggerClientEvent(source, 'Play', source ) 
     end 
   end 
  ) 
   
   
---ServerSide  
addEvent('Play', true ) 
addEventHandler('Play', root, 
function ( ) 
local sound = playSound("chat.mp3" ) 
setSoundVolume(sound, 1.0)  
    end 
) 
Link to comment
  • Moderators
We have helped you with 2 scripts for teamchat already and still you don't know it? Look into the scripts we have 'helped' you with and go understand it. I think you are not even taking time to look into it.

Hij wil het ook niet, dit is alleen maar bedelen.

Link to comment
We have helped you with 2 scripts for teamchat already and still you don't know it? Look into the scripts we have 'helped' you with and go understand it. I think you are not even taking time to look into it.

Hij wil het ook niet, dit is alleen maar bedelen.

Yup.

Link to comment

Not Working , i added this to server side

addEventHandler('onPlayerChat', root, 
function ( msg, msgType ) 
if ( msgType == 2 ) then 
    triggerClientEvent(source, 'Play', source ) 
     end 
   end 
  ) 
  
  
---ServerSide 
addEvent('Play', true ) 
addEventHandler('Play', root, 
function ( ) 
local sound = playSound("chat.mp3" ) 
setSoundVolume(sound, 1.0) 
    end 
) 

Link to comment

Server side

addEventHandler('onPlayerChat', root, 
function ( msg, msgType ) 
if ( msgType == 2 ) then 
    triggerClientEvent(source, 'Play', source ) 
     end 
   end 
  ) 
  
  
---ServerSide 
addEvent('Play', true ) 
addEventHandler('Play', root, 
function ( ) 
local sound = playSound("chat.mp3" ) 
setSoundVolume(sound, 1.0) 
    end 
) 

Client

function playSonido() 
local sound = playSound("chat.mp3",false) 
setSoundVolume(sound, 0.9) 
end 
addEvent("sonido",true) 
addEventHandler("sonido",getRootElement(),playSonido) 

Link to comment

this is serverSide ,

addEventHandler('onPlayerChat', root, 
function ( msg, msgType ) 
if ( msgType == 2 ) then 
    triggerClientEvent(source, 'Play', source ) 
     end 
   end 
  ) 

ClientSide ,

addEvent('Play', true ) 
addEventHandler('Play', root, 
function ( ) 
local sound = playSound("chat.mp3" ) 
setSoundVolume(sound, 1.0) 
    end 
) 

and change the misc to script

Link to comment

Client Side !

addEvent( "PlaySound", true ) 
addEventHandler( "PlaySound", root, function (  ) 
   if ( isElement( sound ) ) then destroyElement( sound ) end 
   local sound = playSound( "chat.mp3" ) 
   setSoundVolume( sound, 1.0 ) 
end ) 

Server Side !

addEventHandler( "onPlayerChat", root, function ( msg, msgType ) 
  if ( msg ~= "" and msgType == 2 ) then 
         triggerClientEvent( "PlaySound", root ) 
     end 
end ) 
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...