script:local player = game.Players.LocalPlayer local playerUI = player:WaitForChild("PlayerGui") local presettings = playerUI:WaitForChild("Settings") local Settings = presettings:WaitForChild("Settings") local graphics = presettings:WaitForChild("Graphics") Graphics = script.Parent Graphics.MouseButton1Up:Connect(function() graphics.Visible = true game.StarterGui.Settings.Settings.Controls.Size.X = {0,150} game.StarterGui.Settings.Settings.Controls.Size.Y = {0,28} end)
To change the X value of a Gui:
YourGui.Size.Scale.X = 1
From the look of it your script will possibly not work (I'm not quite sure), Instead do this if your script is not located under the Gui.
-- If your script isn't located in the "StarterGui" do this local localPlayers = game.Players.LocalPlayer local playerGui = localPlayers:FindFirstChild("NameGui") -- The name of your gui. local settings = playerGui.Settings settings.Size.Scale.X = 1
However if it is a child of the Gui then
local settings = script.Parent settings.Size.Scale.X
To change a gui's size <----
settings.Size = UDim2.new(1, 0, 1, 0)
Fix for your script (Hopefully)
-- Player Variables local player = game.Players.LocalPlayer local playerUI = player:WaitForChild("PlayerGui") -- Gui Variables local settingsAncestor = playerUI:WaitForChild("Settings") local settingsChild = presettings.Settings local controls = settingsChild.Controls local graphics = settingsAncestor.Graphics local textButton = script.Parent -- Changed graphics to textButton textButton.MouseButton1Click:Connect(function() graphics.Visible = true controls.Size = UDim2.new(0, 150, 0, 28) end)
Your script is a bit messy, and I can't tell which gui you wamt the size yo be changed, also you didn't pay attentiom to what I've written about and didn't evem bothered to modify your script. Here, hopefully will fix it