Hey guys, I cant find the SWEP I made. I have it located in C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\lua\weapons\weapon_gun. After having somebody look it over I've been told its probably a problem with my coding. So I was wondering if anybody could take a look to see if something's wrong cause I'm completely new to this and have never done this before. [url]http://pastebin.com/Rpwkr93b[/url]
Looks like you forgot to AddCSLuaFile() the gun. Just add it onto the first line.
[QUOTE=Robotboy655;41089225]Looks like you forgot to AddCSLuaFile() the gun. Just add it onto the first line.[/QUOTE]
You mean on the first line, like where it says SWEP.PrintName = "Test Gun" Or to move that down one line and then put AddCSLuaFile()?
Why do you ask question if you can test that yourself? Basically it will work both ways, just don't put in inside any functions.
[QUOTE=Robotboy655;41098881]Why do you ask question if you can test that yourself? Basically it will work both ways, just don't put in inside any functions.[/QUOTE]
I did both ways, however it didnt work, still nothing in my spawnlists.
[quote]
function SWEP:SecondaryAttack()
self:EmitSound( ShootSound )
if ( CLIENT ) [U]the[/U] return end
end
[/quote]
I do believe this is the error
Calvin. If i was you i would find a etc. m16 swep and see how that is made to give you some inspiration. Im sorry that I cant help with your problem because Im not the best lua coder in the world but if I was you i would follow a template or something? :)
Hope you find an answer
[QUOTE=morten7000;41109366]Calvin. If i was you i would find a etc. m16 swep and see how that is made to give you some inspiration. Im sorry that I cant help with your problem because Im not the best lua coder in the world but if I was you i would follow a template or something? :)
Hope you find an answer[/QUOTE]
thanks I'll try that, sorry for not responding, I was on vacation.
[editline]24th June 2013[/editline]
[QUOTE=glitchdetect;41109053]I do believe this is the error[/QUOTE]
It worked :D thanks!
Sorry, you need to Log In to post a reply to this thread.