Jump to content

How to destroy/stop a effect?


xeon17

Recommended Posts

Hello there ,

I have a problem with createEffect function since the effect is created i don't know how to destroy him. I tried with destroyElement but it didn't worked.

Here is my code, any idea how to destroy/stop the effect?

addEvent("onPlayerPayNSpray",true) 
addEventHandler("onPlayerPayNSpray",root, 
 function () 
local x, y, z = getElementPosition(source) 
effect = createEffect("carwashspray", x, y, z) 
setTimer ( destroyElement(effect), 3000, 1) 
end) 
  

error setTimer exprected function at argument 1 , got boolean

Link to comment
  
addEvent("onPlayerPayNSpray",true) 
addEventHandler("onPlayerPayNSpray",root, 
 function () 
local x, y, z = getElementPosition(source) 
local effect createEffect("carwashspray", x, y, z) 
setTimer ( destroyElement, 3000, 1, effect) 
end) 
  
  

This is how it works, never do like that, just add a comma after the timesToExecute and the arguments of the function to run.. Read the wiki for more information!

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