|
| 02 Jul 2015 07:28 PM |
How does one use this? Is it even what I'm looking for? I want the script to detect when five bricks are in place (in a different model) and then do something (that I know how to code). |
|
|
| Report Abuse |
|
|
Marzlyn
|
  |
| Joined: 15 Jun 2014 |
| Total Posts: 4431 |
|
|
| 02 Jul 2015 07:32 PM |
repeat wait() until Bla bla and Bla bla
or you could create an array that checks stuff and if its there it inserts it into it once the length of array (#Array) is 5 then it would work
-Baheeg |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 02 Jul 2015 07:35 PM |
| are the five bricks placed in their own separate models? |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2015 07:41 PM |
No, but that's not the problem. When I move the bricks into the model that the script is checking, I want the script to activate another bit of that code (i.e. it'll blow up a brick or destroy a brick or whatever).
I want it to make sure that when all five bricks are in the model, something will happen. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 02 Jul 2015 07:44 PM |
local specialParts = {}
model.ChildAdded:connect(function(child) if child:IsA("Part") and child.Name == "SpecialPart" then table.insert(specialParts, child) if #specialParts == 5 then -- stuff end end end |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2015 08:06 AM |
| 09:05:40.642 - Workspace.Script:5: bad argument #1 to 'insert' (table expected, got nil) |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 03 Jul 2015 08:10 AM |
| You must add the name of the parts on the table to make the code runs... |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Jul 2015 08:16 AM |
| Ok, it's working good now. |
|
|
| Report Abuse |
|
|