How to remove textures from all walls by clicking a spceific keybind?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    This might be dumb question but I know how to do a UIS for a specific keybind, but I’m asking how to do remove all textures from part/unions and mesh parts?

  2. What is the issue? Include screenshots / videos if possible!
    I need help with making when a button is clicked [k] all textures be disabled until you click another button such as [L]

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I haven’t found anything similar within my problem.

You can use table loop. Example:

for i, v in pairs(game.Workspace:GetDescendants()) do
 if v:FindFirstChild("Texture") then
  --Code
 end
end

Thank you for the example, but because Textures don’t have Enable property, will Transparency still work for reducing lag? Because I’m making a performance mode.

I don’t understand how to combine UIS with table loop… shame

I don’t think changing the transparency reduces lag (I could be wrong), if I am correct tho and the transparency doesn’t affect lag I’d recommend just deleting all textures when the setting is enabled and then for when the player wants to re-enable the textures by disabling performance mode you can

  1. if the setting doesn’t save have him rejoin and all textures will reload like normal
  2. if the setting does save then have them rejoin and if its set to true (performance mode enabled) you delete all textures again but if it’s set to false (performance mode disabled) it’ll do nothing and keep the textures where they are

you can also try some other things such as creating a folder for the player in ReplicatedStorage and putting all textures there and make a table of where all the texture parents are

I heavily agree with you, I will use table loop how the other guy said, then I will find descendants of the workspace [texture], make their parent ReplicatedStorage. But how do I combine UIS with Table Loop? I tried and failed…

I don’t understand, what do you mean?

No, the engine will still load in the texture.

You should do :Destroy() and the player may have to rejoin to revert it.

I meant like this: here’s the code

local kKeyPressed = false

uis.InputBegan:Connect(function(input,gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.K then
		kKeyPressed = true
		local lighting = game:GetService("Lighting")
		lighting.GlobalShadows = false
		lighting.Blur = false
		lighting.ColorCorrection = false
		lighting.SunRays = false
                --that's the code for small changes, now i want to do that what you said
               --to get descendants of the workspace for textures, then send them
             --to the replicated storage
	end
end)

Can anybody tell me a hint or something, i got mega confused

local kKeyPressed = false

uis.InputBegan:Connect(function(input,gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.K then
		kKeyPressed = true
		local lighting = game:GetService("Lighting")
		lighting.GlobalShadows = false
		lighting.Blur = false
		lighting.ColorCorrection = false
		lighting.SunRays = false
                --how do i get all textures from the workspace and destroy them?
              --literally got confused...
	end
end)

Fire a remote event with a boolean of false/true and the server will catch the remote and do as it was told!

I say, these are really easy to combine.

Doing something to every texture:

This code is a bit wrong, though. It checks whether v has a texture in it.

 if v:FindFirstChild("Texture") then

But this code checks whether v is a Texture.

 if v:IsA("Texture") then

Doing something when you press a button:

Doing something to every texture when you press a button:

local kKeyPressed = false

uis.InputBegan:Connect(function(input,gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.K then
		kKeyPressed = true
		local lighting = game:GetService("Lighting")
		lighting.GlobalShadows = false
		-- EDIT: change .Enabled instead of whatever you were doing before this
		lighting.Blur.Enabled = false
		lighting.ColorCorrection.Enabled = false
		lighting.SunRays.Enabled = false
		
		-- EDIT: destroy all Textures
		for i, v in pairs(game.Workspace:GetDescendants()) do
 			if v:IsA("Texture") then
  				v:Destroy()
 			end
		end
	end
end)

But if you Destroy the Textures, you can’t get the textures back.
You also don’t have a button to re-enable everything.

So let’s send the textures to nil so that they can be restored, and make the button toggle effects instead of only disabling them.

Toggling effects and textures:

-- EDIT: renamed variable to something more descriptive
local effectsEnabled = true
-- EDIT: added variable to store all textures that were removed and where they were before
local textureParents

uis.InputBegan:Connect(function(input, gameProcessedEvent)
	-- EDIT: check gameProcessedEvent, it's important, otherwise this will run even when you're chatting
	if gameProcessedEvent then return end
	
	if input.KeyCode == Enum.KeyCode.K then
		local lighting = game:GetService("Lighting")
		
		if effectsEnabled then
			effectsEnabled = false
			
			lighting.GlobalShadows = false
			lighting.Blur.Enabled = false
			lighting.ColorCorrection.Enabled = false
			lighting.SunRays.Enabled = false
			
			textureParents = {}
			for i, v in pairs(game.Workspace:GetDescendants()) do
 				if v:IsA("Texture") then
 					-- remember where the texture is
  					textureParents[v] = v.Parent
  					-- then remove the texture
  					v.Parent = nil
 				end
			end
			
		else
			effectsEnabled = true
			
			lighting.GlobalShadows = true
			lighting.Blur.Enabled = true
			lighting.ColorCorrection.Enabled = true
			lighting.SunRays.Enabled = true
			
			for texture, parent in pairs(textureParents) do
				-- put all textures back where they were before
				texture.Parent = parent
			end
			textureParents = nil
		end
	end
end)

This code was not tested.

Should one player be able to remove textures for everyone else in the server?

I needed this for only one guy who has a Low Specification Computer so he can run the game with enough frames to enjoy.
I myself is having standard specifications nowadays. The game is lagging for me also… xdddd

Very thank you for explaining.