Narutimmy Posted November 15, 2013 Share Posted November 15, 2013 Bueno tengo este script que ase que solo se escuchen si estan en un radio de 10 metros pero no funciona local nearbyPlayers = {} addEventHandler( 'onPlayerVoiceStart', root, function() local chatRadius = 10 local posX, posY, posZ = getElementPosition( source ) local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) destroyElement( chatSphere ) local empty = exports.voice:getNextEmptyChannel ( ) exports.voice:setPlayerChannel(source, empty) for index, player in ipairs (nearbyPlayers) do exports.voice:setPlayerChannel(player, empty) end end) addEventHandler("onPlayerVoiceStop",root, function() exports.voice:setPlayerChannel(source) for index, player in ipairs (nearbyPlayers) do exports.voice:setPlayerChannel(player) end nearbyPlayers = {} end) Link to comment
Recommended Posts