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
18
votes
1 answer

Bizzare "attempt to call a table value" in Lua

The following code snippet: for weight, item in itemlist do weight_total=weight_total+weight end is causing the error "attempt to call table value" on the first line in that snippet. Why? Itemlist is a table of tables of weights and strings,…
Schilcote
  • 2,344
  • 1
  • 17
  • 35
5
votes
1 answer

Why do I get this "attempt to call a table value" when iterating through a table?

I'm trying to find the key associated with the value of a table in Garry's mod Lua, but I'm getting an error as though it's not a table. This is part of a larger solution to a game crashing bug on someone else's code that I'm…
Fennecai
  • 109
  • 3
  • 13
4
votes
1 answer

How to fix 'Permission denied' in Docker sh entrypoint

I'm trying to create an easy-to-use Docker image for the Garry's Mod server. While my Docker image builds just fine, running it as a container always results in a single error: /bin/sh: 1: ./easygmod.sh: Permission denied. I'm using the…
Phyremaster
  • 87
  • 2
  • 8
3
votes
1 answer

Unexpected symbol near '<'

I'm trying to code something in Lua where you must be exactly 12 years old to make it print "Welcome!". However, whenever I run this code, I get an error message saying Unexpected symbol near '<'. The error message says that this is on line 3. If…
katooosha
  • 35
  • 1
  • 1
  • 7
2
votes
1 answer

Install GLIBCXX_3.4.15 on Centos 6.9

I have a problem when I try to start my server Garry's Mod. Here is the error I get Failed to open dedicated_srv.so (/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by bin/dedicated_srv.so)) Add "-debug" to the ./srcds_run…
Matt
  • 21
  • 1
  • 1
  • 3
2
votes
1 answer

How to accept user input for a constant and use writeprocessmemory?

How do I use WriteProcessMemory to change ammo of my current ammo address? I know how to read it I just don't know how to write it. Is SetAmmo . I thought i'm doing everything wright? Code: #include #include #include…
Zack Oliver
  • 107
  • 6
2
votes
1 answer

Attempt to index global 'io' (a nil value)

Before I explain my problem, I have already had a look around stack overflow and looked through countless questions regarding this error message. I have tasked myself with building an updating stats page on my website which updates itself with…
pythagon
  • 105
  • 2
  • 10
2
votes
1 answer

Trying to match values from one raw file with another raw file values in Lua

First of all: I'm an inexperienced coder and just started reading PiL. I only know a thing or two but I'm fast learning and understanding. This method is really unnecessary but I sort of want to give myself a hard time in order to learn more. Okay…
2
votes
1 answer

Getting one value from a table and assigning it to another with no repeats

Specifically, this is for Garry's Mod, however I don't think that matters too much in this problem. What I want to do is get one player, and set their value to another random player (so every player has a random 'target'). I want to do this with no…
Jake Stanger
  • 449
  • 1
  • 8
  • 24
1
vote
0 answers

Python Process Memory Detecting

I want to detect some strings in programm process. Here is, how to do it using process hacker: Find process > RBM > Properties > Memory > Strings button > Minimum length: 4 > enter image description here > OK > Filter > enter image description here…
Stanislav
  • 13
  • 3
1
vote
1 answer

sound.Play() is not playing custom sound file in Garry's Mod

No custom sound files are played, but in-game sound files are played. Sound file has 44100Hz I have tried stereo and mono mp3 and ogg I have also tried local soundFile = "addons/testaddon/sound/testsound.wav" hook.Add("KeyPress", "myTestAddon",…
user16028798
1
vote
0 answers

Glua/lua, sharing data between client and server

I completely understand if this post is a waste of time, as glua(Garrysmod the game) is a niche area, and there isn't too many resources out there. I recently moved back to Lua a few days ago, after first attempting in 2013 when I was young and…
Carl
  • 102
  • 1
  • 7
1
vote
1 answer

How can I attach multiple models to an entity in Garry's Mod?

I want to make a scripted entity that looks like the left side of this picture, combining several models together: the equipment rack, computer screen, keyboard, battery, etc. I want to do this with Lua scripting, not by using Blender to merge all…
Fako
  • 23
  • 3
1
vote
1 answer

Chek table for string.find

How I can check table for string.find? My code: WEAPON_TABLE = { -- I need check this weaponclass of sweps "swep_1", "swep_2", "swep_3" } if string.find(v:GetWeaponClass(), ???) then -- end
1
vote
1 answer

Gmod | Entity Spawning

if SERVER then function SWEP:PrimaryAttack() if self.Owner:GetEyeTrace().HitPos:Distance(self.Owner:GetPos()) < 100 then local entity = ents.Create( "gred_emp_grw34" ) if ( !IsValid( entity ) )…
KarmaLN
  • 11
  • 2
1
2 3
13 14