First Gamemode Question

Hi, I’m making my first game mode and I have run into some problems.

How do I attach something through lua? (like the same way it would be if you go into the model browser and go to file -> load weapon)

I’m not clearly understanding what you are saying… Put it in the addons folder?

I don’t quite understand what you’re doing, do you mean

include( " dir " );

AddCSLuaFile( " dir " );

What are you trying to do? Explain this more.

I believe he’s talking about attaching a model to a bone.

Oh that’d make sense,

Then what is

suppose to mean.

Yeah, im sorry if I did not word it correctly. I meant to ask how you would achive the same thing, through lua, the thing that would happen if you went into the model browser, in source sdk, load a model, then go to file -> load weapon, so It would attach to their hand.

Aww come on! is the problem really that hard? I really need some help please! BUMP

Not hard, but believe it or not the people on this forum also have lives.
This this what you mean? [Player.Give](

Is that what you meant!? Giving the player a weapon!? :effort:

Yea, use Player.Give.

Dear god, if that what he actually meant, than god help this kid when he tries to code full-scale.

No, no, that’s not what I ment. I mean to ask: how do you simulate the action done by the model viewer when you load a weapon.

Here, I’ll tell you what I’m working on. I am trying to make l4d2 SWEPs and I had problems figuring out how the view models work. In model viewer, if you load the weapon view model, the hands are not there. I figured out how to get the hands attached by going to file->load weapon, then choose the hands model. My question is: how would I “load the weapon” (the hands model) on to the gun through Lua?

Okay, so you want your hands to be on the weapon?


You are really bad at explaining stuff.


and why is the thread called Gamemode question, when you’re asking for help with SWeps? :effort:

Sorry, I’m making SWEPs for a gamemode. You’re right, I should have named it differently. In fact, I’ll rename it now.

Yes, the bottom line is that I want the hands on the gun.

My friend told me a way to do it by recompiling, but I don’t want to do that for 2 reasons:

  1. I don’t want the client to download custom models and stuff. It should all be accessed through gm_mount

  2. MDLDecompiler doesn’t work on my computer (tier0.lib is not found).

Nah, Im not going to change the title.

Basically, he wants the separate v_hands mdl file to attach onto the view where the weapon model he’s using is. Like in TF2 with the C_ models which are just the weapon with no hands that gets attached into the first person view and syncs with the animations.

As both me and him just said, yes.

What he wants to do is to attach a prop to the hand bone.

It’s not a prop, it’s another viewmodel which contains the hands. The two viewmodels combine and play the same animation to make it seem like the weapon is in the hand. It’s just some retarded way valve are using for their new games.

I think he is talking about when you click on AK-47 a model of the AK comes up?



oh XD