of     1   

commonsensical
#63511849Monday, February 27, 2012 12:34 AM GMT

How do I check to see if an object is in a certain model? if Object not == nil then Is that how?
FisherPenguin
#63512386Monday, February 27, 2012 12:43 AM GMT

if Object ~= nil then +-Fishy
commonsensical
#63512470Monday, February 27, 2012 12:44 AM GMT

Won't that just make it so that it checks if its not there?
aboy5643
#63512509Monday, February 27, 2012 12:44 AM GMT

Use ::FindFirstChild(objName) Otherwise you'll get an error about accessing a nil value.
stravant
Forum Moderator
#63512581Monday, February 27, 2012 12:46 AM GMT

Well, a typical way of writing it would look something like this: if model:FindFirstChild("Name of the thing") then ...
FisherPenguin
#63512628Monday, February 27, 2012 12:47 AM GMT

if Object ~=nil then --This says that "If Object does not equal nothing then...". Literally. In other words, it's saying "If Object equals something then..." +-Fishy
iFordMC
#63512792Monday, February 27, 2012 12:49 AM GMT

While true do for i, v in impairs (game.workspace:GetChildren()) If game.Workspace[v]:IsA("Model") then If game.Workspace[v].Bricky ~= false then -- Code here End End End Else Print("It is false!") End
NewFissy
#63512801Monday, February 27, 2012 12:50 AM GMT

You could also compare the object's parent to the model. Model = workspace.Model Object = script.Parent if Object.Parent == Model then print("In Model") end
iFordMC
#63512906Monday, February 27, 2012 12:51 AM GMT

I think that was wrong, how embarrassing. Especially science strap ant may see...
iFordMC
#63512984Monday, February 27, 2012 12:52 AM GMT

Auto correct.
commonsensical
#63520548Monday, February 27, 2012 2:39 AM GMT

Thanks Stravant. and the rest of you for pitching in.

    of     1