So I'm making a game with a minigame where players delete parts and there's a certain part they have to delete. If they delete the part, the game should end, but I have no way of checking if that part is still in the workspace or not. I tried to use an if statement I see on youtube videos, but that doesn't work. Here's an example of how I'm trying to see if the part is there or not:
if game.Workspace.GoldPart then
print("The gold part has not been deleted!")
end
The problem with this is that if the part is not there, an error will occur saying something like "GoldPart is not a valid member of Workspace" or something like that.

1 comment
I tried yours and it worked just like the other two, but I think I'm going to stick with yours just because it uses "repeat" and "until" which is more secure, in my opinion. I also liked the fact that you use Nilly for your variables :p