Bomb Bloke, is there any way I can make that possible? Make other functions acess other functions information? If not, that's okay, I will figure a solution myself.
There are a number of ways.
One is to have the function return those values:
local function getStuff()
local a=read()
local b=read()
return a,b
end
local c,d = getStuff()
print( c.." "..d )
Another is to declare the variables as local to the whole script, not just to your function:
local a,b
local function getStuff()
a=read()
b=read()
end
getStuff()
print( a.." "..b )
Yet another is to simply not declare the variables as local at all, but this has the side effect of having them remain in RAM when the script ends. Ideally, all variables and functions in your script will be cleared when the script ends.
Also, I'm not really familiar with this "tonumber(read())", so, I can use it to basicly get an input in form of numerals, insteed of a string? So, something like "local input = tonumber(read())" should work?
Yes, that's how it works - the string result of the "read()" function gets passed to the "tonumber()" function, which returns a numerical representation.
Note that if the string can't be converted - say the user typed "cheese" - then "tonumber()" returns nil. Bearing in mind that for the purposes of a conditional test (like for your "if" statements), nil counts as false, you'll typically want to loop until the user co-operates:
local myNumber
repeat
print("Type a number:")
myNumber = tonumber(read())
until myNumber