Title / Thread Starter Last Post ByReverse Sort Order Replies Views
Help

Cloaking Lua

Im new to GLUA and this is my first SWEP. I am currently developing a cloaking device SWEP for a TTT (Trouble in terrorist town) server I associate with and can't figure out what the problem is. Here is a link to the script:...

16th August 2016
by FalconDJ Go to last post
0 234
Help

TTT Custom Player Model HANDS Not Showing

I'm a LUA noob. Here's what I've done. hook.Add("TTTBeginRound", "BeginRoundDetectiveSkin", function() for k,v in pairs(player.GetAll()) do if v:IsActiveDetective() then v:SetModel(Model("models/player/dduck/daffyduck.mdl")) end if...

16th August 2016
by xbeastguyx Go to last post
18 525
Question

Questions about modelling

Hello there. I would probably have put this into the modelling section but my question is rather Garry's Mod specific. I was hoping to start modelling weapons. Hopefully it will allow me to learn new skills that I can put to other things. I was wondering...

16th August 2016
by MPan1 Go to last post
2 152
Lua

Resolutions

Ok, so I hope to dear god I'm not too late. I simply never though about this while coding my hud, but it doesn't fit every resolution! I know that's really dumb of me, but is there a way I can fix it? I hope I don't have to restart. I spent so much time...

16th August 2016
by MPan1 Go to last post
3 187
Help

How to add current ammo in chamber to hud?

So im making a hud and i want to add a ammo counter. However i cant find how to add the ammo that i have in my magazine. I used draw.SimpleText(ply:GetAmmoCount(ply:GetActiveWeapon():GetPrimaryAmmoType()), "Trebuchet24", 346, 27, Color(0,0,0,255)) but...

16th August 2016
by iJohnny Go to last post
3 158
Lua

solved DarkRP HUD

Hey guys, back at it with the HUD i've been working on, can someone help me figure out how to add a agenda to my hud?

16th August 2016
by JoshyWalrus Go to last post
7 175
Help

solved Map - Leveloverview

is it possible to get get an leveloverview like you can create in counterstrike with cl_leveloverview but as lua code? so it will be safed as .png or .jpg and i can use it for an ingame map that can be toggled on and off or can i add a camera that...

16th August 2016
by poepel Go to last post
3 183
Lua

Putting options in a config rather than in 1 file.

Hi, im currently working on my first lua project, a standalone admin stick. It's based on the PERP one. All options are done via addgear, and are then all gathered together and put in a list for the user to choose. However, i want all those...

15th August 2016
by code_gs Go to last post
1 139
Help

Accessing an entity specific function instead the metatable version

I am trying to override a specific entity function that's in the metatable for a SENT; is there a way to do this properly?

15th August 2016
by sannys Go to last post
3 174
Lua

Have i used variables correctly my script?

local servername = enterservernamehere local server1 = entergamemodehere local server1ip = enterserveriphere -- Do not edit below this line. local DrawServerJoiner = vgui.Create( "DFrame" ) Frame:SetTitle( servername .. "Server Changer!" )...

15th August 2016
by sannys Go to last post
3 189
Help

Shooting players in their vehicles

I was wondering if there was a way to be able to shoot players in their vehicles. I've tried an addon before for this, and it lacked support for the driver being able to take damage. (Only damaged the passengers)

15th August 2016
by Texas_on_duty Go to last post
3 195
Help

Derma Question

The code is supposed to change a players class when clicked. I'm a bit confused on the bit with the for loop and local line. I think I understand line.ply holds a player, but I'm not sure how the double-click knows which player was clicked. If someone...

15th August 2016
by geferon Go to last post
4 147
Help

solved Intentionally Delayed Bullet Firing Twice on Servers

Hi again users of Facepunch. While working on a small SWEP, I ran into a bit of a problem. I have it so when I do my PrimaryAttack Function, a bullet is fired two seconds later thanks to a timer. On singleplayer this works absolutely fine, however,...

15th August 2016
by HeliCawptor Go to last post
2 170
Lua

How do I edit a custom f4 menu TAB?

Hello, I am atm helping my friend with a DarkRP server, but I came across a problem. We want to make a new tab called f.ex "VIP Jobs" in the f4 menu, and we did so. However, we now want to connect this tab with the darkrp jobs, but I dont want to connect...

15th August 2016
by Judas3105 Go to last post
0 108
Help

Lua Help

How do i make this work? if (SERVER) then concommand.Add("rcon2", function(p, c, a) RunConsoleCommand("say"(a )) end) end

15th August 2016
by cudex Go to last post
3 135
Help

system.BatteryPower | How do I use this?

function Timers() timer.Create( "BatteryLife Timer", 1, 0, function system.BatteryPower() return end ) end hook.Add("PlayerInitialSpawn", "Timers", Timers) Ok so I made a timer, which checks every second for battery power and returns it? How do I...

15th August 2016
by MPan1 Go to last post
3 211
Help

Surface.DrawPoly | Help

So how do I draw, a circle... just a simple circle... with surface.DrawPoly This is what I wan't the non-hollow circle to be inside... surface.DrawCircle(200, ScrH() - 300, 100, 0, 0, 0, 255 ) How would I draw this? Thanks ... please help..

15th August 2016
by MPan1 Go to last post
3 148
Help

Garry's Mod | Loading files on startup help! :'(

Well for a very long time, I have been trying to LOAD my files... this ofcourse dosen't work. By LOAD my files, I mean, all the .lua files in my gamemode... I have no idea how to really load it etc: function GM:PlayerInitialSpawn( ply ) if ply...

15th August 2016
by Coffeee Go to last post
5 159
Help

solved HUDShouldDraw not working?

function HideHUD(name) for k, v in pairs({"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"}) do if name == v then return false end end

15th August 2016
by jacobcooper18 Go to last post
3 112
Help

sound.PlayURL Youtube

So I'm just trying to play sounds from youtube by URL, I'm using an API referenced here. I'm pretty sure what I'm doing is really amateur and stupid but I'm probably not going to figure it out. Anyhow here is my code, ...

15th August 2016
by jacobcooper18 Go to last post
2 180
Help

Dark RP like money help!

Well I have been trying to make Dark RP money for my server.. (I am remaking Dark RP , its going well) but for some god damn reason I can't make a custom money system because when server starts up: Loads Loads Dosen't load unless you reload files...

15th August 2016
by jacobcooper18 Go to last post
10 187
Lua

solved SleekHUD Help

Hey guys! So I haven't really done much of posting on here but I was wondering if I could get some help with my custom hud! I'm creating a hud, called SleekHUD. Not very Unique but for now, that's the name. I'm having some trouble with the money portion...

15th August 2016
by ckhawks Go to last post
3 159
Help

How do I interact with CSS maps?

I've had ideas floating in my head for awhile about making a gamemode that uses counter-strike maps. I'm pretty mediocre at scripting so I think it would be good practice for me. I've made a basic gamemode with custom weapons and teams (probably not...

15th August 2016
by code_gs Go to last post
1 112
Help

Custom addon works on testserver but not on server? :(

Hello dear fp users, im having a problem with i guess my server: i wrote a custom addon and it works on the testserver (hosted& same addons as the main serever) but if i put the addon on the main server it doesnt work like on the hosted test server :/...

15th August 2016
by Alabama Go to last post
16 312
Help

Derma Menu Text

hi how do i create a derma menu with alot of text?, like i wanna create a simple help menu with derma but how do i put text into it

15th August 2016
by Subject_Alpha Go to last post
3 158
Lua

How to use http.post?

I am trying to use http.post in my server but I have no idea what to do for the website part of things. I'm terrible at php and need a bit of help, been trying for some hours and desperately want help. I want to take post variables to the body of my...

14th August 2016
by Diamondz Go to last post
2 207
Help

Beginner coder asking for some feedback

Hey guys. I'm just getting into coding, and I've set my first project as a simple RTD script for a server my friend is starting. I have a couple mindbogglingly simple questions regarding the code that I couldnt find specific answers to online. As such,...

14th August 2016
by sannys Go to last post
3 153
Help

PS1 ammo before and after death

Hey there. Sorry for giving the confusing title but heres what I'm struggling with. Before I paste the code, what I'm trying to do is have a weapon which you can buy on the PS1 store and when you do, itll equip you with said weapon. You can holster and...

14th August 2016
by Bassnecter Go to last post
0 107
Lua

solved LUA Issue - DarkRP

Can't seem to fix this error: lua/includes/extensions/player_auth.lua:66: bad argument #1 to 'KeyValuesToTable' (string expected, got no value) 1. KeyValuesToTable - :-1 2. unknown - lua/includes/extensions/player_auth.lua:66 3. include -...

14th August 2016
by McShiny Go to last post
3 167
Help

Help with lua code

i need to know how to make a custom join message for a certain steam id

14th August 2016
by gonzalolog Go to last post
9 197
Lua

Entity-instance specific variables?

I noticed that code like this: SomeVariable = 5 Is global for all weapons of that class. (The file is for a brush entity) Any way to make them different for each instance?

14th August 2016
by Wyozi Go to last post
10 199
Lua

solved Ending a viewmodel animation instantly. Is it possible?

Hello, sorry for the vague title, but I didn't know how to briefly explain it in the title. So, I'm trying to make a viewmodel with v_hands.mdl model (SWEP Construction Kit stuff). The only problem is that, on deploy, it plays the only animation it has...

14th August 2016
by AlbertoBC Go to last post
3 120
Help

solved LW Cars Skins

I was wondering if anybody knew what the url of the repository for LW Cars is for TortoiseSVN? For example if I were to make tdmcar skins, the repository URL would be "http://svn.code.sf.net/p/tdmcarssvn/code/trunk". Much help if someone could give me the...

14th August 2016
by DRxSoulz Go to last post
2 144
Help

Server Script Not Working?

I have a script saved in my server files at: lua/autorun/server The script is: if SERVER then hook.Add("OnPlayerChangedTeam", "DutyGod", function(ply, oldteam, newteam) if newteam == TEAM_MODERATORONDUTY then ply:SetWalkSpeed(480)...

14th August 2016
by deinemudda32 Go to last post
5 192
Help

NWInt & PData fail to load? | Help

Well.. ply:SetPData( "Save", ply:GetNWInt( "Money" )) and then I use ply:SetNWInt( "Money", ply:GetPData( "Save" )) but when I use it in Initial Spawn anything it dosent load... untill I just reload ingame. And it works perfectly? Is there a way...

14th August 2016
by Klaes4Zaugen Go to last post
6 207
Lua

I've begun my attempt to understand the Lua PIL...

And i often run into very small confusions, if anyone wants to be annoyed by small questions over Steam, you can add me. I'll probably ask you the dumbest questions, but i can promise it won't be after atleast an attempt of research. I won't give...

14th August 2016
by figurez Go to last post
6 194
Help

Setting a trail in lua

Here's my code: util.SpriteTrail( player, 0, Color(245, 245, 245), False, 35, 0, 3, 0.14, "trails/tube" ) I got this error: lua:88: Tried to use a NULL entity! It's on client in the shared area for client and server. I want to add it to the Primary...

14th August 2016
by deinemudda32 Go to last post
13 382
Lua

Simple OOC!

Hello! Iv'e Made another lua thing. Please Comment on this thread saying what I should code next, first who comments will be chosen! so be quick!! ONLY WORKS ON SERVER LUA!!! ONLY WORKS ON SERVER LUA!!! ONLY WORKS ON SERVER LUA!!! hook.Add(...

14th August 2016
by ZombiezPvP Go to last post
36 1,190
Lua

Engi's head not always turning

Hi. Yes, another scripted TF2 sketch in the works, and apparently having troubles when relying on the physics engine. The code below is one of 3 files (b) used to run this little animation, focusing mostly on the Engineer. There is a timer loop...

14th August 2016
by Edward256 Go to last post
3 230
Help

solved How do you broadcast tables?

Just like when you use: PS_GetPoints() it works on any addon anywere? How do you Broadcast a table and let every other plugin use it? Thanks if you help ~

14th August 2016
by code_gs Go to last post
8 128
Help

solved ply:SetModel() error!

ply:SetModel("models/player/barney.mdl") So this is under player spawn in my gamemode, and it works... I spawn as Barney! Hurray, but when I try to change the Model via commands and that you see it for like 1 second then it goes back to the original...

14th August 2016
by jacobcooper18 Go to last post
5 141
Help

TTT FA:S Weapons Not Firing

I downloaded an addon that converts the FA:S weapons to TTT. I installed that and the original SWEPS to my server. The models and weapons spawned in and everything. But, everytime I try to fire one of the FA:S weapons I get this error: ...

14th August 2016
by markusmarkusz Go to last post
1 128
Help

Currency System error

Well, I have made my own Money system... and I have no idea if I have done this right. But I know I have.. function GM:PlayerInitialSpawn( ply ) if (ply:GetPData( "coins" ) == nil) then ply:SetNWInt( "coins", 100 ) ply:SetNWString(...

14th August 2016
by jacobcooper18 Go to last post
4 162
Help

[DarkRP] Nocollide + TDMcars (HELP)

So I recently discovered that people can noclide their car, no matter what rank they are. Now I don't want this so I began to search online, I found a fix but when I tried it it didn't work (https://facepunch.com/showthread.php?t=1291643) <--- That's the...

14th August 2016
by RandyButter Go to last post
2 139
Help

solved Chat Commands

function GM:PlayerSay( ply, bTeam, bDead, text ) if ( string.sub( text, 1, 5 ) == "/nick" ) then ply:SetNWString( "nickname", string.sub( text, 5, 25 ) ) notification.AddLegacy( ply:GetName().. " Has changed there name to " ..string.sub( text,...

14th August 2016
by bigdogmat Go to last post
7 175
Stupid

solved Beginner Help - Gamemode not showing up in main menu

Hi everyone, I apologize for the beginner question. I've spent the last few days browsing through the outdated + updated documentation for Garrys Mod. I've searched numerous posts online (from 2010, to 2012, to 2015) about setting up your own game...

14th August 2016
by sincity Go to last post
3 191
Lua

help with chat tag color (deathrun)

hi i have a deathrun server and i have custom chat tags that i downloaded and edited, and the color of the death and runner are red and blue. so i want to change that to the chat tag color, here an example : like you see the color of the death is red...

13th August 2016
by MPan1 Go to last post
1 135
Help

solved TTT Dear sister error.

Hello! I've been working on porting of TTT Dear Sister v2 SWEP to TTT. So far I can equip it, however when I try to fire I get greeted with this error: addons/ttt dear sister/lua/weapons/ttt_dearsister/shared.lua:63: attempt to call global...

13th August 2016
by ncc360 Go to last post
7 226
Help

solved What Am I Doing Wrong (Lua Not Working)

In single-player, I try to do lua_run_cl ply:SetHealth(11) and it doesn't work. I tried doing ply:SetWalkSpeed(750) on a server too and it didn't work. I am not sure what I am doing, I made a script and did lua_openscript_cl setHealth.lua ...

13th August 2016
by itzkaneki Go to last post
5 113
Lua

solved PhysObj:GetMass()...

Firstly I apologise if my mistake is a common/stupid mistake, I have recently decided to learn how to make simple scripted weapons on garry's mod and I'm still learning, My code runs when the function SWEP:SecondaryAttack is executed. local pr =...

13th August 2016
by Deception_ Go to last post
2 101
Help

solved Server redirect script

I currently purchased a new server box under a new IP and I was wondering if it was possible to make a script to put in my old server so that when ever someone joins my old server they will automatically connect to my new one.

13th August 2016
by phillipsincs Go to last post
9 333
Help

solved table.Insert doesn't save after map change

Title pretty much says it all. How would I get table.Insert to change after a map change? Thanks!

13th August 2016
by Unknown Gamer Go to last post
2 130
Help

solved Detecting Steam Name change

What hook/function do I use to execute code when a player changes their Steam name? Been digging around for a bit and can't seem to find it. Thanks in advance.

13th August 2016
by Robotboy655 Go to last post
2 148
Help

Freeze specific bones?

Im making a swep pack where you can do diffrent moves by chaning postition and rotation of bones, but I have ran into a pretty big problem, when walking and lets say, puching yourself in the face at the same time the animation doesnt look like it should...

13th August 2016
by Beefdroid Go to last post
0 91
Lua

DarkRP Spawing Error

It seems that my server has broke... When I log in I spawn underneath the map with no money or salary, Its seems I become a Concrete statue when I look in third person. I would appreciate some help as to what to to Here are some images of what I...

13th August 2016
by Coffeee Go to last post
3 134
Help

Collisions Help With Zombie Survival/ Boss Issues

Ok so Im gonna try and be as descriptive as possible so this isnt one of those threads that gets ignored like most. So first let me list the gamemodes Im working with the links will be below. Thanks in advance and I hope you can help me out! Zombie...

13th August 2016
by Braintwistah Go to last post
11 354
Help

[LUA/SWEPS]TTT ,explosive awp Scope keeps zooming in on weapon switch

Hello dear facepunch users so iam having the following problem: We're using the weapon weapon_mk_awp on our server so if you zoom in with it everything is fine but if you dont zoom out & just switch to another gun it keeps you zoomed in just a zoom....

13th August 2016
by Alabama Go to last post
5 183
Help

why do i get this error in my welcome message? ')' expected near 'ply'

this is what i have in my code PrintMessage(HUD_PRINTTALK,"Welcome" ply:Nick().."to the server.") But i get a script error and ive been trying to figure out the problem. This is probably very simple and i apologise for wasting you guys time. ...

13th August 2016
by COMBOBREAKER Go to last post
2 141
Help

How often is Tick and PlayerTick called?

Both pages in the wiki don't say this, is it because it can be changed? If so, should I use timers?

13th August 2016
by Robotboy655 Go to last post
4 157
Help

Playermodels won't spawn with bodygroups

I am currently making a MilitaryRP and am using lots of models that require bodygroups for what I'm aiming to do. Below is what I currently have put under the model: PlayerSpawn = function(ply) ply:SetBodygroup(1, 3) ply:SetBodygroup(2, 0) ...

13th August 2016
by Promptitude Go to last post
16 284
Help

360 Degrees Camera Turn?

So im making a swep that allows you to do flips, I have finished the thirdperson view flip for the playermodel, but how do I make it so that the camera spins around 360 degrees? function SWEP:SecondThink() local ply = self.Owner local FT =...

13th August 2016
by Beefdroid Go to last post
4 151
Help

LUA Rainbow Coloured Entity

Hey, I'm VERY VERY new to LUA so sorry if I sound stupid and sloppy in this but I have 0 education with LUA. I want to make my VIP printers for DarkRP a multi-coloured (rainbow) colour but I can't seem to get it to work. In the printer's .lua where...

13th August 2016
by LUModder Go to last post
20 322
Help

TCB's Car Dealer Problem

customCheck = function(ply) return CLIENT or not ply:Team() == TEAM_TAXI end, CustomCheckFailMsg = "You are not a taxi driver!" Once I am a taxi driver and try to buy the car it still says "You are not a taxi driver!", Please help!

13th August 2016
by crazyscouter Go to last post
6 131
Lua

solved [LUA] Need help with making the code work for my server

August 2016 1 Posts Hello dear facepunch users i would need help with my code, i dont see errors in the logs /server logs but this is the error: my code works perfectly on singeplayer the command works & the hud works,on the server the commands works...

12th August 2016
by Alabama Go to last post
4 202
Lua

Where can I learn lua/swep creation, and mapping?

Ok, so I've never had any "proper" experience with lua (or any other coding language) and really want to learn how to make SWEP's, the garrysmod.com wiki isn't that good because they have 1 SWEP tutorial and it doesn't even go into much detail. Are there...

12th August 2016
by bigdogmat Go to last post
8 171
C++

I found a solution to the CEF x86_64 requirement problem on macintosh computers.

First a little background: Garrysmod's built in browser is very outdated, ridiculously so. It was proposed a while back that garrysmod switch to using Chromium Embedded Framework (from here on CEF) however this was turned down by the lead developer of...

12th August 2016
by YourStalker Go to last post
13 590
Lua

help with runner models

hi i have deathrun server and i wanted to change the runner models to this : http://steamcommunity.com/sharedfiles/filedetails/?id=304035368 i have already death model, this is the code : if ply:Team() == TEAM_RUNNER then ply:SetModel( mdl or...

12th August 2016
by code_gs Go to last post
5 123
Help

Help with DFrame:MakePopup()

So let me explain my problem. I'm trying to create a DFrame that is very small and has no room for a close button keep this in mind. It also has to be draggable but when I set it too draggable, its not draggable at all. So after a while I realized I had...

12th August 2016
by geferon Go to last post
3 204
Help

solved Using variables across folders

I am using dark rp modification and I need to access the variables in /lua/darkrp_customthings/jobs.lua from /lua/darkrp_modules/somefolder/some.lua However when I attempt to access them I get nil. Also, when i try to include the jobs file, it actually...

12th August 2016
by nuunuu Go to last post
13 376
Help

TTT adding avatar to corpse.

Hello! I have a weapon that allows traitor's to fake their death. However when you check the fake corpse it shows a blue question mark instead of the steam avatar. Anyone know how to fix this so the fake body will show the avatar? Code Below: ...

12th August 2016
by markusmarkusz Go to last post
9 315
Lua

Spawn Menu binds are not working?

I am not sure but the Spawn Menu binds are not working, it would be helpful if there is a function to allow someone accessing to spawn menu binds. Example: Take Toolgun Spawn Dynamite Click they "KEY" so the dynamite explodes (which is not working...

12th August 2016
by Monkey4TL Go to last post
10 311
Help

Creating a colour changing money printer-Need help!

Using Koolaidmini's Custom Printers cl_init.lua = http://pastebin.com/r6DSGUrv init.lua = http://pastebin.com/7b59PQt1 shared.lua = http://pastebin.com/VdTFXtGy Code I am using for the colour is ent.printerColor =...

12th August 2016
by Monkey4TL Go to last post
6 265
Help

Creating a spawnlist in the NPCS section

Hello i made a NPC. the name is NPC_HumanDestroyer i can spawn him using Console commands but i can't find him in the NPCS section in the spawn menu How can i create a special Spawnlist just for that NPC? Any idea? it has the default Half-Life 2...

12th August 2016
by Monkey4TL Go to last post
1 119
Help

solved HUD Countdown Timer

Hello everyone. I haven't done any lua coding in a while and I recently came back to one of my old projects. Can someone give me an example of how i could create a 30 minute countdown timer? I need it to show up on the players HUD, and to reset and...

12th August 2016
by A-c-e Go to last post
22 438
Help

Lua Entity:Fire for map logic relays issue.

Hi, made this system with atmos (In atmos init.lua). When I start the server I get this error (for all :Fire's) addons/dnc/lua/atmos/init.lua:395: attempt to index field 'Lua_Night_Lights_Off' (a nil value) 1. func -...

12th August 2016
by TheVingard Go to last post
2 169
Lua

solved keypress hook problem

hello everyone i want to make a key hook , there is my code hook.Add( "KeyPress", "keypress_use_hi", function( ply, key ) print(key) end ) the problem is when i press a key, it sometimes print twice,but i need this only run once, is there...

12th August 2016
by swordjjjkkk Go to last post
4 115
Question

Can't use spawnmenu when deriving from sandbox.

I have tried adding the spawnmenu into TTT by adding DeriveGamemode("sandbox"), but it does not work when I press Q or use +menu. I also changed base to sandbox in the terrortown.txt file and it still doesn't work. Does anybody know how I can get it to...

12th August 2016
by Dan41550 Go to last post
3 190
Help

solved Garrrys mod error

Hey guys. Just recently Ive been getting spammed very badly in the console. This is the error message: lua/includes/modules/draw.lua:192: attempt to index local 'color' (a nil value) 1. RoundedBox - lua/includes/modules/draw.lua:192 2....

12th August 2016
by gonzalolog Go to last post
5 209
Help

ULX Settings Keep Resetting

So every like 2 minutes.. my echo settings reset. Any thoughts? The settings I'm changing are whether or not to echo admin commands :o

12th August 2016
by Recession Go to last post
0 99
Help

Big problem with my darkrp server

Hello, I don't really know my issue, when I'm connecting on the server, I got the problem when I got no money, no models, etc... If you can help me with that, thanks.

12th August 2016
by code_gs Go to last post
3 97