About Gun Types
Short Description: Makes your guns create entities/explosions/animals wherever your bullet impacts, or freezes/removes entities/NPCs that you hit with your bullet. Configured via commands.
Allow players to use certain guns to spawn animals, explosions, or entities wherever their bullet lands. Or maybe freezing entities is up your alley! If you've ever wanted to do the mannequin challenge with NPCs/Entities in Rust, now you can! You freeze almost every entity in the game using a specified, configurable gun. Not interested in freezing entities? How about deleting them from existence because they are bothering you, well, lucky for you this plugin has that too! Anywhere you shoot will have any of the above abilities if you activate them!
The plugin automatically unfreezes all entities that were frozen upon unloading the plugin. This is a configurable setting you can disable, however, Cargo will always unfreeze itself the way I have it set up to not cause any issues. Cargo is also currently the only one that freezes itself upon loading the plugin if it was already frozen when unloading it.
You can freeze entities with this plugin in your own plugins via calling the methods:
GunTypes.Call("MethodName", parameter1, parameter2, parameterX); // EX: GunTypes.Call("CargoFreeze", CargoShip, IPlayer, string, bool);
FEATURES:
-
Explosive Gun:
- MLRS
- Rocket
- Incendiary Rocket
- Satchel Charge
- F1 Grenade
- Flash Bang
- Napalm Fire (the fire that Bradley/Attack Heli drops)
- Supply Signal
-
Animal Gun:
- Wolf
- Bear
- Polar Bear
- Boar
- Chicken
- Stag
- Shark
-
NPC Gun:
- Scarecrow NPC
- Bandit Camp Scientist/Guard
- Cargo LR-300 Scientist
- Cargo MP5 Scientist
- Underwater Dweller
- Tunnel Dweller
- CH47 Chinook Scientist (M249) (cannot move)
- Outpost Scientist
-
Entity Gun:
- Scarecrow (entity, the T-Posed object with a hat meant to scare crows)
- Snowman
- Christmas Tree
- Candy Canes
- Present
- Zombie
- Test (Customizable via Config, just put the prefab)
-
Freeze Gun (What it's able to Freeze)
- Cargo
- Attack Heli
- Bradley
- Chinook/CH47
- All Vehicles (Mini Copter, Car (Modular Cars), Sedan, Rhib, Tugboat, Rowboat, Paddle Boat, Subs, Scarp Heli, Trains/Workcarts, Snowmobiles, Ridable Horse)
- Animals
- ALL AI (Scientists, Underwater Dwellers, NPCMissionProviders, Etc.)
- Traps (Landmines, Bear Traps, Gun Traps)
- Auto Turrets/Flame Turrets (Safezone turrets and regular ones)
- Sam Sites (Safezone Sam Sites and regular ones)
- Conveyors
- Doors
- Hackable Crate
- StorageContainers
-
Remove Gun (What its able to Remove)
- Everything that is Interactable.
- Abandoned Military Base (Basically all of the monument can be removed for whatever reason, only things that will remain are the entrances and outlined portion of the monument where the ground is raised)
PLANNED FEATURES:
-
Car Gun (What its able to shoot)
- Rhib
- Attack Helicopter (new one, not patrol heli)
- Chinook
- Sedan
- Minicopter
- Tugboat
- Tomaha
- Solo Sub
- Modular 4 Car
- Modular 2 Car
Video Examples:
Note: The SPAS12 video used 4x the explosive amount per pellet.
More Videos to come!
EXAMPLE OF CAR GUN (NOT IN PLUGIN YET
This is also a slightly older implementation, and has now been slowed down to prevent as much clipping into the ground/through objects.
Permissions:
guntypes.gun - Allows user to use the /gun command.
guntypes.setgun - Allows user to use the /gun set command.
guntypes.animal - Allows user to use the /gun animal command.
guntypes.explosive - Allows user to use the /gun explosive command.
guntypes.entity - Allows user to use the /gun entity command.
guntypes.remove - Allows user to use the /gun remove command.
guntypes.freeze - Allows user to use the /gun freeze command.
guntypes.npc - Allows uers to use the /gun npc command.
Any other permission you see DO NOT USE OR ACTIVE YOURSELF they are for internal plugin use.
You SHOULD NOT attempt to give a user ALL permissions when giving permissions to a user. Give them manually.
Chat Commands:
Note: Turning on any of the gun modes via their direct name (i.e: animal, entity, etc.) will also effectively do `/gun on` for you. /gun off - Disables gun mode in general to prevent use of any of the types below. /gun on - Activates gun mode in general to allow use of any of the types below. /gun animal - Activates animal gun mode. /gun explosive - Activates explosive gun mode. /gun entity - Activates animal gun mode. /gun freeze - Activates animal gun mode. /gun remove - Activates animal gun mode. Use Shortnames to change the gun type, or their defining part of their name. EX: for "pistol_revolver", do "revolver". /gun set animal wolf - Sets your current held gun to the wolf gun. /gun set explosive mlrs m249 - Sets the M249 to the MLRS gun. /gun set freeze - Sets your current held gun to the freeze gun. (only 1 freeze type so no type specification required) /gun set remove pistol_revolver - Sets revolver to the remove gun. (only 1 remove type so no type specification required) /gun spawnfrozen on - Sets NPCs and Animals to spawn frozen. /gun spawn frozen on - Sets NPCs and Animals to spawn frozen. Lots of QoL allowances for freeze AoE commands. /gun set freeze aoe on - Sets freeze AoE (radius) on. /gun freeze aoe on - Sets freeze AoE (radius) on. /gun set freeze aoe 12 - Sets freeze AoE (radius) to 12m. /gun freeze aoe 12 - Sets freeze AoE (radius) to 12m.
Note/Be Aware: A gun that is used multiple times in the same gun type will only allow for 1 of the specified events to occur. EX: using explosive gun and having M249 set to both C4 and MLRS will only allow either C4 or MLRS to happen, not both. You will need to manually set the other M249 value to something other than the M249 value for the type you're not attempting to use. Meaning if you are trying to use C4 and NOT MLRS, then set MLRS to something other than the C4 value.
You can now change your guns without affecting other users guns!
Note 2: You setting the gun for yourself also sets it for ALL other players who are using the plugin. My goal is to eventually change this to individual gun settings for each user, but current implementation does not allow for it yet.
Config:
{ "The command you type in to use the plugin": "gun", "Color/Hex for Syntax in Lang": "#ff3d3d", "Color/Hex for Commands in Syntax in Lang": "orange", "Color/Hex for 'Animal Gun' in Lang when calling the Gun Types commands": "#30D5C8", "Color/Hex for 'Explosive Gun' in Lang when calling the Gun Types commands": "orange", "Color/Hex for 'Entity Gun' in Lang when calling the Gun Types commands": "purple", "Color/Hex for 'Remove Gun' in Lang when calling the Gun Types commands": "#ff3d3d", "Color/Hex for 'Freeze Gun' in Lang when calling the Gun Types commands": "#30D5C8", "Color/Hex for 'NPC Gun' in Lang when calling the Gun Types commands": "#cf1d40", "Color/Hex for 'Activated' in Lang when calling the Gun Types commands": "green", "Color/Hex for 'Deactivated' in Lang when calling the Gun Types commands": "red", "The Color/Hex of the attempted entity/gun in the response for successful/failed gun setting": "orange", "The Color/Hex of the attempted spawn type in the response for successful/failed gun setting": "#40E0D0", "The test entity spawned using the entity gun": "assets/content/structures/interactive_garage_door/sliding_blast_door.prefab", "Unfreeze ALL frozen entities upon unloading (Excluding Cargo, it will automatically unfreeze).": true, "Freeze AoE (radius) Effect Enabled for ALL user with freeze permission (if set to false, no one can use AoE. If enabled, allows AoE Freeze)": true, "Max AoE (radius) a user is allowed to set for AoE freezing": 350, "Spawn tamable animals": true, "Spawn animals already tamed by the user who shot the gun": true }
Credits:
bmgjet - Thanks to bmgjet for allowing me to use code that they had made to get the closest cargo node, and also informing me on a way to freeze cargo!