Garry's Mod

Garry's Mod

评价数不足
TTT Startup Script Loader
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 服务器内容
文件大小
发表于
更新日期
1.875 KB
2019 年 1 月 15 日 下午 11:12
2019 年 3 月 3 日 下午 5:01
6 项改动说明 ( 查看 )

订阅以下载
TTT Startup Script Loader

描述
Loads lua scripts at TTT startup. To use, add lua files to "lua/ttt_startup_scripts".

For example, "lua/ttt_startup_scripts/say_hi.lua":

if SERVER then print("Hi server!") else print("Hi client!") end

The scripts are run once at TTT initialization, within a "pcall".
The scripts are run in the global environment, with the following extra functions:

  • "getEquipment()" - returns TTT's underlying "Equipment" table (available only to "CLIENT").
  • "getOriginalEquipment()" - returns a copy of the "Equipment" table as it was before any scripts ran (available only to "CLIENT").
  • "getDeathsounds()" - returns TTT's underlying "deathsounds" table (available only to "SERVER").
  • "getOriginalDeathsounds()" - returns a copy of the "deathsounds" table as it was before any scripts ran (available only to "SERVER").
  • "lookupInFunc(func, ...)" - looks up a variable available to the specified function. Specify multiple varargs to chain lookups.
  • "deepCopy(v)" - makes a deep copy of any value.
  • "extendSWEP(weapon_class, tab)" - merges "tab" into a SWEP. Note that all calls to this function after "getEquipment()" or "getOriginalEqipment()" have undefined behavior.
2 条留言
MaikysuN 2021 年 4 月 23 日 下午 4:29 
Could you accept my friends invite? I have a question regarding codies but cannot add you elsewhere.
Wemic 2020 年 8 月 10 日 下午 6:56 
Will this mod work for sandbox servers?