Functions do things, they can return whatever they want. The reference for garrysmod simply lists what to expect as a return from all the built in function, a made up standard.
Some built in functions will do call hooks (which just means it alerts the code environment that this function has just ran) these will look like :
hook.Call("SomeStringHere",nil,"test") -- the nil is for gamemode table, it is not a variable to pass.
When the previous code is executed, it will trigger anything that does this:
hook.Add("SomeStringHere","MyUniqueNameThatCanBeHookedAlso",text) --the text variable will be "test"
The functions that do a hook.Call are generally meant not to be overriden, they do basic game functionality stuff. Having a function use a hook.Call, allows the user to then do hook.Add, and “append code” to the end of that function without removing the basic functionality that is needed.
Usually these hook.Call’s are executed BEFORE a function returns a value to whatever called it. After a hook.Call has been executed, and a user “appends some extra code” to the function with a hook.Add, the function continues to run the line after hook.Call and does some logic before doing a function return. As mentioned earlier the wiki has listed what is to be expected from these functions, so you can force the function to “return” different values based on what you did in the hook.Add.
An example would be:
--target is, what is taking the damage.
--damageinfo is a table that is passed, containing damage information like: type,how much damage...etc
-- If you dont return anything here, the function that calls "EntityTakeDamage" will proceed as normal, applying the damage in the damageinfo to the target player.
-- if you return true here, the function that calls "EntityTakeDamage" will recognise this and smiply terminate without applying any damage.
return true --Wiki says if we return true, damage will NOT be applied
return false -- If its not a player, damage it!
All that being said, If you know what you are doing you can override things to make them customized, although most functions do a lot more in the background than the hook.Calls make it seem.
--If you make a custom gamemode, you could override the PlayerInitialSpawn function.
--Since we have overriden the built in function. We will need to do some "low level" things here, that are not needed to be done when using a hook.
--For example, you wil need to set player classes, setup data tables, set models of the player, draw clientside hands.
Note- Don’t hate on me for abstracting away from the technical details…I know I know…