Jump to content

What i did Wrong?


SnoopCat

Recommended Posts

hey hello i need a script to race when a player its ready to race play a sound to advice i need to know what i did wrong here plz if any 1 can help me..

function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) 
  
    local sound = playSound("1.wav") 
    setSoundVolume(sound, 0.5) 
end 
  
addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) 

Link to comment
function player_Spawn ( hisTeam )-- Other event, other parameters... 
     local sound = playSound("1.wav",false) -- I suggest add "false", for prevent a loop. 
     setSoundVolume(sound, 0.5) 
end 
   
addEventHandler ( "onClientPlayerSpawn", getRootElement(), player_Spawn ) --"onClientPlayerSpawn", not "onPlayerSpawn". 
  

Well, easy. playSound is only-client-side function, so you can't use "onPlayerSpawn" event, you must use the client event.

Link to comment
function player_Spawn ( hisTeam )-- Other event, other parameters... 
     local sound = playSound("1.wav",false) -- I suggest add "false", for prevent a loop. 
     setSoundVolume(sound, 0.5) 
end 
   
addEventHandler ( "onClientPlayerSpawn", getRootElement(), player_Spawn ) --"onClientPlayerSpawn", not "onPlayerSpawn". 
  

Well, easy. playSound is only-client-side function, so you can't use "onPlayerSpawn" event, you must use the client event.

well isnt working :?:?:?

i mean how to do it sound when a player its ready to race ORR when a player join server i tried to do it but isnt working

Link to comment

its ok i do they work BUTTT i have a new problem.... if 2 players on server the sound plays 2 time if 3 then 3 times at same time when a player do spawn at map :S

and the thing i want its play them separately and u can only hear the sound when ur ready and NOT when others are ready too.

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...