Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How To Make A Low Graphic System?

Hi i wanted to make a feature where you can lower your graphic and making your game less laggy by removing all the material of the game when you press a textbutton. Is there a way i could do that? here is the script that i used

local button = script.Parent

button.MouseButton1Down:Connect(function()
 for i, v in pairs() do
	if v:IsA("Part") then
v.Material = "SmoothPlastic"
		end
	end
end)

3 comments

0

Well I don't exactly get what you're trying to do but the script you shown won't work because of line 4. You haven't put a parameter in the pairs() part. You should put a table to loop through.

0

simple: on client side remove all features that cause lag and are graphic intensive

0

Low poly?

1 answer

✓ Accepted answer

So the pairs doesn't know what you're trying to do, you need to guide it lol.

local button = script.Parent

button.MouseButton1Click:Connect(function() --//Changed this to click so it works for mobile users as well
 for i, v in pairs(game.Workspace:GetChildren()) do --//We add get children so we gather everything in workspace.
    if v:IsA("Part") then
v.Material = "SmoothPlastic"
        end
    end
end)

1 comment

0

thank you for the help this will help me so much.

This discussion is preserved as it was. New answers, comments, and votes are closed.