Functions in functions

function Start()
http.Get(“”, “”, Callback)

function Callback()

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)

function PSToTranslate( ply, text, team, death )
http.Get(“|en|kjygb “…text…” kjygb”, “”, CallBack)

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