Starcraft Ghost Rifle Scripting help

i want to make a swep based off of the starcraft ghost. i have, sorry to say, basically no lua experience but would like to learn. i want to make the swep with toggle options between sniper rounds and the laser pointer that drops a missile using e + mouse 1. mouse 2 as a one time zoom. i want to make the sound “someone call for an exterminator” play when you pick up or equip the weapon, and the “never know what hit them” play when the missile starts falling. this to me sounds demanding, but i think it would be a good addition to the gmod community. so if anyone can help me make this i would be very grateful :smiley:

you can contact me at, or by adding me to steam- just send me your steam id in email, along with if you can help and i will add. thank you again!

Hmmm…well for the sound it would be:

[lua]function SWEP:Deploy()



That’s a basic thing, I don’t know the command EXACTLY, but that’s what it would do because Deploy is called when you equip the weapon, if you have SWEP.SwitchTo = true, then it would deploy it as soon as you pick it up. As for the laser, that’s simply draweyetrace, the one time zoom is an FOV editing through ironsights. And for mode switching, look at CSS Realistic because that has a glock 18 that switches between single and burst. Sorry I can’t help you more than this but I’m only learning :p, I’m getting better though.

If you need the exterminator sound, or any other ghost sound pm me, I have them all ready to go ;D

ok, this is all very good, thank you for the help, but lol i have an understanding of lua that sums to about 1%… i dont know where to begin…

ok thank you, can you help me structure the lua scripting from what you know? i honestly dont even know where to begin… or how… :stuck_out_tongue:

Edit: i just looked at some examples from the hl weapons. but i still may need some help with explanations on some things

Just ask which function and I’ll help to the best of my ability :p.


Use [lua] tags and we’ll help you.


Add [lua] and [noparse][/lua][/noparse] around the code when posting here on facepunch.


Bumpiddy bump bump in the night. lol bump ^^^^^^^^^


Idk if that script is any good ^^^^ i just took bits and peices from different script bases i found. i need some feed back on what i should do :frowning: i made another post about this project and in it i explained how i need to hex some custom textured gloves to this swep as well as eventually a custom weapon model im working on but, you guessed it, i have no idea how to get the gloves and model to all fit together in a nice little addon folder… so lol, further help would be appreciated… This is my first swep and im learning this way so plz understand. :stuck_out_tongue:

It’s called a C-10 Canister Rifle.

ok thank you…

yeah ive gotten a bit side tracked from this project…