Garry's Mod

Garry's Mod

Not enough ratings
Chen's Metal Detector
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
File Size
Posted
Updated
8.799 KB
15 Jul, 2021 @ 1:40pm
22 Jul, 2021 @ 5:31pm
4 Change Notes ( view )

Subscribe to download
Chen's Metal Detector

In 1 collection by Cennisen
Cennisen's Development Colleciton
6 items
Description
This is a metal detector that will detect weapons on a player and print it to the screen on the side. It's intended for RP servers where they want to screen people for certain areas. It's very basic but there are some things to take note of.

If you are a server owner and want to use this please take note.

To set this up is a config.lua file in the autorun folder of the addon, I have preset most of the DarkRP and items you receive on spawn and hopefully it will be self explanatory on how you can add more to it. THE LIST IN THE CONFIG IS A WHITELIST meaning that if a weapon's class name is in the list then the metal detector will ignore it.

If you are on DarkRP and have not set up physgunnable entities from the F4 Menu, normal players will not be able to physgun this entity. If you want it to be physgunnable you will need to add a hook. I probably could have done it for the metal detector but the person who I have made this for didn't need it.

hook.Add("playerBoughtCustomEntity","EntOwnerCanPhysgun",function(ply, tblEnt, ent, price)
ent:CPPISetOwner(ply)
end)

If you want it so that its only for the Metal Detector you can just use an if statement.

Also if you find anything bad with the code (which there probably will be.) feel free to leave criticism and suggestion in the comments.
2 Comments
Piesuu 27 Aug, 2021 @ 5:31pm 
From what i see so far it also works on sandbox
[DG] aviias #BASSPROSHOP 16 Jul, 2021 @ 3:56pm 
Bateman?