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: Check parents

Previous Thread :: Next Thread 
RaTheKush is not online. RaTheKush
Joined: 12 Dec 2014
Total Posts: 1978
07 Oct 2017 04:53 AM
How can you check if any parents of a part like the model its in equal a string only if the model exist tho so it doesn't return nil
Report Abuse
RaTheKush is not online. RaTheKush
Joined: 12 Dec 2014
Total Posts: 1978
07 Oct 2017 04:59 AM
Like this if Target ==x or Target.Parent.Name ==x or Target.Parent.Parent.Name ==x

without attempt to index field 'Parent' (a nil value)
Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
07 Oct 2017 05:12 AM
Your explanation is worse than what I ever answered and my answers are like those of a braindead (censored beverage drinker).

While trying to decrypt this enigmatic code, I managed to come up with 2 possible answers.

1 The parent value cannot be a string.

2 if Part.Parent then--checks if the parent value is not equal to nil

end
Report Abuse
RaTheKush is not online. RaTheKush
Joined: 12 Dec 2014
Total Posts: 1978
07 Oct 2017 07:54 AM
lol just trying to check if the model or models parent name equals a text
Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
07 Oct 2017 08:09 AM
Oh, if model.Name==Text or model.Parent.Name==Text then
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
07 Oct 2017 08:58 AM
if target.Name == x or target:FindFirstAncestor(x) then

end
Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
07 Oct 2017 09:44 AM
Though he only wants the model's and the model parent's name.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
07 Oct 2017 09:58 AM
Using his second post as reference, it appeared he wanted the whole chain, but was stopped by not knowing how many parents an object had, and getting an error.
Report Abuse
LaeMVP is online. LaeMVP
Joined: 24 Jun 2013
Total Posts: 4416
07 Oct 2017 09:59 AM
model:FindFirstAncestor(name)
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