I don't like to steal people's time and I am quite new here but I was wondering if I could get some help in GLua...I have made a chair gun of some sort that you can load and shoot chairs although I want to make it so that I can right click and have a menu which pops up and gives you a list of props to shoot with, only 4 reloads each.
Please don't refer me to coderhire as I am a stingy fuck.
Any help would be greatly appreciated!
Thanks for your time!
[code]if SERVER then
AddCSLuaFile ("shared.lua")
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
elseif CLIENT then
SWEP.PrintName = "Chair throwing gun"
SWEP.Slot = 4
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
language.Add("Undone_Thrown_SWEP_Entity","Undone Thrown SWEP Entity")
end
SWEP.Author = "MrPlonker"
SWEP.Contact = "plonkeronpc@gmail.com"
SWEP.Purpose = "Throw chairs around!"
SWEP.Instructions = "Right click to bring up a menu of props, left click to fire!"
SWEP.Category = "Category"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/weapons/v_RPG.mdl"
SWEP.WorldModel = "models/weapons/w_rocket_launcher.mdl"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
local ShootSound = Sound("Metal.SawbladeStick")
function SWEP:Reload()
end
function SWEP:Think()
end
function SWEP:throw_attack (model_file)
local tr = self.Owner:GetEyeTrace()
self:EmitSound(ShootSound)
self.BaseClass.ShootEffects(self)
if (!SERVER) then return end
local ent = ents.Create("prop_physics")
ent:SetModel(model_file)
ent:SetPos(self.Owner:EyePos() + (self.Owner:GetAimVector() * 16))
ent:SetAngles(self.Owner:EyeAngles())
ent:Spawn()
local phys = ent:GetPhysicsObject()
if !(phys && IsValid(phys)) then ent:Remove() return end
phys:ApplyForceCenter(self.Owner:GetAimVector():GetNormalized() * math.pow(tr.HitPos:Length(), 3))
cleanup.Add(self.Owner, "props", ent)
undo.Create ("Thrown_SWEP_Entity")
undo.AddEntity (ent)
undo.SetPlayer (self.Owner)
undo.Finish()
end
function SWEP:PrimaryAttack()
self:throw_attack("models/props/cs_office/Chair_office.mdl")
end
function SWEP:SecondaryAttack()
self:throw_attack("models/props_c17/FurnitureChair001a.mdl")
end
[/code]
-snip-
So, you basically want us to make you a thing?
That's not how this place works.
[QUOTE=Robotboy655;43523235]So, you basically want us to make you a thing?
That's not how this place works.[/QUOTE]
Not at all...just a lead in the right direction...
Take a look at these: [url=http://wiki.garrysmod.com/page/VGUI/Elements/DIconLayout]DIconLayout[/url], [url=http://wiki.garrysmod.com/page/VGUI/Elements/SpawnIcon]SpawnIcon[/url], and [url=http://wiki.garrysmod.com/page/VGUI/Elements/DScrollPanel]DScrollPanel[/url], pick the ones you think are most applicable in your situation.
You'd have to make some table to store how many of each you've fired, and change which prop is active when any item is clicked.
I am not pro enough to reply with code. :(
This isn't a Michael McIntyre show. Just a bit of friendly help lol...
You've got more than enough help already. Beyond that we'd be writing it for you.
If you try to use the advice given and are still having problems then show your code and tell us what's wrong with it.
^ is this guy even a pro lua coder?
[highlight](User was banned for this post ("This isn't helpful" - Grea$eMonkey))[/highlight]
[QUOTE=CallMePyro;43572136]^ is this guy even a pro lua coder?[/QUOTE]
You definitely aren't.
[QUOTE=CallMePyro;43572136]^ is this guy even a pro lua coder?[/QUOTE]
Yes he is actually he coded many successful servers including the "hunger games" gamemode on Garrys Mod. Very skilled and I have been apart of his community for about a year now. Still doesn't get boring as he does frequent updates to all servers. Come check us out at [url]www.420servers.com[/url]
Thanks for the help everyone!
id try and help you man but idk im not a pro lua coder
[QUOTE=Johnny Guitar;43574135]id try and help you man but idk im not a pro lua coder[/QUOTE]
Thanks man its cool im trying to work with what i got
[QUOTE=MrPlonker;43574048]Yes he is actually he coded many successful servers including the "hunger games" gamemode on Garrys Mod. Very skilled and I have been apart of his community for about a year now. Still doesn't get boring as he does frequent updates to all servers. Come check us out at [url]www.420servers.com[/url]
Thanks for the help everyone![/QUOTE]
Not 420 servers :suicide: I've read their code; it's all just stolen code mashed together into messy file organizations. All of the functions come straight from the wiki too and there's no defined style. Half of the code uses non-lua operators, semi-colons, and many other things; while the other half doesn't. Just a suggestion, clean up the code and that'll fix up the major lag issues.
[QUOTE=code_gs;43576417]Not 420 servers :suicide: I've read their code; it's all just stolen code mashed together into messy file organizations. All of the functions come straight from the wiki too and there's no defined style. Half of the code uses non-lua operators, semi-colons, and many other things; while the other half doesn't. Just a suggestion, clean up the code and that'll fix up the major lag issues.[/QUOTE]
Also, it's called 420 servers.
[QUOTE=code_gs;43576417]Not 420 servers :suicide: I've read their code; it's all just stolen code mashed together into messy file organizations. All of the functions come straight from the wiki too and there's no defined style. Half of the code uses non-lua operators, semi-colons, and many other things; while the other half doesn't. Just a suggestion, clean up the code and that'll fix up the major lag issues.[/QUOTE]
Please get off the internet. It's a game who gives a fuck? Stop whining.
You give enough of a fuck to give your game server's plug in this thread.
[QUOTE=MrPlonker;43576743]Please get off the internet. It's a game who gives a fuck? Stop whining.[/QUOTE]
Then don't advertise your crappy server then. "Stop whining."
[QUOTE=MrPlonker;43574048]Yes he is actually he coded many successful servers including the "hunger games" gamemode on Garrys Mod. Very skilled and I have been apart of his community for about a year now. Still doesn't get boring as he does frequent updates to all servers. Come check us out at [url]www.420servers.com[/url][/QUOTE]
I was poking fun at your title. Good advice is good advice, regardless of who it comes from. Also please don't try and plug your server to me. This isn't the time nor the place.
[QUOTE=code_gs;43572931]You definitely aren't.[/QUOTE]
Did I say I was? It was poking fun at the OP's title. Damn.
People are mean :,(
And you posted this trying to achieve what? Sympathy? I doubt you'll get that here, after advertising your servers after making requests, but no not just regular request like other users do you wanted THE 'pro lua coder' to do it for you and you even failed to fill in a simple table that matt gave you.
Just leave.
[QUOTE=CallMePyro;43578160]I was poking fun at your title. Good advice is good advice, regardless of who it comes from. Also please don't try and plug your server to me. This isn't the time nor the place.
Did I say I was? It was poking fun at the OP's title. Damn.[/QUOTE]
Hey Callmepyro, I know you're immature and can't handle criticism but you can stop spamming me with dumb ratings.
I always laugh when someone here asks for a "pro lua coder"
I lol'd at the title.
haters g0n hate
I'm not "hatin", I'm just "lol'ing"
Why are people still replying to this thread?
Report his posts and move on...
[QUOTE=code_gs;43581052]Hey Callmepyro, I know you're immature and can't handle criticism but you can stop spamming me with dumb ratings.[/QUOTE]
I apologize. It was late and I was in a bad mood. I removed all the ratings.
When people rate me dumb, I feel self-conscious about myself :(
More dumb pls I kind of like the hate!
[highlight](User was banned for this post ("Asking for ratings / threadshitting own thread" - Craptasket))[/highlight]
Sorry, you need to Log In to post a reply to this thread.