Getting child is not identifying screen GUI? (SOLVED)

I have been recently working on a project lately. But I have ran into the roadblock. For some reason. When I get all children. This part of the script can some how manage to find what a script is as well as sound. However it cant find out what a ScreenGui is. help?

				if Part:IsA("ScreenGui") then
					RenderClone:Destroy()
					end
			if Part:IsA("Sound") then
						RenderClone:Stop()
						end
			if Part:IsA("Script") then
				RenderClone:Destroy()
			end

thanks in advance!

Could you elaborate a bit more? So I can help you

  1. Could you show the entire code and What RenderClone is?

2)You could combine the 1st and the 3rd:(to make it easier and neater)

"if part:IsA(“ScreenGui”) or part:IsA(“Script”) then
RenderClone:Destroy()
elseif part:IsA(“Sound”) then
–Stop/destroy the sound here
end

Sorry for the late reply. But I am getting all decendants from workspace. My code is working for every thing except for screenGUI. I am using BoatBomber’s viewport camera system. Which is why you could see the “RenderClone”

ScreenGui objects should only be in a player’s PlayerGui. SurfaceGui on the other hand would be found in the workspace.

Well. Heres the thing. Im using a viewport camera system, and im trying to make it so it will delete screen GUI’s so it doesn’t appear on everyone’s screen. However getting all of the descendants that are screen GUI’s is not working.

Yes. Because you stated:

And as I mentioned, you won’t (shouldn’t) find any ScreenGuis within the workspace.

If you want to find a ScreenGui you should search within PlayerGui. I feel like I am totally missing what you are trying to achieve though.

Heres the thing. Some people have tools that contain GUI’s. Or morphs etc. And when the workspace is cloned into playerGUI. The GUI becomes visible for all players. I want to make it so that the screenGui’s are destroyed or disabled. However ROBLOX does not seem to be able to find screen GUIS. I have even made it so that if a script finds something with the word “ScreenGui” it gets deleted. However this doesn’t seem to work. even if I name something “ScreenGui” when its something else.

For Example. I name a number value “ScreenGui” I also have a screen GUI called “ScreenGui”. The number value does not get the deleted and the screengui does not get deleted. If I name the number value something else along side with the screen gui. the number value gets deleted. and the screen gui stays.

Oh, I see what I did wrong now. Thank you for helping!

1 Like