Is there a way to make invisible all textures in the workspace?

Hey! I recently tried to remove all the textures in the workspace but i can’t do it, I tried this but didnt work

for _, i in pairs(game.Workspace:GetChildren()) do
				if i:IsA("Texture") then
					i.Transparency = 1
				end
			end
4 Likes

This is most likely due to you using GetChildren() instead of GetDescendants()

do game.Workspace:GetDescendants() and it should work.

Hey! I put your reply and still don’t work

for _, i in pairs(game.Workspace:GetDescendants()) do
		if i:IsA("Texture") then
			i.Transparency = 1
		end
	end
1 Like

Where is this script located? And is it a local script or server script?

Its a localscript putted in a gui from startergui

After trying it out myself, I realized this is happening since the Character hasnt loaded in yet. Just adding a task.wait(3) lets the game load in and then the script can find the necessary textures.

Basically just wait for game to load then run the script.

1 Like

Thank you so much! It worked and with no errrors!

Different games have different load times. @Crystobynatt it would be better if you defined the character as:

local Player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()

This code waits till the character is loaded before executing the code below it.

1 Like

Yea of course, thats why I specified in the end that the end fix was wait for the game to load first. Also player.CharacterAdded:Wait() doesnt fix this issue. It’s the same as player.CharacterAppearanceLoaded:Wait()

2 Likes

Yeah i used game:isLoaded() for check when game is loaded

1 Like

Yea good, I was gonna tell you to use that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.