[Release] Metal Detectors

Metal Detectors -
Metal Detectors is a script that gives you the ability to add metal detectors around the map either with or without an entity. You can give access to certain players so they can walk through a metal detector without it going off. There is plenty of customization options for this script to work just right for you.

Download - (Version 0.2)

Other -
It comes with some metal detectors already added, I use the scanners at the FIB Headquarters and I added one to the Lifeinvader lobby as an example. Please let me know of any issues. I will be updating this as time goes on. Feel free to edit the script but do not re-upload it.

Pictures


12 Likes

Great idea and script. It would be great if you add a framework version like ESX to detect inventory items alongside weapons!

Why does everything have to be connected to ESX? Would be awesome to have an fully standalone script.

5 Likes

So does this automatically go off if a player has a weapon in their weapon wheel inventory or if not, then how does it trigger?

So in the ‘config.lua’ you can choose the radius that the metal detector will start to scan. Once you walk in the radius it checks if you have any weapons that are in a list, if you do it will trigger an event to play a alarm near the metal detector everyone can hear. In this list I included all the weapons that would have metal in them realistically. For example if you were to walk through them metal detector with a broken glass bottle it wouldn’t go off.

I don’t see weapons in config? Or is it not defined in the config?

Also maby a update for ace perms, I know many servers use DiscordAcePerms, As i don’t wan’t to add 200 cops 1 by 1.

I agree with Nigel.D’s idea of ace perms (though I’d rather see a command like /mdexempt (secured with an ace perm) that would toggle them being able to pass through or not (maybe have a message show up when they enter that states they are exempt when they are in range of a detector). I say a command to toggle because if you “ace” them in, or even just manually add them, and they are off duty as a diff character who is a criminal, exempting them from detection would allow them to stroll right on in weapons and all since they are cleared.

1 Like

The weapons are not defined in the config.lua. If you would like to edit them you can look in main/src/client/functions.lua, look for a function called HasWeapon. Keep in mind I only put the weapons that would have metal realistically. I may update this table into the config.lua at some point. I will also look into adding the functionality to work in ace perms.

1 Like

Don’t know if its just me but the script load no errors at all but no detector shows up at all and if got it enabled.

		{--Adds Metal Detector at FIB Headquarters (Without Entity).
			info = { id = 1, sound = { range = 5 } },
			coords = { x = 1828.99, y = 3657.94, z = 32.99, radius = 0.5 },
			entity = { enable = true, heading = 115.45 }
		},

https://gyazo.com/5d003f000e9f5f7c56cd9a210551350d

I have just tested and updated it this morning, it did spawn the detector and set off the alarm when I went through. I recommend double-checking your coordinates. Make sure you have the most recent download and make sure your server artifacts are updated.

Whats the artifacts u use?

Latest Recommended (3184).

Can you do another test to verify? Just installed 3184 and still won’t load in for me, Also installed a fresh copy and didn’t do anything but rename it.

Just looked around and all lua’s in the server folder are empty but the events.lua, Is this correct?

Also like this on the github

:grinning_face_with_smiling_eyes: Pretty sure it’s already been done for esx KEKW - Reference

You are correct. They are there for if/when I add more functionality.

Yeah well for some reason its not working for me on a fresh drag and drop and also latest artifacts, Anything else that might be required?

Currently that script is no longer functional. does not have a server side. and it only has a client-sided only police detector

1 Like

Make sure you restart the server to see the changes to the config. Restarting the script may not work reason being I am having to stream the prop because it is from the Casino DLC. I have added something to the CreateDetector function. Please update.