Hey guys so I have been making a code that will enlarge a on screen gui in a fancy way, currently just testing to see if it works but I can't get it to work. Whenever I click the start button it says in output attempt to call a nil value!
Here is the code:
Start = script.Parent.StartButton
CourseSelect = script.Parent.CourseSelect
Start.MouseButton1Down:connect(ClickedStart)
target = game.Workspace.SpawnLocation
camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
angle = 0
go = 0
-- Size X 400, Size Y 300
camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.new(20, 5, 20)
* CFrame.Angles(0, -.3, 0)
function ClickedStart()
for GuiSize = 1, 30 do
if GuiSize <= 30 then
CourseSelect.Size = CourseSelect.Size +UDim2.new(0.05, 0.05, 0, 0)
end
end
end
It's in a local script and I'm kinda new so if anyone has any suggestions. This is basically suppose to change the camera angle and when you click start make a little textbox open in a fancy way!

2 comments
Thanks! This works, one more question, is there a way to make a for statement that will continue until CourseSelect reaches a certain size?
Bman8765: A
whileloop is more appropriate. E.g.,while CourseSelect.Size.Scale.X < 0.5 do