Jump to content

setTimer


yToPzz

Recommended Posts

You can do it this way. It works once after 3 seconds. You can enter the value you want in milliseconds.

addEventHandler("onVehicleExplode", root, function()
	setTimer(function(source) destroyElement(source) end, 3000, 1, source) --run after 3 seconds
end)
Edited by Burak5312
  • Like 1
  • Thanks 1
Link to comment
7 hours ago, Burak5312 said:

You can do it this way. It works once after 3 seconds. You can enter the value you want in milliseconds.

addEventHandler("onVehicleExplode", root, function()
	setTimer(function(source) destroyElement(source) end, 3000, 1, source) --run after 3 seconds
end)

Not sure if this can be even better. Try this one:

addEventHandler("onVehicleExplode", root, function()
	setTimer(destroyElement(),3000,1,source)
end)

 

  • Thanks 1
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...