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)
✓ ANSWER ACCEPTED
I cant change the size of a textbutton through script?
1 answer
✓ Accepted answer
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
This discussion is preserved as it was. New answers, comments, and votes are closed.

28 comments
i want to chnge the size value of a textbutton
From the looks of your script, you want to change the X value of it's size. However you want to change the whole size, correct?
yes
Can you please use code block?
what is code block
Anyways I have edited it, try it, and let me know if there's an error
x cannot be assigned to
i dont want to change the size of gui i want to change the textbuttons size
Cam you please show me to whole script you constructed
Also usw code block
whats codeblock
Lemme edit my answer hold on
There
inside where
Inside the ~
lol sorry
thats my script
what do i do
I've edited it, try and see if it works
Tell me if any problem comes up
didnt work but didnt show error
Can you show me your gui path
For example: StarterGui > Settings.Settings.Controls
how
yeah tahts it
Alrighty then do you have a discord
grandmaster1o1#1515
Mines kei, accept it