1local Players = game:GetService("Players")
2local Lighting = game:GetService("Lighting")
3local Workspace = game:GetService("Workspace")
4local RunService = game:GetService("RunService")
5
6local lp = Players.LocalPlayer
7
8pcall(function()
9 setfpscap(1e+38)
10end)
11
12settings().Rendering.QualityLevel = Enum.QualityLevel.Level01
13
14pcall(function()
15 settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.Disabled
16 settings().Physics.AllowSleep = true
17end)
18
19Workspace.StreamingEnabled = true
20Workspace.StreamingMinRadius = 32
21Workspace.StreamingTargetRadius = 96
22
23Lighting.Technology = Enum.Technology.Compatibility
24Lighting.GlobalShadows = false
25Lighting.Brightness = 2
26Lighting.ClockTime = 14
27Lighting.FogStart = 0
28Lighting.FogEnd = 300
29Lighting.FogColor = Color3.fromRGB(192, 192, 192)
30Lighting.Ambient = Color3.fromRGB(128, 128, 128)
31Lighting.OutdoorAmbient = Color3.fromRGB(128, 128, 128)
32Lighting.EnvironmentDiffuseScale = 0
33Lighting.EnvironmentSpecularScale = 0
34
35local function removeEffects(v)
36 if v:IsA("PostEffect") then
37 v:Destroy()
38 elseif v:IsA("Sky") or v:IsA("Atmosphere") then
39 v:Destroy()
40 end
41end
42
43for _, v in ipairs(Lighting:GetDescendants()) do
44 removeEffects(v)
45end
46
47Lighting.DescendantAdded:Connect(removeEffects)
48
49local function optimizeObject(obj)
50 if obj:IsA("BasePart") then
51 obj.Reflectance = 0
52 obj.Material = Enum.Material.Plastic
53 obj.CastShadow = false
54 elseif obj:IsA("SurfaceAppearance") then
55 obj:Destroy()
56 elseif obj:IsA("ParticleEmitter") or obj:IsA("Trail") or obj:IsA("Smoke") or obj:IsA("Fire") or obj:IsA("Beam") then
57 obj.Enabled = false
58 elseif obj:IsA("Decal") or obj:IsA("Texture") then
59 obj.Transparency = 1
60 elseif obj:IsA("PointLight") or obj:IsA("SpotLight") or obj:IsA("SurfaceLight") then
61 obj.Enabled = false
62 elseif obj:IsA("Explosion") then
63 obj.BlastPressure = 0
64 obj.BlastRadius = 0
65 end
66end
67
68for _, v in ipairs(Workspace:GetDescendants()) do
69 optimizeObject(v)
70end
71
72Workspace.DescendantAdded:Connect(optimizeObject)
73
74local function optimizeCharacter(char)
75 for _, v in ipairs(char:GetDescendants()) do
76 if v:IsA("BasePart") then
77 v.Material = Enum.Material.Plastic
78 v.Reflectance = 0
79 v.CastShadow = false
80 elseif v:IsA("SurfaceAppearance") then
81 v:Destroy()
82 elseif v:IsA("Decal") then
83 v.Transparency = 1
84 end
85 end
86end
87
88local function hookPlayer(p)
89 if p.Character then
90 optimizeCharacter(p.Character)
91 end
92 p.CharacterAdded:Connect(optimizeCharacter)
93end
94
95for _, p in ipairs(Players:GetPlayers()) do
96 hookPlayer(p)
97end
98
99Players.PlayerAdded:Connect(hookPlayer)
100
101task.spawn(function()
102 while true do
103 task.wait(10)
104 collectgarbage("collect")
105 end
106end)
107
108local gui = Instance.new("ScreenGui")
109gui.Name = "FPSCounter"
110gui.ResetOnSpawn = false
111gui.Parent = lp:WaitForChild("PlayerGui")
112
113local label = Instance.new("TextLabel")
114label.Size = UDim2.new(0, 140, 0, 35)
115label.Position = UDim2.new(0, 10, 0, 10)
116label.BackgroundTransparency = 0.3
117label.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
118label.TextColor3 = Color3.fromRGB(0, 255, 0)
119label.Font = Enum.Font.Code
120label.TextSize = 18
121label.Text = "FPS: ..."
122label.Parent = gui
123
124local frames = 0
125local last = tick()
126
127RunService.RenderStepped:Connect(function()
128 frames += 1
129 local now = tick()
130 if now - last >= 1 then
131 local fps = frames / (now - last)
132 frames = 0
133 last = now
134 label.Text = ("FPS: %d"):format(math.floor(fps + 0.5))
135 end
136end)