Hooks on a base?

Is there a way to add a GUIMousePressed hook on a base? If not, is there another alternative?

What base? Gamemode base?

A weapon base… sorry.

While Im at it, I cant figure out why I am having trouble getting a table stored on the Owner of the weapon:



MySelf = self.Owner
 local Items = {}
 table.Add(Items, MySelf.Clips[self.ClipSlot])


It always tells me “Attempt to index Clips (a nil Value).”
Im trying to get the number of entries in Clips subtable which has the structure of:
ply.Clips {}
ply.Clips.[Index of 1 - 8] {}
ply.Clips.(index).[Index of 1 - 4] <— I need to count this!

Im trying to count that index of 1 - 4. It is the number of clips that the player has in his inventory, but I dont really know how to count them with the #. Thats it. Can you help me out with that also?

Yes. Just add it like you’d be adding any other hook.

That means that self.Owner.Clips doesn’t exist. Where are you creating it?