Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

is there a way of checking if a model is in workspace??

2 answers

✓ Accepted answer

There is a useful function called IsDescendantOf() which returns true if the object is a descendant of the given ancestor.

if Model:IsDescendantOf(Workspace) then 
-- Code
end

~UserOnly20Charcters, Hoped I helped you to answer your question! If you have any further question, don't hesitate to comment below!!

There is a way! You have to use a loop.

Here is an example:

local modelinworkspace = false--Change this to any variable if you want

for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "ModelName" then--Change this to your model name
modelinworkspace = true
else
print("Model not in workspace")--Just an example, this is not needed
end

Hope this helped! If it did, please accept my answer, it gives us both rep!

This discussion is preserved as it was. New answers, comments, and votes are closed.