Miren, hice este script:
function musicambientalfunc ( modo )
local encendida = getElementData ( localPlayer, "musica.on" )
if (encendida) then
if ( modo == 1 ) and ( encendida == false ) then
local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]")
setElementData ( localPlayer, "musica.on", true )
elseif ( modo == 2 ) and ( encendida == false ) then
local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]")
setElementData ( localPlayer, "musica.on", true )
elseif ( modo == 3 ) and ( encendida == false ) then
local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]")
setElementData ( localPlayer, "musica.on", true )
elseif ( modo == 4 ) and ( encendida == false ) then
local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]")
setElementData ( localPlayer, "musica.on", true )
elseif ( modo == 5 ) and ( encendida == false ) then
local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]")
setElementData ( localPlayer, "musica.on", true )
elseif ( modo == off ) and ( encendida == true ) then
stopSound(musicambiental)
setElementData ( localPlayer, "musica.on", false )
end
end
end
addCommandHandler ( "ambiente", musicambientalfunc )
function dejarenoffalspawn ( )
setElementData ( localPlayer, "musica.on", false )
end
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), dejarenoffalspawn )
No funciona, al escribir /ambiente 1 no suena nada, pero el debugscript no dice nada, que esta mal?