I've decided to take a break from my next big game (since there were like a thousand errors that you guys didn't help me on.) so now i'm working on this Gui that allows you to change your camera mode. Here is how it looks like: StarterGui>CameraModeGui>ScrollingFrame>ShoulderCam>LocalScript OldRobloxCam>LocalScript (the newline is for the two objects in the same parent) so here is the first localscript:
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local hit = mouse.Hit
function Onhit(hit)
workspace.CurrentCamera.CameraSubject = plr.Character["Right arm"]
end
the second one is:
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local hit = mouse.Hit
function Onhit(hit)
workspace.CurrentCamera.CameraSubject = plr.Character.Head
end
ok, heres the problem; when I tested it out in solo,(doesn't matter) I clicked on the first one and **nothing happened.**I clicked the second one but it had the same problem. I looked in the output and got:
19:24:19.065 - Plugin attempting to show toolbar that does not exist - 96 19:24:19.105 - Unable to load plugin icon. Image may have an invalid or unknown format. Cutscene Editor Loaded Jojomen56's Utility Plugin successfully loaded.
Mind the errors, if i fix it, you wont be able to use studio tools, sorry if it bugs you! 19:24:25.469 - Plugin_144711773.ArmorMaker.Script:41: attempt to index global 'gui' (a nil value) 19:24:25.470 - Stack Begin 19:24:25.470 - Script 'Plugin_144711773.ArmorMaker.Script', Line 41 19:24:25.471 - Stack End 19:24:25.471 - Disconnected event because of exception
Mind the errors, if i fix it, you wont be able to use studio tools, sorry if it bugs you! 19:24:25.472 - Plugin_144711773.ArmorMaker.Script:25: attempt to index global 'gui' (a nil value) 19:24:25.472 - Stack Begin 19:24:25.473 - Script 'Plugin_144711773.ArmorMaker.Script', Line 25 - global Off 19:24:25.473 - Script 'Plugin_144711773.ArmorMaker.Script', Line 11 19:24:25.473 - Stack End 19:24:25.474 - Disconnected event because of exception 19:24:25.474 - Unable to create an Instance of type "StockSound" 19:24:25.475 - Script '[string "--RoFinder Runtime Source..."]', Line 2442 19:24:25.475 - Stack End 19:30:22.364 - Auto-Saving...
Since that has nothing to do with my problem, I don't know what the problem is. (Every script I make acts like it's not there.) Could someone please point out to me the problem?
Thanks for reading!

3 comments
Are these the full scripts? I don't see a line that calls your functions when the button gets clicked.
you mean the :connect() thingy, I do not know how to do that. And yes, it is a full script.
You need the ":connect() thingy," because it is the method that triggers the script. Without it, the function you want to run will not run.