Lifting things and deriving tables

So, two questions, I’d really appreciate help on both.

I am looking for something that acts very similarly to how the hands in HL2 would work where pressing E on a light prop would allow you to carry it around. I have heard that this has been reproduced but I’ve spent quite some time searching for this but did not find anything suitable.

I’m also trying to reproduce the way for example SWEPs or gamemodes can inherit another and then have anything overwritten and added if necessary. What I mean is that TABLE.Base will reference another table and inherit all values from there but the child will overwrite those. If the parent has TABLE.Base defined it would derive that as well and all the way up the line to the very base.

All contribution very much appreciated. Thanks.

**[Table.Inherit

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Table.Inherit)**?

That sounds quite good actually, thanks.

The other mod you’re looking for is called “Drag shit with E”

Ahh, I tried that but apparently “a lot of people have managed to do this” so I was hoping there was some better examples.

or alternatively, table.__index

Yea, I was writing a post about metatables, but I had to go to a lecture. So I just posted that.



=== Registering item: base_weapon
== Inheriting base_item
=== Registering item: melon
== Inheriting base_food
== Inheriting base_item
=== Registering item: base_container
== Inheriting base_item
=== Registering item: melon_extreme
== Inheriting melon
== Inheriting base_food
== Inheriting base_item
=== Registering item: base_food
== Inheriting base_item
=== Registering item: base_item
=== Registering item: orange
== Inheriting base_food
== Inheriting base_item
=== Registering item: base_drink
== Inheriting base_item


:smiley:

Kind of dissapointed that “a lot of people have managed to do this” does not seem to be true. If anyone can find me a SWEP or just plain lua that allows you to lift entities HL2 style, please post.

I made one once.

http://blackopsservers.com/blackops/files/hl2pickup.rar

A year later I need the same thing. I never found anything appropriate. Basically I’m looking for a grav gun without the model, the attraction or the punts. Right click, lift, drag it around like grav gun would, right click drop.