Jump to content

Ayuda-animacion.


Nicolas ECM

Recommended Posts

Lo que queres hacer es restringir un comando para ser usado cad X tiempo? si es asi, entonces podes usar la siguiente funciones:

getTickCount 

con esta funcion podes calcular cuanto paso desde que se ejecuto el comando ( tenes que guardar en una variable o una tabla cuando uses el comando el valor de getTickCount ).

Link to comment
  
local tiempo = 0 
  
addCommandHandler("saludo",function() 
if (getTickCount ( ) - tiempo > 50000) then 
outputChatBox("Hola mundo!",getRootElement(),0,255,0,false) 
tiempo = getTickCount ( ) 
else 
outputChatBox("Debes esperar 5 minutos para poder utilizar este comando!",getRootElement(),255,0,0,false) 
end end)  
  

Link to comment

muchas gracias ya me sirvio pero le quiero agregar que cree un objeto lo tengo asi pero no se crea el objeto me podrian ayudar

  
local tiempo = 0 
  
addCommandHandler("doton",function( sourcePlayer ) 
if (getTickCount ( ) - tiempo > 50000) then 
outputChatBox("Doton Doryu Joheki",getRootElement(),0,255,0,false) 
tiempo = getTickCount ( ) 
else 
outputChatBox("Debes esperar 5 minutos para poder utilizar este jutsu!",getRootElement(),255,0,0,false) 
local x, y, z = getElementPosition ( sourcePlayer ) 
objeto = createObject ( 897, x, y - 7, z + 0.3, 0, 90, 90 ) 
setTimer (destroyElement, 5000, 1, objeto) 
end end) 
  

Link to comment
  • Recently Browsing   0 members

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