Zakusa
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 359 |
|
|
| 31 Oct 2015 10:30 AM |
hi i need help with this script below so ya if theres no blackblock in workspace it just returns error how do i make it print "ya" if theres no blackblock
if game.Workspace.BlackBlock == nil then print("ya") end |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 31 Oct 2015 10:33 AM |
local blackBlock = workspace:WaitForChild("BlackBlock")
if you want to wait for it, and
local blackBlock = workspace:FindFirstChild("BlackBlock")
if you don't want to wait for it
-well crap.
|
|
|
| Report Abuse |
|
|
|
| 31 Oct 2015 10:57 AM |
local BlackBlock = workspace:FindFirstChild("BlackBlock")
if not BlackBlock then print'ya' end
workspace.ChildAdded:connect(function(c) if c.Name == "BlackBlock" and not BlackBlock then BlackBlock = c end end)
workspace.ChildRemoved:connect(function(c) if c == BlackBlock then print'ya' end end) |
|
|
| Report Abuse |
|
|