Functions in functions

function Start()
http.Get(“http://www.web.com/file.txt”, “”, Callback)
end

function Callback()
//Something
end

Is this the right way to do it?

Yes, but it is advised to make your two functions local (which requires you to put Callback above Start), so you don’t get into trouble when someone else calls their functions Start and Callback too.

Ok, im progressing but i get a “Attempt to call a nil value” when i try to run it:

function Callback(contents, size)
local Ret = string.Explode(“kjygb”, contents)
PrintTable(Ret)
end

function PSToTranslate( ply, text, team, death )
http.Get(“http://translate.google.com/#no|en|kjygb “…text…” kjygb”, “”, CallBack)
end

hook.Add( “PlayerSay”, “PlayerSaidtoTranslate”, PSToTranslate )

Can someone tell me what is wrong please?

You have a typo in your http.Get line; it should be Callback.

Note that to make your functions local, you also have to put ‘local’ in front of ‘function’.

Oh, thx