Questions tagged [garrys-mod]

Garry's Mod is a sandbox game based around player created content. Only post questions relating to game modding. For questions relating to game play, see gaming.stackexchange.com.

Garry's Mod is a sandbox game that allows users to use the Lua scripting language to create custom addons, such as weapons, NPCs, etc.

Questions tagged with relate to creating addons for Garry's Mod using Lua.

198 questions
0
votes
2 answers

What causes "Tried to use a NULL physics object!" error in my Garry's Mod Lua script?

I've made a small script that makes ragdolls fly upwards. It works but it leaves an error message and I cant figure out why. [ERROR] RunString:11: Tried to use a NULL physics object! 1. ApplyForceCenter - [C]:-1 2. fn - RunString:11 …
0
votes
1 answer

Garry's Mod Tool-Gun Lua Error

I have decompiled the old Pikmin add-on for Garry's Mod because it's producing the following error: [ERROR] workshop/lua/sv_pikmin.lua:38: attempt to call global 'ValidEntity' (a nil value) 1. v - workshop/lua/sv_pikmin.lua:38 2. Call -…
LWGShane
  • 1
  • 2
0
votes
1 answer

attempt to index global 'GameDatabase' (a nil value) - (A Garrysmod script)

Im a bit stuck on figuring out why this is not working. I have not done anything to the code so im a bit curious to why it would no longer work. Any help is appreciated. Here are the errors im getting: [ERROR]…
0
votes
1 answer

I am getting the following errors with my Garry's Mod server

I've got an addon on my server that basically allows you to create territories. On top of that, I have one which allows you to make permanent properties, which players own even when they aren't online. Additionally, you are able to save the props…
0
votes
1 answer

gmod GameMode Lua. IsPlayer retuning nill value

I'm trying to make a gmod gamemode. In my init.lua I wanted it so that way team members can't hurt each other. So I used this code function GM:EntityTakeDamage( target, dmginfo ) if ( target:IsPlayer() and dmginfo:IsPlayer() ) then if…
FacelessTiger
  • 89
  • 1
  • 1
  • 11
0
votes
0 answers

Gmod Expression 2 Text Commands

I am playing Garry's Mod and I'm trying to make an e2 chip that allows me to add guns to a price list with for example "!name store name" and then "+ AK47- $500". This is what I have so far and I can't seem to figure out how to make the screen say…
Sammy
  • 51
  • 2
  • 11
0
votes
1 answer

Getting error on a script

I created a script for the game Garry's Mod, but once is loaded on some servers, it gets the next error: [ERROR] addons/ulib-master/lua/ulib/shared/hook.lua:110: addons/applysystem/lua/applysystem/init.lua:13: bad argument #1 to 'pairs' (table…
Roberth
  • 95
  • 1
  • 9
0
votes
1 answer

Trying to fix "tMySQL query error: Duplicate entry" For a garrysmod server

I'm new to this website, and I'm not sure if I'm supposed to ask questions about mysql things in a game server. Anyways, I'm trying to fix this error here, and I was wondering if there's anything I can do to figure out, or solve where the issue is…
0
votes
1 answer

Interpolating 3d angles (in Garry's Mod)

I'm trying to interpolate angles in Expression 2, as such: local IAng_ = mix( Begin, End, 0.0-1.0 ) mix( v/a, v/a, n ) is a linear-interpolation function that is (probably) most easily described as: function angle mix( Begin:angle, End:angle,…
Arena
  • 360
  • 3
  • 10
0
votes
1 answer

attempt to index global 'ent' (a nil value)

Before I start I should say that I'm fairly new to programming. Currently trying to make a script that spawns the player at the same spot where he died, however whenever I run the script it gives me this error. [ERROR]…
beepandrew
  • 11
  • 1
  • 4
0
votes
1 answer

Why is it that when I set a new variable to the player entity FindMetaTable("Player") on the server side, but is 'nil' on the client side?

To clarify, because it was hard to explain in the title. -- file that contains this code is > "player.lua" local ply = FindMetaTable("Player") ply.LastDamageType = "N/A" this code sets a new variable to all player entities. The variable is just a…
Andrew900460
  • 621
  • 1
  • 6
  • 16
0
votes
2 answers

Lua Others can run my code perfectly fine but I run into errors?

I have a Lua script that I have been trying to get to work. It is my first Lua script. I asked someone else to run my code, and it worked perfectly fine for them. However, when I try to run it ANYWHERE (I have tried running in Ideone.com,…
katooosha
  • 35
  • 1
  • 1
  • 7
0
votes
1 answer

Garry's Mod Websockets with NodeJS

First, sorry for my English, but I'm french. I need your help because my team and me actually work on "Multi-Server" in Garry's Mod, I explain : We have 4 servers, and we wan't to make comunicate servers, so I have thinking about using Node JS /…
matspider
  • 11
  • 3
0
votes
1 answer

Check if table value starts with

local maps = find.File("maps/*.bsp", "GAME") map = (maps[math.random( #maps )]) print("Map randomized to " .. map ) This code above works on "ULX" on Garry's Mod, it uses find.File to read the directory of garrysmod/maps and return (in TABLE)…
user3521680
  • 97
  • 1
  • 2
  • 7
0
votes
1 answer

Gmod: run commands on startup with addon

YES this is a gmod and a lua question! I would like to know if its possible to run LUA commands though an addon when the user has just launched the game and if so how?
berrixsez
  • 1
  • 2