|
| 23 Sep 2017 01:30 PM |
Is there a way to make a variable be two segments? For example:
local variable1 = boop
So there are two boops, there is a model called "boop" and another model called "boop Model". How do I combine "boop" with a string variable? For example,
local variable2 = (variable1) "Model" local variable3 = game.Workspace:FindFirstChild(variable2)
So now it will look for a model by the name of "boop Model". I understand that the script above is an example and maybe completely wrong. |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 23 Sep 2017 01:31 PM |
| local boop = workspace:FindFirstChild("boop Model") |
|
|
| Report Abuse |
|
|
BartXXL
|
  |
| Joined: 31 Jan 2013 |
| Total Posts: 100 |
|
|
| 23 Sep 2017 01:36 PM |
local variable1 = "boop" local variable2 = variable1.." Model" local variable3 = game.Workspace:FindFirstChild(variable2) ?? |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2017 01:41 PM |
| It is multiple variables, such as boop1, boop2, boop3 etc, so I wish to go about this as efficiently as possible |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2017 01:41 PM |
local variable1 = "boop" local variable2 = game.Workspace:FindFirstChild(variable1.." Model") |
|
|
| Report Abuse |
|
|
BartXXL
|
  |
| Joined: 31 Jan 2013 |
| Total Posts: 100 |
|
|
| 23 Sep 2017 01:45 PM |
local variable1 = { "boop1", "boop2", "boop3", "..." } local variable2 = variable[3].." Model" local variable3 = game.Workspace:FindFirstChild(variable2) -> boop3 Model |
|
|
| Report Abuse |
|
|
BartXXL
|
  |
| Joined: 31 Jan 2013 |
| Total Posts: 100 |
|
|
| 23 Sep 2017 01:54 PM |
| sorry not variable[3] but variable1[3] |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2017 02:08 PM |
| Thank you so much! You will now receive appreciation and happiness |
|
|
| Report Abuse |
|
|