I have a localscript, and the first line is getmousething(). Later in the script, I have:
function getmousething()
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.KeyDown:connect(function(key)
if key.Byte == 102 then
print 'F presseed'
end
end)
end
The error message is attempt to call global 'getmousething' (a nil value). Why can't it find that function?

5 comments
I'll try something to fix it I guess
This is incorrect. If you have a function present anywhere within the script, it will fun the function. People put them at the top purely for convenience.
Why did i get a negative point for telling you the correct answer... Go ask anybody else and they'll say im right. Just trying to help :l
Alright if you think your right, Go make a function that is at the bottom of your script and put the caller at the top.. I just tested this 2 minutes ago and it called an error because the function was nil....
@Necrorave Not true, Kevin is correct. I had a problem calling a function inside a function because the function being called was below the function that called the other one.