Garry's Mod

Garry's Mod

125 个评价
LuaSnack
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 实体
插件标签: 建筑, 快乐
文件大小
发表于
更新日期
183.343 KB
2024 年 10 月 11 日 上午 6:54
10 月 13 日 上午 7:53
7 项改动说明 ( 查看 )

订阅以下载
LuaSnack

描述
Read the description before asking any questions!!

--What is this?--
This is my first Garry's Mod entity, the LuaSnack! LuaSnacks are edible, blue cubes that execute editable Lua code when eaten. You can find the entity under the "LuaSnack" tab in Entities.

Right-click on a LuaSnack and click on "Set code..." to open the code editor.

--Features--
  • Minimalistic dark editing UI
  • Proper system to prevent a player from editing/eating a LuaSnack when another one is editing its code
  • Kills players on LuaSnack errors
  • Keyword blacklist for non-admins when they edit an already spawned LuaSnack to prevent abuse (Not editable at the moment)
  • Two variables available for use in scripting: eater is the player who ate the LuaSnack, and snackpos is the position of the LuaSnack.
  • Dupe support

--ConVars--
  • luasnack_admin (def. 0) - if only admins can edit LuaSnack code
  • luasnack_errorkill (def. 1) - if LuaSnacks should kill players, set to 0 to disable deaths

--Q&A--
Q: Why the 511 character limit?
A: This is GMod's NW2String limit, I can't do anything about it.

Q: Why are LuaSnacks navy blue?
A: To match Lua's color.

Q: I found a bug/A Lua error happened!
A: Report it as soon as possible, and I'll try my best to fix it.

--Upcoming Features--
  • Multi-language support (I'd be happy to recruit translators!) Closed for now
  • More ConVars

If you have any suggestions, let me know!

If you want to re-upload or make altered versions of this addon, ask me for permission first.

Please note that this is an experimental entity, and should not be considered as a fully-fledged project. Thank you for understanding!
54 条留言
bruhhh 10 月 13 日 下午 2:26 
Ok
Intnet105  [作者] 10 月 13 日 上午 6:37 
no worries, ill add a convar that lets you disable error deaths, incase some people prefer the current behavior. as for the big text, ill make it display on the right as a GMod hint, should be better than in the chatbox since it wont fill up the entire box
llililililili  [作者] 10 月 12 日 下午 4:38 
no /j
bruhhh 10 月 12 日 下午 1:01 
Can you make it so the errors don't kill the eater? This is for better usability, and also the text that appears big on screen, can you make it so it appears on the chatbox on clientside and not as a big text on the middle of the screen? Thx
bruhhh 10 月 12 日 下午 12:54 
W
Intnet105  [作者] 10 月 12 日 上午 5:49 
should be fixed, try now
bruhhh 10 月 12 日 上午 4:00 
Also, there's no font
bruhhh 10 月 12 日 上午 3:56 
[LuaSnack] 'Trebuchet20' isn't a valid font
1. SimpleText - lua/includes/modules/draw.lua:65
2. unknown - lua/entities/sent_luasnack.lua:248


[LuaSnack] lua/includes/modules/draw.lua:69: attempt to perform arithmetic on local 'w' (a nil value)
1. SimpleText - lua/includes/modules/draw.lua:69
2. unknown - lua/entities/sent_luasnack.lua:248

This happens when I click Set Code...
elcapykkzxd 6 月 5 日 下午 12:30 
k ty
Intnet105  [作者] 6 月 5 日 上午 10:19 
Hold C and right click again.