Jump to content

[Help] Car lock system in dayz


Sisqo0

Recommended Posts

I made Car lock system script in dayz and it works fine but it depends on that each car has a certain number and needs a certain key to lock/unlock & all that is ok but to make those keys appear in inventory i need to add like more than 200 lines ( because i have more 200 cars in server and each one has a certain num ).. The name of each key is "Vehicle Name - Its num" so how can i do it. Is there something like math.random(1,200) but it make all nums between them valid not just a random one. And even if there's something like that.. Will it work in inventory? 

Link to comment

You can just modify how items are stored in dayz.

Like, adding an extra parameter for items which would be a table which could contain any custom value for that item (which would be that key number for your key in this case), this way you wouldn't need to add 200 same items for inventory.

Or if cars are unique for each player, you can simplify this even further by saving that key number somewhere else and when player tries to open it with a key, it'd just use that stored number.

  • Like 1
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...