Ivan Orel Posted July 18, 2018 Share Posted July 18, 2018 Hello everyone, today I decided to write a script that is responsible for the destruction of already (explosed) blown up cars (in order not to load the server). That is, after the car has blown up it automatically disappears. But the problem is that I do not know how to write such a script, so I ask you. Help me. Link to comment
Mr.Loki Posted July 18, 2018 Share Posted July 18, 2018 onVehicleExplode destroyElement If you do not want to remove the vehicle as soon as it is destroyed use a timer then destroy the vehicle setTimer 1 Link to comment
mazarati21 Posted July 19, 2018 Share Posted July 19, 2018 Try this: -- 1 seg = 1000 local disappear = 5000 function vehicledisappear() setTimer(destroyElement, disappear, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), vehicledisappear) 1 Link to comment
Ivan Orel Posted July 20, 2018 Author Share Posted July 20, 2018 mazarati21, Thank you very much. I'm just new to lua scrpting. Mr.Loki, okay. Thanks ) 1 Link to comment
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