Jump to content

help onplayerlogin


SORK>Soxxml

Recommended Posts

44 minutes ago, SORK>Soxxml said:

can anyone tell me what is the problem in it? i try to make song play when player login

  Hide contents

addEventHandler("onPlayerLogin", root, 
function ()  
    
    setTimer(function()
        playSound("song.mp3")
    end, 2000, 1)
end
)

 

-- Server Side --

addEventHandler( 'onPlayerLogin' , root , 
  	function(  )
    	setTimer(
      		function( player )
        		triggerClientEvent( player , 'playSound' , player )
        	end , 2000 , 1 , source
      	)
   end
)

-- Client Side --

addEvent( 'playSound' , true )
addEventHandler( 'playSound' , root , 
	function( )
    	playSound( 'song.mp3' )
    end
)  

 

Link to comment
20 minutes ago, KillerX said:

-- Server Side --

addEventHandler( 'onPlayerLogin' , root , 
  	function(  )
    	setTimer(
      		function( player )
        		triggerClientEvent( player , 'playSound' , player )
        	end , 2000 , 1 , source
      	)
   end
)

-- Client Side --

addEvent( 'playSound' , true )
addEventHandler( 'playSound' , root , 
	function( )
    	playSound( 'song.mp3' )
    end
)  

 

thank you but its not working

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