wesleywillems17 Posted May 19, 2013 Share Posted May 19, 2013 hello, Does anyone have a script so that music comes from my car? If you come near the car that you heard music. It should. Pls files to play. It's for my server. I have a bus but i want when players come in it the can hear music. I have some screenshots of my bus on my server: Can somebody script it or gif me a URl where i can download something like that. Greetings, Wesley Link to comment
iPrestege Posted May 19, 2013 Share Posted May 19, 2013 You can make a marker : onClientMarkerHit createMarker isElement destroyElement playSound Link to comment
denny199 Posted May 19, 2013 Share Posted May 19, 2013 You can make a marker :onClientMarkerHit createMarker isElement destroyElement playSound Why doing so hard? Just use playSound3D, and then attach it on the vehicle. As I said, you need to search better: https://community.multitheftauto.com/in ... ls&id=3104 Link to comment
Blaawee Posted May 19, 2013 Share Posted May 19, 2013 #Not tested -- Server local gBus = { [ 1 ] = { ID, x, y, z }, [ 2 ] = { ID, x, y, z } }; local gVeh = { }; addEventHandler ( 'onResourceStart', resourceRoot, function( ) for key, value in ipairs ( gBus ) do gVeh[ key ] = createVehicle( value[ 1 ], value[ 2 ], value[ 3 ], value[ 4 ] ); end triggerClientEvent( root, 'handleSong', root, gVeh[ key ] ); end ); -- Client local soundPath = 'Path goes here'; addEvent ( 'handleSong', true ); addEventHandler ( 'handleSong', root, function( buss ) local x, y, z = getElementPosition ( buss ); local sound = playSound3D ( soundPath, x, y, z, true ); setSoundMaxDistance ( sound, 20 ); attachElements ( sound, buss ); end ); Don't forget to change the id and position. 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