|
| 1 | +-- LowGraphicsWithUI_Level2_Stacked.lua |
| 2 | +-- วาง LocalScript ใน StarterPlayerScripts |
| 3 | + |
| 4 | +local Config = { QualityLevel = 1 } |
| 5 | +local Players = game:GetService("Players") |
| 6 | +local Lighting = game:GetService("Lighting") |
| 7 | +local RunService = game:GetService("RunService") |
| 8 | +local player = Players.LocalPlayer |
| 9 | + |
| 10 | +-- ScreenGui |
| 11 | +local ScreenGui = Instance.new("ScreenGui") |
| 12 | +ScreenGui.Name = "LowGraphicsUI" |
| 13 | +ScreenGui.ResetOnSpawn = false |
| 14 | +ScreenGui.Parent = player:WaitForChild("PlayerGui") |
| 15 | + |
| 16 | +------------------- |
| 17 | +-- UI1 Button |
| 18 | +------------------- |
| 19 | +local UI1Button = Instance.new("TextButton") |
| 20 | +UI1Button.Size = UDim2.new(0, 120, 0, 40) |
| 21 | +UI1Button.Position = UDim2.new(0, 20, 0, 20) |
| 22 | +UI1Button.BackgroundColor3 = Color3.fromRGB(170,0,0) |
| 23 | +UI1Button.TextColor3 = Color3.fromRGB(255,255,255) |
| 24 | +UI1Button.Text = "ควยบาส" |
| 25 | +UI1Button.Font = Enum.Font.SourceSansBold |
| 26 | +UI1Button.TextSize = 16 |
| 27 | +UI1Button.Parent = ScreenGui |
| 28 | + |
| 29 | +UI1Button.MouseEnter:Connect(function() UI1Button.BackgroundColor3 = Color3.fromRGB(255,0,0) end) |
| 30 | +UI1Button.MouseLeave:Connect(function() UI1Button.BackgroundColor3 = Color3.fromRGB(170,0,0) end) |
| 31 | + |
| 32 | +------------------- |
| 33 | +-- UI2 Frame |
| 34 | +------------------- |
| 35 | +local UI2Frame = Instance.new("Frame") |
| 36 | +UI2Frame.Size = UDim2.new(0, 250, 0, 200) |
| 37 | +UI2Frame.Position = UDim2.new(0, 20, 0, 70) |
| 38 | +UI2Frame.BackgroundColor3 = Color3.fromRGB(120,0,0) |
| 39 | +UI2Frame.BorderSizePixel = 0 |
| 40 | +UI2Frame.Parent = ScreenGui |
| 41 | +UI2Frame.Visible = false |
| 42 | +UI2Frame.ClipsDescendants = true |
| 43 | + |
| 44 | +-- Drag Function for UI2 |
| 45 | +local dragging = false |
| 46 | +local dragInput, mousePos, framePos |
| 47 | + |
| 48 | +UI2Frame.InputBegan:Connect(function(input) |
| 49 | + if input.UserInputType == Enum.UserInputType.MouseButton1 then |
| 50 | + dragging = true |
| 51 | + mousePos = input.Position |
| 52 | + framePos = UI2Frame.Position |
| 53 | + input.Changed:Connect(function() |
| 54 | + if input.UserInputState == Enum.UserInputState.End then |
| 55 | + dragging = false |
| 56 | + end |
| 57 | + end) |
| 58 | + end |
| 59 | +end) |
| 60 | + |
| 61 | +UI2Frame.InputChanged:Connect(function(input) |
| 62 | + if input.UserInputType == Enum.UserInputType.MouseMovement then |
| 63 | + dragInput = input |
| 64 | + end |
| 65 | +end) |
| 66 | + |
| 67 | +RunService.RenderStepped:Connect(function() |
| 68 | + if dragging and dragInput then |
| 69 | + local delta = dragInput.Position - mousePos |
| 70 | + UI2Frame.Position = UDim2.new(framePos.X.Scale, framePos.X.Offset + delta.X, |
| 71 | + framePos.Y.Scale, framePos.Y.Offset + delta.Y) |
| 72 | + end |
| 73 | +end) |
| 74 | + |
| 75 | +------------------- |
| 76 | +-- Buttons inside UI2 |
| 77 | +------------------- |
| 78 | +local function createButton(parent, text, y) |
| 79 | + local btn = Instance.new("TextButton") |
| 80 | + btn.Size = UDim2.new(0, 200, 0, 40) |
| 81 | + btn.Position = UDim2.new(0, 25, 0, y) |
| 82 | + btn.BackgroundColor3 = Color3.fromRGB(170,0,0) |
| 83 | + btn.TextColor3 = Color3.fromRGB(255,255,255) |
| 84 | + btn.Text = text |
| 85 | + btn.Font = Enum.Font.SourceSansBold |
| 86 | + btn.TextSize = 16 |
| 87 | + btn.Parent = parent |
| 88 | + -- Hover |
| 89 | + btn.MouseEnter:Connect(function() btn.BackgroundColor3 = Color3.fromRGB(255,0,0) end) |
| 90 | + btn.MouseLeave:Connect(function() btn.BackgroundColor3 = Color3.fromRGB(170,0,0) end) |
| 91 | + return btn |
| 92 | +end |
| 93 | + |
| 94 | +local LowGFXButton = createButton(UI2Frame, "Low GFX", 20) |
| 95 | +local FPSToggle = createButton(UI2Frame, "FPS: OFF", 70) |
| 96 | +local ResetGFXButton = createButton(UI2Frame, "Reset GFX", 160) |
| 97 | + |
| 98 | +------------------- |
| 99 | +-- FPS Label (Draggable, Outside UI2) |
| 100 | +------------------- |
| 101 | +local FpsLabel = Instance.new("TextLabel") |
| 102 | +FpsLabel.Size = UDim2.new(0, 120, 0, 30) |
| 103 | +FpsLabel.Position = UDim2.new(0, 300, 0, 20) -- เริ่มต้นข้างนอก UI2 |
| 104 | +FpsLabel.BackgroundTransparency = 0.3 |
| 105 | +FpsLabel.BackgroundColor3 = Color3.fromRGB(0,0,0) |
| 106 | +FpsLabel.TextColor3 = Color3.fromRGB(0,255,0) |
| 107 | +FpsLabel.Font = Enum.Font.SourceSansBold |
| 108 | +FpsLabel.TextSize = 16 |
| 109 | +FpsLabel.Text = "FPS: 0" |
| 110 | +FpsLabel.Visible = false |
| 111 | +FpsLabel.Parent = ScreenGui |
| 112 | + |
| 113 | +-- Drag Function for FPS Label |
| 114 | +local draggingFPS = false |
| 115 | +local dragInputFPS, mousePosFPS, framePosFPS |
| 116 | + |
| 117 | +FpsLabel.InputBegan:Connect(function(input) |
| 118 | + if input.UserInputType == Enum.UserInputType.MouseButton1 then |
| 119 | + draggingFPS = true |
| 120 | + mousePosFPS = input.Position |
| 121 | + framePosFPS = FpsLabel.Position |
| 122 | + input.Changed:Connect(function() |
| 123 | + if input.UserInputState == Enum.UserInputState.End then |
| 124 | + draggingFPS = false |
| 125 | + end |
| 126 | + end) |
| 127 | + end |
| 128 | +end) |
| 129 | + |
| 130 | +FpsLabel.InputChanged:Connect(function(input) |
| 131 | + if input.UserInputType == Enum.UserInputType.MouseMovement then |
| 132 | + dragInputFPS = input |
| 133 | + end |
| 134 | +end) |
| 135 | + |
| 136 | +RunService.RenderStepped:Connect(function() |
| 137 | + if draggingFPS and dragInputFPS then |
| 138 | + local delta = dragInputFPS.Position - mousePosFPS |
| 139 | + FpsLabel.Position = UDim2.new(framePosFPS.X.Scale, framePosFPS.X.Offset + delta.X, |
| 140 | + framePosFPS.Y.Scale, framePosFPS.Y.Offset + delta.Y) |
| 141 | + end |
| 142 | +end) |
| 143 | + |
| 144 | +------------------- |
| 145 | +-- Variables |
| 146 | +------------------- |
| 147 | +local LowGFX_Enabled = false |
| 148 | +local FPS_Enabled = false |
| 149 | + |
| 150 | +-- Skill Effects Reducer |
| 151 | +local function disableSkillEffects(obj) |
| 152 | + if obj:IsA("Smoke") or obj:IsA("Fire") then obj.Enabled = false |
| 153 | + elseif obj:IsA("ParticleEmitter") then obj.Rate = obj.Rate * 0.3 |
| 154 | + end |
| 155 | + if obj:IsA("Explosion") then obj.Visible = false; obj.BlastPressure=0; obj.BlastRadius=0 end |
| 156 | + if obj:IsA("Sound") then obj.Volume=0; obj.Playing=false end |
| 157 | + if obj:IsA("BasePart") then obj.CastShadow = false; obj.Material = Enum.Material.SmoothPlastic; obj.Reflectance = 0 end |
| 158 | +end |
| 159 | + |
| 160 | +-- Apply Low Graphics |
| 161 | +local function applyLowGraphics() |
| 162 | + local UserSettings = pcall(function() return game:GetService("UserSettings") end) and game:GetService("UserSettings") or nil |
| 163 | + local GameSettings |
| 164 | + if UserSettings then pcall(function() GameSettings = UserSettings:GetService("UserGameSettings") end) end |
| 165 | + if GameSettings and GameSettings.SetQualityLevel then pcall(function() GameSettings:SetQualityLevel(Config.QualityLevel) end) end |
| 166 | + |
| 167 | + Lighting.GlobalShadows = false |
| 168 | + Lighting.Brightness = 1 |
| 169 | + Lighting.Ambient = Color3.fromRGB(120,120,120) |
| 170 | + Lighting.OutdoorAmbient = Color3.fromRGB(120,120,120) |
| 171 | + Lighting.FogEnd = 1000 |
| 172 | + |
| 173 | + for _, v in ipairs(workspace:GetDescendants()) do |
| 174 | + disableSkillEffects(v) |
| 175 | + end |
| 176 | +end |
| 177 | + |
| 178 | +workspace.DescendantAdded:Connect(function(v) |
| 179 | + if LowGFX_Enabled then disableSkillEffects(v) end |
| 180 | +end) |
| 181 | + |
| 182 | +-- FPS Counter |
| 183 | +local fps = 0 |
| 184 | +local lastUpdate = tick() |
| 185 | +RunService.RenderStepped:Connect(function() |
| 186 | + if FPS_Enabled then |
| 187 | + local now = tick() |
| 188 | + fps = 1/(now-lastUpdate) |
| 189 | + lastUpdate=now |
| 190 | + FpsLabel.Text = "FPS: "..tostring(math.floor(fps+0.5)) |
| 191 | + end |
| 192 | +end) |
| 193 | + |
| 194 | +------------------- |
| 195 | +-- Button Actions |
| 196 | +------------------- |
| 197 | +LowGFXButton.MouseButton1Click:Connect(function() |
| 198 | + LowGFX_Enabled = true |
| 199 | + applyLowGraphics() |
| 200 | +end) |
| 201 | + |
| 202 | +FPSToggle.MouseButton1Click:Connect(function() |
| 203 | + FPS_Enabled = not FPS_Enabled |
| 204 | + FpsLabel.Visible = FPS_Enabled |
| 205 | + if FPS_Enabled then |
| 206 | + FPSToggle.BackgroundColor3 = Color3.fromRGB(0,170,80) |
| 207 | + FPSToggle.Text = "FPS: ON" |
| 208 | + else |
| 209 | + FPSToggle.BackgroundColor3 = Color3.fromRGB(170,0,0) |
| 210 | + FPSToggle.Text = "FPS: OFF" |
| 211 | + end |
| 212 | +end) |
| 213 | + |
| 214 | +ResetGFXButton.MouseButton1Click:Connect(function() |
| 215 | + LowGFX_Enabled = false |
| 216 | + Config.QualityLevel = 1 |
| 217 | + |
| 218 | + -- Lighting Reset |
| 219 | + Lighting.GlobalShadows = true |
| 220 | + Lighting.Brightness = 2 |
| 221 | + Lighting.Ambient = Color3.fromRGB(255,255,255) |
| 222 | + Lighting.OutdoorAmbient = Color3.fromRGB(255,255,255) |
| 223 | + Lighting.FogEnd = 100000 |
| 224 | + |
| 225 | + -- Reset Workspace objects |
| 226 | + for _, v in ipairs(workspace:GetDescendants()) do |
| 227 | + if v:IsA("ParticleEmitter") or v:IsA("Trail") or v:IsA("Smoke") or v:IsA("Fire") then v.Enabled = true end |
| 228 | + if v:IsA("Beam") or v:IsA("Sparkles") then v.Enabled = true end |
| 229 | + if v:IsA("SpecialMesh") then v.Scale = Vector3.new(1,1,1) end |
| 230 | + if v:IsA("MeshPart") then v.Material = Enum.Material.Plastic; v.Transparency = 0 end |
| 231 | + if v:IsA("Decal") or v:IsA("Texture") or v:IsA("SurfaceAppearance") then v.Transparency = 0 end |
| 232 | + if v:IsA("Explosion") then v.Visible = true; v.BlastPressure=5000; v.BlastRadius=10 end |
| 233 | + if v:IsA("Sound") then v.Volume=1; v.Playing=false end |
| 234 | + if v:IsA("BasePart") then v.CastShadow = true; v.Material = Enum.Material.Plastic; v.Reflectance = 0 end |
| 235 | + end |
| 236 | +end) |
| 237 | + |
| 238 | +------------------- |
| 239 | +-- UI1 Button Action (Toggle UI2) |
| 240 | +------------------- |
| 241 | +UI1Button.MouseButton1Click:Connect(function() |
| 242 | + UI2Frame.Visible = not UI2Frame.Visible |
| 243 | +end) |
| 244 | + |
| 245 | +print("[LowGraphicsUI] โหลดเสร็จแล้ว มี Low GFX Level 2 + FPS Toggle (Draggable) + Reset GFX + UI Drag + UI1/2 Toggle") |
0 commit comments