Description
Execute a named function within the player's set class
Arguments
1 Player plyPlayer to execute function on.
2 string funcNameName of function.
3 vararg argumentsOptional arguments. Can be of any type.
Returns
1 vararg The values returned by the called function.
Example
Run the player's class 'Loadout' function when PlayerLoadout is called
Output: The player's class 'Loadout' function is executed
Example
Call a greeting function within the playerclass system.
local PLAYER
= {}
PLAYER.DisplayName
= "Hooman"
PLAYER.WalkSpeed
= 200
PLAYER.greet
= function( tbl )
local ply
= tbl.Player
ply:
ChatPrint(
"Hello "..ply:
Nick()
.." !")
end
hook.
Add(
"PlayerSpawn",
"greet",function(ply)
player_manager.
RunClass( ply,
"greet" )
end)
Output: Hello Flowx !