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!
You have to put the connection line:
Start.MouseButton1Down:connect(ClickedStart)
After the function that it is connecting to.
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 Start.MouseButton1Down:connect(ClickedStart) -- Here
If you don't, the script won't know that "ClickedStart" is the function. It will just say it's nil.