generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: "if null then"

Previous Thread :: Next Thread 
Zakusa is not online. 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 is not online. 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
CLIMAXIMUS is not online. CLIMAXIMUS
Joined: 22 Jun 2012
Total Posts: 1738
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image