Jump to content

Stupid Timer


Dice

Recommended Posts

function triggerBlow( thePlayer, matchingDimension ) 
    if thePlayer then 
        if isElementWithinColShape ( thePlayer, dragarr ) then 
            triggerClientEvent ( root ,"killIntruder", thePlayer ) 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", root, triggerBlow )   
setTimer ( triggerBlow, 1000, 0 ) 

Why doesn't this check every second? by the way the client event just creates a projectile, what I want to do is , while that person is in that colshape trigger the client event.

As of now all it is doing is shooting one missile, but I need to fire as long as I am in there.

Link to comment
function triggerBlow( thePlayer, matchingDimension ) 
    setTimer( 
    function( ) 
    if thePlayer then 
        if isElementWithinColShape ( thePlayer, dragarr ) then 
            triggerClientEvent ( root ,"killIntruder", thePlayer ) 
        end 
    end 
    end, 1000, 0 
    ) 
end 
addEventHandler ( "onColShapeHit", root, triggerBlow ) 

try this.

Link to comment

isTimer gets a specific timer,

example of how to get rid of a timer:

time = 30 
timer = setTimer( 
function() 
time = time - 1 
outputChatBox( time, root, 255, 255, 255 ) 
if ( time == 0 ) then 
killTimer( timer ) 
end 
end, 1000, 0 
) 

You're welcome after all.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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