01 | local NB = Instance.new( "Part" , game.Workspace) |
02 | NB.Size = Vector 3. new( 1 , 1 , 1 ) |
03 | NB.Position = Vector 3. new( 0 , 0 , 0 ) |
04 | NB.Anchored = false |
05 | NB.Name = "1" |
06 |
07 | print ( "Ok_1" ) |
08 |
09 | game.Workspace.PartFolder.ChildAdded:connect( function (Brick) |
10 |
11 | print ( "Ok_2" ) |
12 |
13 | wait( 1 ) |
14 |
15 | print (Brick.Name) |
Why does it not print what it is touching? Should it not print "1" which is the name of the first part?
Here. I changed the event to only work if the part isn't equal to nil. I also added Debounce so that it dosen't just print loads of stuff at once. If you want to learn about Debounce go here: http://wiki.roblox.com/index.php?title=Debounce
01 | local debounce = false |
02 | local NB = Instance.new( "Part" , game.Workspace) |
03 | NB.Size = Vector 3. new( 1 , 1 , 1 ) |
04 | NB.Position = Vector 3. new( 0 , 0 , 0 ) |
05 | NB.Anchored = false |
06 | NB.Name = "1" |
07 |
08 | print ( "Ok_1" ) |
09 |
10 | game.Workspace.PartFolder.ChildAdded:connect( function (Brick) |
11 | if Brick then |
12 | print ( "Ok_2" ) |
13 |
14 | wait( 1 ) |
15 |