Here's the code.
if game.Workspace.Model == nil then print("did not find the model") elseif game.Workspace.Model then print("found the model") end
The output says when I delete the model, > Model is not a valid member of workspace When if it isnt found I want it to print > did not find the model
Any help is greatly appreciated.
When you do instance.Child
while "Child" doesn't exist, it'll error. It thinks you're trying to get the property "Child" which doesn't exist, thus error with "Child is not a valid member". You need to use FindFirstChild:
if game.Workspace:FindFirstChild("Model") then print("found the model") else print("did not find the model") end
FindFirstChild returns the child you're looking for, unless it can't find it, then it returns nil.