Jump to content

Spawning an obejct for a certain time limit.


Recommended Posts

Hello i am trying to spawn an object when a player enters a marker and make it disappear after some seconds.

I need to know how to make the object disappear after a few seconds.

             
smoke = createObject ( 2780, -2080.5, 1387.4000244141, 5.1999998092651, 0, 0, 0 ) 
setTimer ( smoke, 2500, 1, source, true, 2.5) 

This doesn't seem to work.

Link to comment

In setTimer, the first argument is the function you want to be called, then goes the time and execution count and further is whatever you want to pass to the called function. So if you want destroyElement(smoke) to be delayed, you have to call setTimer like this:

setTimer(destroyElement, 2500, 1, smoke) 

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...