Gamemode swep wont work

I have a gamemode and it says in init.lua

function GM:PlayerLoadout( pl )

pl:GiveAmmo( 250,	"Pistol", 		true )
pl:GiveAmmo( 10,	"RPG", 		true )
pl:Give( "tankgun" )


Yet tankgun doesnt even open. Any help?

the swep is in Treadmark/weapons//tankgun/


It should be in /gamemodes/treadmark/lua/weapons/tankgun

lua_openscript path/to/file.lua

See if you get any errors, if so post the errors and the lua file’s contents.

lua_openscript D:\Program Files\Steam\steamapps\rhombusbungle\garrysmod\garrysmod\gamemodes\Treadmark\weapons\lua ankgun

Running script D…
LuaGetfile: Not Loading D
Couldn’t include file ‘D’ (File not found)

The path from garrysmod… so “gamemodes/Treadmark/weapons/lua/tankgun/shared.lua”

Did that, same error

By any chance do any of you know how to model? :smiley:

For your information, Im on this game mode also.

You can’t open a script in the gamemode folder…

Did my solution not work?

no it didnt. :frowning:

Entoros, if you look at a earlier post he says he did it.

…Did the openscript thing. I read the thread, trust me.

It’s possible it’s an error with your SWEP; try posting the code.

I tested with a swep that i knew works. still no result. I know its not in the swep.

Ok, paste the path starting at your /garrysmod directory where your weapon is.

garrysmod\gamemodes\Treadmark\lua\weapons ankgun\shared.lua

Ignorance alert in post below,

Does it matter which way the / go? Because he has it backwards



I don’t really see why we need to specify it because just typing the command ingame gives you a list of everything you can type.

still no luck D:

Your shared file should be ‘gamemodes/Treadmark/entities/weapons/tankgun/shared.lua’. Is it?


if it is then run lua_openscript “Treadmark/entities/weapons/tankgun/shared.lua” and see what happens.