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.
garrys-mod
200
questions
0
votes
0
answers
14
views
Img loading error | GLua | Garrys mod HUD
I can't add an image to my HUD in GLUA. I've tried to do it in the code, and I think it should work, but it doesn't. I have the correct type of image and its format.
Folders
hud
|---lua
| |---...
0
votes
0
answers
16
views
Can`t get constraint.HasConstraints working in Lua gmod
I`m writing a gmod lua script which checks if there are constraints for prop spawned by user (like ropes), but it always return false even if I spawn constrained props
if SERVER then
hook.Add(&...
0
votes
0
answers
19
views
How to make ENT:Touch only detect touches from a certain entity [GLua]
I cannot figure out how to make ENT:Touch only detect when touching a specific entity instead of detecting anything and everything touching it. It probably has something to do with the argument but ...
0
votes
0
answers
57
views
Setting up a Garry's mod TTT Server with the Moat Setup - Lua Errors
So i have been trying to setup a TTT Server running the moat addon uploaded by moat - The upload is however very old, this is the github https://github.com/colemclaren/ttt
I have been trying to get it ...
0
votes
0
answers
128
views
TTT-Server: Connection failed after 6 retries
I would like to run a TTT (Trouble in Terrorist Town) server on my own server. I would like to implement this with a Docker container. The server is displayed to me, but there is no password query or ...
0
votes
0
answers
41
views
I have a problem with a table, values are being changed that wouldn't normally be able to be changed
I created a server-side database using SQL and now want to change values using a button in the GUI. To do this, I have the current table sent to me when I join the server and then create a comparison ...
0
votes
1
answer
47
views
Initialize Lua array in a function and use it outside. I do not get it
playerInjuries = {}
function OnPlayerTakeDamage(ply, dmginfo)
if ply:IsPlayer() and dmginfo:IsDamageType(DMG_BULLET) then
local hitgroup = ply:LastHitGroup()
local ...
0
votes
0
answers
107
views
Failed to load sound "sound\hurt3.wav", file probably missing from disk/repository
local AudioSource = nil
-- Define a table of sound file names (without the path)
local soundFiles = {
"hurt1.wav",
"hurt2.wav",
"hurt3.wav",
-- Add more ...
0
votes
0
answers
12
views
im having problems with gmod ACE arrays
ive been stuped by how to use a radar in gmod ACE and want to kno how ( i have no expirience with e2 and need alot of help)
if you have expirience please send in here e2 code that could take position ...
0
votes
1
answer
170
views
ERROR lua/test.lua:4: attempt to call field 'PlayFile' (a nil value)
local AudioSource = nil
hook.Add("EntityTakeDamage", "UniqueNameForYourScript", function()
sound.Play("sound/hurt1.mp3", "", function(source, err, errname)
...
0
votes
0
answers
145
views
Unpack gma files
When I move the addon for the Garry's mod with the gma extension to gmad.exe, the command line flickers for a second and nothing else happens, the files are not unpacked, can anyone know why?
Please ...
0
votes
0
answers
485
views
"attempt to call a nil value (global 'include')"
i have this code :
include("autorun/sh_myaddon.lua")
local myName = "Jakub"
local age = 999
print(myName)
print(age)
When i pressed f7 this showned up :
lua: ...rrysmod\addons\...
0
votes
0
answers
87
views
Gmod: When processing a Net request created from a vgui button, the script does not work
I have 2 scripts:
1)init.lua - server script that handles net requests.
2) change_team.lua - client script that handles vgui buttons and sends net requests.
Problem:
When pressing the DButton2 button ...
0
votes
0
answers
334
views
GMOD LUA: Can't set random player model
local models = {
"models/player/odessa.mdl",
"models/player/alyx.mdl"
-- any so on...
}
hook.Add("PlayerSetModel", "RandomPlayerModel", function(...
0
votes
1
answer
31
views
Bullet from my SWEP killing NPC, not the player, it means that GM:OnNpcKilled() don't work properly
GM:OnNpcKilled() don't work properly because killer of the NPC isn't a player, how it should be. Instead it is a bullet
here's my part of code that creating bullet for SWEP:
local Bullet = {}
...