Jump to content

Little help needed


isa_Khamdan

Recommended Posts

Hello ,

I will try to explain my problem

I have a Variable named x

local x = 1 

and another variable name Veh

Veh = createVehicle ( 544, x, y, z, rx, ry, rz ) 

okay so my problem comes here :/

I want to add x to the second Variable name so it will be Veh1 or Veh2 if x was 2.. etc

for example

local x = 1 
Veh(x here) = createVehicle ( 544, x, y, z, rx, ry, rz ) 
x = x+1 

so is it possible to do this?

Edited by Guest
Link to comment

Untested. Don't forget to put your y,z,rx,ry,rz values though.

local vehiclesToCreate = 10 
local x = 1 
local increment = 1 
local vehicles = { } 
  
for i=1,vehiclesToCreate do 
  local veh = createVehicle (544,x,y,z,rx,ry,rz) 
  table.insert(vehicles,veh) 
  x = x + increment 
end 
  
outputChatBox(#vehicles.." created!",root,0,255,0) 

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