|
| 07 Jan 2014 04:03 PM |
I am learning how to script and this won't work, the brick just dissapears immediatly, can someone explain why?
local brick = Workspace.Brick
if brick:destroy() then print ("YOU SCARE ME")
end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jan 2014 04:04 PM |
| brick:destroy() that's why |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jan 2014 04:05 PM |
I don't know what you want to do. Do you want to check if it is destroyed? Destroy it then print? |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2014 04:06 PM |
I want the script to have the print appear if the brick is destroyed, sort of like the
game.Workspace.Ninjamaniac1.Head:remove()
script. where it's removed |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jan 2014 04:07 PM |
local brick = Workspace.Brick
if brick == nil then print ("YOU SCARE ME") else print ("THE BRICK EXISTS") end |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2014 04:07 PM |
| What would that script do? exactly |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jan 2014 04:08 PM |
| If it doesn't exist it will print that, otherwise it will print it does exist |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2014 04:09 PM |
| Thank's for the help! I appreciate a veteran scripter helping a newbie! |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Jan 2014 04:10 PM |
In case it is nil, you should actually have done this: local brick = Workspace:FindFirstChild("Brick") Otherwise it will error if it is nil on that line |
|
|
| Report Abuse |
|
|