Jump to content

Spawning second vehicle.


Recommended Posts

Whats. I have a script that when you press the button, we spawn a vehicle. But I have a hard problem. I want to do so that when you press it a second time that vehicle exhausts with "destroyElement". But unfortunately removes ALL players then these vehicles and do not know what to do. Please help, I greet :).

Link to comment

I think he means when 1 player spawns a new vehicle, all the old vehicles get deleted, instead of just the one of the player who spawned a second vehicle.

If this is the case, you should make a table which keeps track of all the vehicles that have been spawned and link the player ID (thePlayer) with the vehicle in the table. This way you can later destroy only the vehicle of the player it was linked to.

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