Mimimiguel Posted March 24, 2012 Posted March 24, 2012 Hola a todos! Bueno, tengo un problema con OnPlayerClick, de hecho, no me funciona, también he intentado con OnElementClicked pero tampoco me va, bueno, la idea es que llegue un evento al cliente que abrirá una interfaz, pero no me funciona: carl = createPed( 0, 224.99, 1289.12, 1082.24, 180 ) setElementInterior( carl, 1 ) setElementDimension( carl, 122 ) addEventHandler( "OnPlayerClick", getRootElement(), function ( button, state, player ) if player == carl then outputChatBox( "Carl dice: ¿Qué necesitas?", source, 255, 255, 255 ) triggerClientEvent( "useCarl", source) end end ) Ese es el script, yo no entiendo por qué no quiere funcionar. Tampoco da errores en debugscript 3. El script lo ejecuta el servidor (serverside). Un saludo, suerte y gracias. Canal de Youtube Bayside RP
Castillo Posted March 24, 2012 Posted March 24, 2012 Lua es entre mayúsculas y minúsculas. carl = createPed( 0, 224.99, 1289.12, 1082.24, 180 ) setElementInterior( carl, 1 ) setElementDimension( carl, 122 ) addEventHandler( "onPlayerClick", getRootElement(), -- Es 'onPlayerClick, no 'OnPlayerClick'. function ( button, state, player ) if ( player and player == carl ) then outputChatBox( "Carl dice: ¿Qué necesitas?", source, 255, 255, 255 ) triggerClientEvent( "useCarl", source) end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Mimimiguel Posted March 24, 2012 Author Posted March 24, 2012 :feellikeanidiot: muchas gracias, no pensé que fuese un error tan tonto. Canal de Youtube Bayside RP
Castillo Posted March 24, 2012 Posted March 24, 2012 De nada. P.D: A todos nos pasan cosas asi . San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted March 24, 2012 Posted March 24, 2012 De nada.P.D: A todos nos pasan cosas asi . Es cierto, fue mi primer error, pero falle escribiendo OnCLientMarkerHit Developer @ MYVAL
Recommended Posts