outputChatBox client side has no visibleTo argument.
-- client side:
addEvent ( "reproducir", true )
addEventHandler ( "reproducir", root,
function ( )
if getKeyState ( "lctrl" ) then
if ( not isElement ( r1 ) ) then
r1 = playSound ( "http://ecrd.com/files/2/tgyb1wnqsjfu2w/J%20King%20&%20Maximan%20Ft%20%C3%91engo%20Flow,%20Arcangel,%20De%20La%20Ghetto,%20Randy,%20Alexis,%20Jamsha%20Y%20Chyno%20Nyno%20-%20Siente%20(Official%20Remix)%20(ECRD.Com).mp3" )
if ( r1 ) then
outputChatBox ( "La Musica esta empezando por ".. getPlayerName ( source ), 255, 255, 255, true )
else
outputChatBox ( "La Musica ya esta sonando", 255, 255, 255, true )
end
end
end
end
)
addEvent ( "detener", true )
addEventHandler ( "detener", root,
function ( )
if getKeyState ( "lctrl" ) then
if isElement ( r1 ) then
destroyElement ( r1 )
outputChatBox ( "La Musica esta parando por ".. getPlayerName ( source ), 255, 255, 255, true )
else
outputChatBox ( "La Musica no esta sonando !", 255, 255, 255, true )
end
end
end
)
-- server side:
addEventHandler ( "onResourceStart", resourceRoot,
function ( )
for index, thePlayer in ipairs ( getElementsByType ( "player" ) ) do
bindKey ( thePlayer, "m", "down", startMusic )
bindKey ( thePlayer, "n", "down", stopMusic )
end
end
)
function startMusic ( thePlayer )
triggerClientEvent ( "reproducir", root, thePlayer )
end
function stopMusic ( thePlayer )
triggerClientEvent ( "detener", root, thePlayer )
end
Try that.