Jump to content

Duda con getTickCount


depato123

Recommended Posts

getTickCount lo único que hace es una cuenta desde que se llama a la función (call)

No se si eso te servirá, para la "desvanecer" un DX supongo que usarás el alpha, esto te puede servir (no probado)

  
cuenta = 255 
function onRender() 
if cuenta < 0 then return end 
cuenta = cuenta - 0.4 
end 
addEventHandler("onClientPreRender",root,onRender) 
  

Link to comment

no probado

local startTick = nil 
local endTick = nil 
local duration = 1000  
  
function MyTesteFunction() 
startTick = getTickCount() 
endTick = startTick+duration 
addEventHandler("onClientRender",onRender) 
end 
  
function onRender() 
if(getTickCount()-endTick>=duration)then 
-- do something 
outputChatBox("time elapsed") 
-- reset to go again 
endTick = getTickCount()+duration 
  
end 
end 

Link to comment
no probado
local startTick = nil 
local endTick = nil 
local duration = 1000  
  
function MyTesteFunction() 
startTick = getTickCount() 
endTick = startTick+duration 
addEventHandler("onClientRender",onRender) 
end 
  
function onRender() 
if(getTickCount()-endTick>=duration)then 
-- do something 
outputChatBox("time elapsed") 
-- reset to go again 
endTick = getTickCount()+duration 
  
end 
end 

Nunca llamaste la función, eso no se ejecutaría nunca.

Link to comment
  • Recently Browsing   0 members

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