Jump to content

Ped Sound Help


S7waj

Recommended Posts

  • S7waj changed the title to Ped Sound Help
local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, true) 
local uSound = playSound3D('http://977music.com/itunes/80s.pls', 2498, -1659, 12) 

 

You can either download the sound from the internet and then redirect it with the first code i copied or if you want to stream it from somewhere else you use the second code. I'm no scripter myself so there's not much i can do to help you more on this. Hope i could help you out :)

Link to comment
13 minutes ago, Gribixtugaz said:

local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, true) 

local uSound = playSound3D('http://977music.com/itunes/80s.pls', 2498, -1659, 12) 

 

You can either download the sound from the internet and then redirect it with the first code i copied or if you want to stream it from somewhere else you use the second code. I'm no scripter myself so there's not much i can do to help you more on this. Hope i could help you out :)

man i said i want it on ped not on location ( when ped move sound follow him )

Edited by S7waj
Link to comment
4 hours ago, Sisqo0 said:

Ok i understood what you wanted


--Client
function attachsound () 
   local ped = createPed(120,0,0,0) 
   local x,y,z = getElementPosition( ped )
   local sound = playSound3D( "sound", x, y, z, true) 
   attachElements ( sound, ped) 
end

 

i will trry it

 

Where's the Wrong Here?

addEvent ( "tanks", true )
addEventHandler ( "tanks", root,
function ( ) 
   local x,y,z = getElementPosition( tanks )
   local sound = playSound3D( "tank_spawn.wav", x,y,z, true) 
   attachElements ( sound, tanks) 
end
)

 

 

Link to comment
local xPos,yPos,zPos
local sound

function onWasted()
if isElement(sound) then destroyElement(sound) end
sound = playSound3D( "tank_spawn.wav", xPos,yPos,zPos)
setSoundMaxDistance(sound, 100)
end
addEventHandler("onClientPedWasted", getRootElement(), onWasted)

function onSpawn()
if isElement(sound) then destroyElement(sound) end
sound = playSound3D( "tank_spawn.wav", xPos,yPos,zPos)
setSoundMaxDistance(sound, 100)
end
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), onSpawn )

function position()
if isElement(sound) then
xPos,yPos,zPos = getElementPosition(localPlayer)
end
end
addEventHandler('onClientRender',root,position)

use this and check your audio file extension if it .wav or not

 

 

12 hours ago, S7waj said:

i will trry it

 

Where's the Wrong Here?


addEvent ( "tanks", true )
addEventHandler ( "tanks", root,
function ( ) 
   local x,y,z = getElementPosition( tanks )
   local sound = playSound3D( "tank_spawn.wav", x,y,z, true) 
   attachElements ( sound, tanks) 
end
)

 

 

here you try to get position and attach elements to a nil value 'tanks'

Link to comment
1 minute ago, MrKAREEM said:

local xPos,yPos,zPos
local sound

function onWasted()
if isElement(sound) then destroyElement(sound) end
sound = playSound3D( "tank_spawn.wav", xPos,yPos,zPos)
setSoundMaxDistance(sound, 100)
end
addEventHandler("onClientPedWasted", getRootElement(), onWasted)

function onSpawn()
if isElement(sound) then destroyElement(sound) end
sound = playSound3D( "tank_spawn.wav", xPos,yPos,zPos)
setSoundMaxDistance(sound, 100)
end
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), onSpawn )

function position()
if isElement(sound) then
xPos,yPos,zPos = getElementPosition(localPlayer)
end
end
addEventHandler('onClientRender',root,position)

use this and check your audio file extension if it .wav or not

 

 

here you try to get position and attach elements to a nil value 'tanks'

ok MrKAREEM I will try it + do you remember me? i'am itsMessi on FFS Gaming

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