attachElement not work. i dont know how i can solve this
This clientside script is called by server root but still not work all player only who play music hear that
unction startMusicFinally(Playerx,Playery,Playerz,MusicLink,MusicPlayer)
Vehicle = getPedOccupiedVehicle (localPlayer)
if Vehicle then
stopSound(speakerSound [localPlayerName])
speakerSound [localPlayerName]= playSound3D(MusicLink,Playerx,Playery,Playerz,true)
attachElements(speakerSound [localPlayerName],Vehicle,0,0,0.5)
attachTimer = setTimer(KeepSound,50,0)
else
stopSound(speakerSound [localPlayerName])
speakerSound [localPlayerName]= playSound3D(MusicLink,Playerx,Playery,Playerz,true)
end
end
function KeepSound()
attachElements(speakerSound [localPlayerName],Vehicle,0,0,0.5)
end