Garry's Mod

Garry's Mod

116 ratings
LuaSnack
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Entity
Addon Tags: Build, Fun
File Size
Posted
Updated
182.495 KB
11 Oct, 2024 @ 6:54am
12 Oct, 2024 @ 9:53am
5 Change Notes ( view )

Subscribe to download
LuaSnack

Description
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

--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!
46 Comments
elcapykkzxd 5 Jun @ 12:30pm 
k ty
Internet1  [author] 5 Jun @ 10:19am 
Hold C and right click again.
elcapykkzxd 5 Jun @ 9:30am 
when i press right click nothing happends
Internet1  [author] 27 Apr @ 6:58am 
Well, I theoretically could, but I am not currently capable of such methods. The current model allows for one string to be stored within the entity itself. It's a good idea, but as of now, I might not be able to fully implement it. Overall, this entity is just a little experiment I came up with, and thought I'd share it.
Frostice2013 27 Apr @ 3:11am 
about the 511 character limit, i wonder if you are capable of actually removing it by using alternative methods, such as using an editor and storing files locally for them to be loaded, which i think is how Expression 2 and Starfall allow so many lines of code
OBSRANIEC  [author] 18 Mar @ 6:51am 
yummers
Die_ananaswandtapete 17 Mar @ 11:34am 
"If you don't retrieve the Doritos in time, the entire Multiverse is gonna explode, I dunno.."
-Tim
Backrooms - AnIIversary
bob 14 Mar @ 11:28am 
yay
OBSRANIEC  [author] 14 Mar @ 8:57am 
yummers
Internet1  [author] 14 Mar @ 8:47am 
Good ideas! I might consider them in a future update.