i made this script to change the size of an Frame or a gui
problem: the script i made seems to not work it does not change the size of a "Frame"
my code:
Frame = script.Parent.Frame
Frame.Size = ({0.129, 0},{0.23, 0})
i made this script to change the size of an Frame or a gui
problem: the script i made seems to not work it does not change the size of a "Frame"
my code:
Frame = script.Parent.Frame
Frame.Size = ({0.129, 0},{0.23, 0})
Hello Retal!
First off, you need to ensure that this is inside of a LocalScript inside of the StarterGui, or a child in the StarterGui.
When changing the size of a GuiObject you have to use UDim2. The reason is because GuiObject.Size uses a value type of UDim2.
In your instance, your script should look like this:
local frame = script.Parent:WaitForChild('Frame')
frame.Size = UDim2.new(0.129, 0, 0.23, 0)
You can read up on GuiObject.Size here!
Merry scripting!
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
Be sure to mark this as the answer if it helps you!
Thank you @Rinextel
No problem! Good luck!
Thanks!