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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

To check if a part exists HELP

Previous Thread :: Next Thread 
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 10:25 AM
while true do
wait()
if game.Workspace.Game1.Hovers.Hover1 == exist then
game.Workspace.Game1value.Value = 1 else game.Workspace.Game1value.Value = 0
end
end

This is supposed to check if a specific part exists.
If it exists, then a value changes to 1.
If not, then it changes to 0.

It's not working ofcourse. Can someone tell me how to make it work? Thank you.
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
04 Nov 2011 10:29 AM
if game.Workspace.Game1.Hovers:findFirstChild("Hover1") then
OR
if game.Workspace.Game1.Hovers:findFirstChild("Hover1") ~= nil then

now if you want it to check that it doesnt then
if game.Workspace.Game1.Hovers:findFirstChild("Hover1") == nil then
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
04 Nov 2011 10:33 AM
"now if you want it to check that it doesnt then
if game.Workspace.Game1.Hovers:findFirstChild("Hover1") == nil then"
"if game.Workspace.Game1.Hovers:findFirstChild("Hover1") ~= nil then"

Eh, don't use '~=nil', or '==nil' use either

if game.Workspace.Game1.Hovers:FindFirstChild("Hover1") then

or

if not game.Workspace.Game1.Hovers:FindFirstChild("Hover1") then
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 10:33 AM
Thank you, it works perfectly.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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