Jump to content

Necesito ayuda con un Script


Takerd

Recommended Posts

Posted

Hola, buenas.

Yo tengo un script que es para hacer que una puerta de garaje se abra (Se levante hacia arriba). Entonces quería añadir otra puerta (Los de abrir las otras puertas los puso un amigo, yo no sé cómo).

La información del objeto que quiero que se mueva es esta:

Y el script es este:

p2 = createObject ( 968, 93.75, 1188.09, 18.4, 0, 270, 0)

function poli1 ( thePlayer )

if exports.factions:isPlayerInFaction ( thePlayer, 1) then

if (getElementData(p2, "abierta") == false) then

moveObject ( p2, 2000, 93.75, 1188.09, 18.4, 0, 85, 0, "InOutQuad" )

setElementData(p2, "abierta", true)

setTimer (

function ( )

moveObject ( p2, 2000, 93.75, 1188.09, 18.4, 0, -85, 0, "OutInQuad" )

setTimer(function() setElementData(p2, "abierta", false) end, 2000, 1)

setTimer (

function ()

end, 10000, 1)

end

,6000,1

)

end

end

end

addCommandHandler("policia",poli1)

depozitouo = createObject ( 980, 142.89999389648, 1099.1999511719, 15.39999961853, 0, 0, 91 )

function dep ( thePlayer )

if exports.factions:isPlayerInFaction ( thePlayer, 1) then

moveObject ( depozitouo, 2000, 142.89999389648, 1099.1999511719, 9.83, 0, 0, 0 )

setTimer (

function ( )

moveObject ( depozitouo, 2000, 142.89999389648, 1099.1999511719, 15.39999961853, 0, 0, 0 )

setTimer (

function ()

x, y, z = getElementPosition(depozitouo)

if y ~= 1099.1999511719 then

setElementPosition (depozitouo, 142.89999389648, 1099.1999511719, 15.39999961853)

end

end, 10000, 1)

end

,6000,1

)

end

end

addCommandHandler("deposito",dep)

function garajemeca(thePlayer)

if exports.factions:isPlayerInFaction ( thePlayer, 3) then

if (isGarageOpen(41)) then

setGarageOpen ( 41, false )

exports.chat:me( thePlayer, "presiona el botón del mando y cierra el portón del taller." )

else

setGarageOpen ( 41, true )

exports.chat:me( thePlayer, "presiona el botón del mando y abre el portón del taller." )

end

else

outputChatBox("No tienes el mando del portón del taller.", thePlayer, 255, 0, 0)

end

end

addCommandHandler("mecag", garajemeca)

¿Cómo añado para que se mueva /levante hacia arriba ese objeto que puse?

Gracias por su tiempo.

Posted

1º-. Si publicas un código porfavor usa el botón lua. Y pon el script para entre [.lua][./lua] ((Sin puntos)).

2º-. ¿Qué GM estás usando? Ya que eso me parece a MTA Paradise, y lo que tu has hecho está bastante más complejo.

Añademe a Skype, y te ayudaré sin problemas. "killer.68x".

Posted

No es necesario agregar una puerta con el editor de mapas; mas bien usa createObject como te lo indica en el segundo código, simplemente sería copiar dos veces el mismo código pero con definiciones diferentes.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...