Garry's Mod

Garry's Mod

gTerminal Universal
 This topic has been pinned, so it's probably important
"Hello world" on Lua gTerminal
I saw that not all players understood how to program on the new terminals. I didn't get it at first either, but I see more potential in today's versions than in my beloved gTASM. Here's what I discovered.
  1. First you need a Root Computer and no others (their operating systems won't let you create a *.lua file). You can still save the program on a floppy disk and transfer it to a regular computer.
  2. Only the *.lua file will run. So let's create the first program:
    :f touch hello.lua
  3. Enter this line:
    gTerminal:Broadcast(entity, “Hello World!”)
  4. Run:
    :f exec hello.lua
    And that's it!
.
As you realized, I am not a developer and found all the information with the help of gmad.exe and by looking at the source code of the addon. Maybe I'll post more findings later.
< >
Showing 1-2 of 2 comments
You can change the output text using the codes:
GT_COL_NIL = 0; GT_COL_MSG = 1; GT_COL_WRN = 2; GT_COL_ERR = 3; GT_COL_INFO = 4; GT_COL_INTL = 5; GT_COL_CMD = 6; GT_COL_SUCC = 7
Here's an example of green text:
gTerminal:Broadcast(entity, “Hello World!”, GT_COL_SUCC)
Ohh, now we are getting into something
< >
Showing 1-2 of 2 comments
Per page: 1530 50