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

How to select random .wav/.mp3 file from folder with Garry's mod?

I've recently started Coding a program that will replace sound effects from a default directory, in the Source-Engine Game, Garry's Mod. This is the current code: function GM:PlayerFootstep( ply, pos, foot, sound, volume, rf ) …
user46243
  • 13
  • 5
0
votes
1 answer

Garry's Mod RunConsoleCommand() does not work correctly

I want to let some friends connect to my server just by clicking a simple button in the Garry's Mod menu. To do that I have added some code to the mainmenu.lua file of Garry's mod. The Button and all other things work, only the…
Luca Schimweg
  • 747
  • 5
  • 18
0
votes
2 answers

Search through table in lua (Whitelist)

I have been trying to code a whitelist add-on for my Garry's Mod server. I am fairly new to LUA so any help is much appreciated. I have an Idea for it, but I don't know how to search through it. say I have a table local Table = { Player1, Player2,…
0
votes
1 answer

Gmod Lua Coding - How to place an HTML5 Page (Website) Inside of a Box

I've been working with a friend and we both have a problem, in a Garry's Mod Server, ok so we have a box saying Rules, and when we go to place a website INSIDE OF THAT BOX, it shows exactly this:…
0
votes
2 answers

Garrys Mod ULX if user is group then

Basically I am trying to use ULX in Garrys mod and have a file check if the user is VIP or staff that it will give them a weapon as soon as it notices the weapon being weapon_physgun. This would need to check over and over so when a player joins or…
Avery Johnson
  • 11
  • 1
  • 4
0
votes
1 answer

GMOD 3D2D Sign with website

I'm trying to make a 3D2D Sign that has text on it and displays a website, so that i can walk around it and the website will stay in the same position. So far I have got this code but don't know how to import the…
Quantum
  • 379
  • 3
  • 12
0
votes
2 answers

Lua attempt to call field 'PlayFile' (a nil value)

I am trying to create an Lua addon for Garry's Mod but I keep coming across an error in my code. This is my code: function say (Player, text, ent) s = "/misc/custom/"..text s2 = s..".mp3" sound.PlayFile(s2) end hook.Add("PlayerSay",…
Jake Sharp
  • 11
  • 1
  • 3
0
votes
1 answer

(Garry's Mod DarkRP) Wildcard selector from ammo.lua searching jobs.lua

I'm not sure if this is the right section for games, but still. I am a developer for a in-dev server that I believe uses FAdmin & ULX for the admin.. things.. anyway; I am currently developing the jobs.lua, shipments.lua, and ammo.lua. It's supposed…
David Vex
  • 29
  • 8
0
votes
1 answer

Garry's Mod Custom Cvar not changing

I'm making a script for Garry's Mod and it's almost complete but for some reason when ever I type in the new Cvar i made it won't change host_framerate. if anyone know what the problem is your a life saver. local speedCvar = CreateClientConVar(…
0
votes
1 answer

attempt to call field 'ADD' (a nil value)

When I bind the command to key it keeps telling me "Unknown command: TestJump". Here is what I do, I run the command in console "lua_openscript_cl TestJump" then I do "Bind e "TestJump," but that is where it starts to tell me that the command is…
WetCactus
  • 11
  • 1
  • 4
0
votes
1 answer

Garrys Mod lua kick and gag Troubble

I've got a Server and want to add tabs to the menu I've put in the command local force = actions:AddOption( "Kick Player from the game" ) force:SetIcon( "icon16/delete.png" ) function force:DoClick() RunConsoleCommand("ulx kick","reason",…
0
votes
1 answer

Gmod 13 Lua Error

I am trying to learn Lua and I decided that for my first project I would try to fix a broken script. I have fixed a few of the bugs but I'm stuck now. Can you help me? function SWEP:PrimaryAttack() if( CurTime() < self.NextStrike ) then…
Bob Joe
  • 1
  • 2
-1
votes
1 answer

lua/pivohelperv2.lua:127: unexpected symbol near ')'

Pls can u help me, thats not all of the code but in this piece problem. Thats Glua and i hope u help me!!! local dPanelButton1 = vgui.Create( 'DButton', dPanelDa) --Кнопка для лотки dPanelButton1:SetSize( 250, 50 ) dPanelButton1:SetPos( 625,…
Buba
  • 1
-1
votes
2 answers

Having troubles getting a Garry's Mod private server to connect to MySQL database using MariaDB

Trying to get a private Garry's Mod TTT server started to test things using publicly released code (moat.gg GitHub.) Got the database setup using MariaDB and am met with errors when launching the server that I cannot figure out on my own. Zero clue…
esatat
  • 1
  • 2
-1
votes
1 answer

GMod - lua code doesn't seem to work but displays no errors

Trying to change damage modifier in Garry's Mod with lua, because sk_npc_head doesn't work. Here's the code I'm trying to use in Hammer Editor: function FScaleNPCDamage( npc, hitgroup, dmginfo ) if ( hitgroup == HITGROUP_HEAD ) then…