xeon17 Posted December 12, 2014 Posted December 12, 2014 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
Anubhav Posted December 12, 2014 Posted December 12, 2014 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!
xeon17 Posted December 12, 2014 Author Posted December 12, 2014 or use SetEffectDensity This is already solved but still thanks!
DiSaMe Posted December 12, 2014 Posted December 12, 2014 or use SetEffectDensity So that the effect would be undetectable by visual means but still would exist and eventually cause the element limit to be reached.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now