• Can't find the SWEP I created in my spawnmenu.
    13 replies, posted
Hey guys, Im pretty new to lua coding and need help with something. I recently made my first SWEP ever, I can't tell if it works right or not simply because I can't find it! D: I have it saved in C:\Program Files (x86)\Steam\steamapps\*myusername*\garrysmod\garrysmod\addons\CalvinsSWEP\lua\weapons Its called gun.lua and I can't seem to figure out where it should be in the spawnmenu for weapons. I don't even see a tab in the weapons list called CalvinsSWEP. Please help
Make sure that [code] SWEP.Category = "Calvin's SWEP" SWEP.Spawnable = true [/code] is somewhere in your code. And try making the folder name for the addon lowercase. So, calvinswep instead of CalvinSWEP. I don't know if that matters, but none of my addons are uppercase. Also, the new Garry's Mod Directory is in the common folder. If your Garry's Mod installation is not there already, I would suggest backing up your codes, deleting local content for Garry's Mod on steam, wiping the older installation folder, and re install Garry's Mod.
[QUOTE=-FrozenFire-;41039049]Make sure that [code] SWEP.Category = "Calvin's SWEP" SWEP.Spawnable = true [/code] Is it absolutely necessary to move my gmod directory into the common folder? But I did all the SWEP.Category and stuff, still nothing. is somewhere in your code. And try making the folder name for the addon lowercase. So, calvinswep instead of CalvinSWEP. I don't know if that matters, but none of my addons are uppercase. Also, the new Garry's Mod Directory is in the common folder. If your Garry's Mod installation is not there already, I would suggest backing up your codes, deleting local content for Garry's Mod on steam, wiping the older installation folder, and re install Garry's Mod.[/QUOTE] Is it absolutely necessary to move the directory? Also I added the SWEP.Category and SWEP.Spawnable and nothing still.
If you are new to LUA and coding it would be best for you to post your code on here.
[QUOTE=CalvinTheCat;41040285]Is it absolutely necessary to move the directory? Also I added the SWEP.Category and SWEP.Spawnable and nothing still.[/QUOTE] Yes. You have to move it to the new directory in the common folder, it doesn't read from the old one anymore.
[QUOTE=t h e;41041805]Yes. You have to move it to the new directory in the common folder, it doesn't read from the old one anymore.[/QUOTE] Reinstalled to the common directory, put my folder back in addons. Still no luck.
I know this may seem fairly obvious, but do you have an addon.txt/info.txt? It would probably be better, for the sake of testing, to do this right in your garrysmod/lua/weapons folder if it's only one file for now. It just adds one less thing that could go wrong.
[QUOTE='[LOA] SonofBrim;41051448']I know this may seem fairly obvious, but do you have an addon.txt/info.txt? It would probably be better, for the sake of testing, to do this right in your garrysmod/lua/weapons folder if it's only one file for now. It just adds one less thing that could go wrong.[/QUOTE] I have one but its not in C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\addons\calvinssweps\lua\weapons. And its blank. Could that be the problem?
[QUOTE=CalvinTheCat;41051481]I have one but its not in C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\addons\calvinssweps\lua\weapons. And its blank. Could that be the problem?[/QUOTE] It probably is. Unless this changed in Garry's Mod 13 (I've never tried an addon without one), you need a correctly configured addon.txt or info.txt in your addon's folder for it to register. Like I said, try your weapon in your main Garry's mod directory to avoid this issue.
[QUOTE='[LOA] SonofBrim;41051624']It probably is. Unless this changed in Garry's Mod 13 (I've never tried an addon without one), you need a correctly configured addon.txt or info.txt in your addon's folder for it to register. Like I said, try your weapon in your main Garry's mod directory to avoid this issue.[/QUOTE] Main garrysmod directory? As in C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod Or C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\lua\weapons? Im really confused about this whole thing.
Rename your gun.lua to shared.lua, and put it in a folder (you could just name the folder weapon_gun). Then put THAT FOLDER in your steam/steamapps/common/GarrysMod/garrysmod/lua/weapons folder.
[QUOTE='[LOA] SonofBrim;41052559']Rename your gun.lua to shared.lua, and put it in a folder (you could just name the folder weapon_gun). Then put THAT FOLDER in your steam/steamapps/common/GarrysMod/garrysmod/lua/weapons folder.[/QUOTE] Gotcha, I'll try that. [editline]16th June 2013[/editline] [QUOTE=CalvinTheCat;41052585]Gotcha, I'll try that.[/QUOTE] tried. nothing. Thanks for sticking with me too. I really appreciate it.
[QUOTE=CalvinTheCat;41052585]Gotcha, I'll try that. [editline]16th June 2013[/editline] tried. nothing. Thanks for sticking with me too. I really appreciate it.[/QUOTE] In that case, it's probably something to do with your code, which we'd have to see to really help.
[QUOTE='[LOA] SonofBrim;41053524']In that case, it's probably something to do with your code, which we'd have to see to really help.[/QUOTE] OK, so could I use some sort of pastebin? Or what other ways could I go about doing that?
Sorry, you need to Log In to post a reply to this thread.