Bear Trap System with Baits

About

An interactive trap that can be placed anywhere and anyone can be caught in it, from regular NPCs to your friend or enemy on the server, and even animals.

SHOWCASE (YOUTUBE)

image

Features:

  • Compatible with frameworks: QBR, QR, RSG, REDEM, REDEM_OLD and VORP.

  • Works with humans, animals, and wagon horses.

  • Easily deactivate traps from a distance with just a shot.

  • Syncs seamlessly with all players.

  • Bait system for different type of animals (Predators, Insects, Vegetation, etc.)

  • Over 55 restricted zones and you can add your own zones as well.

  • Localization support (included English and 2 other languages).

We are selling the script HERE ON TEBEX

Inventory Icons

Script includes inventory icons designed to match your framework’s style.

image

image

Tags

Beartrap, bear trap, hunter

UPDATE 1.1:

  • You can set bait from inventory (such as bread f.e.) to attract animals into trap.
  • Added target scripts support (rsg-target, qr-target, qbr-target, meta_target, kad-darem mouse selection).
  • Clicker Minigame to release from trap on your own.
  • Discord Logs.
  • Script Events to integrate scripts into your bigger systems (for devs).
A B
Code is accessible There are 2 versions (encrypted and source available)
Subscription-based No
Lines (approximately) 2000
Requirements No
Support Yes
1 Like

How to integrate the script into your custom framework

There are several triggers and event handlers.

Server Triggers

Use next code to start placing a beartrap:

TriggerEvent('beartrap:place', playerId, function(success)
    if success then
        print('beartrap placed')
    end
end)

Server Events

Use next code to determine what will happen after player has taken a beartrap:

AddEventHandler('beartrap:onTrapTaken', function(playerId)
    print('beartrap taken by ', playerId)
end)
1 Like

Bug fixes:

  • Fixed: When you free someone, you no longer get trapped.
  • Fixed: NPCs will now trigger the trap animation correctly when they run into it.
  • Fixed: When playing as an animal, there was a human animation inside the trap.

Features:

  • Added trap placing/taking logs:
Details

image

You also can disable selected identifiers from display:

If you disable all identifiers it will look like this:
image

If you disable some of them (ip, license2, fivem):
image

1 Like

Bug fixes:

  • Fixed: Trap immediate catching player when Config.PlaceTrapOpened = true.
  • Fixed: Bug when player dies in trap (double death).
  • Fixed: Trap position (trap slightly flying above the ground after player has been release from trap).
  • Fixed: Trap invisibility after player has respawned while being in trap.
  • Optimized: Script CPU usage from 0.79 to 0.04 in idle state.

Features:

  • Added clicker minigame (to release yourself) and death timer.


image

1 Like

Features:

  • Added a new configuration function, Config.WhileTrapped , which can be used to block buttons while the player is inside a trap.

  • Added client-side event beartrap:onTrapped , which can be used to handle situations when the local player has just been trapped or untrapped. Example:

AddEventHandler('beartrap:onTrapped', function(inTrap)
    print('Trapped', inTrap)
end)
1 Like

Update

2 Likes

Since the launch of sales of Bear Trap (2023-09-27T22:00:00Z) our product has been acquired by 21 individuals, and each one has expressed their utmost satisfaction with the remarkable results they’ve attained.

:rocket:Our product stands out with rock-solid stability and performance. :star2::ok_hand::blush:

1 Like

Update

  1. Feature: Added “target” scripts support (rsg-target, qr-target, qbr-target, meta_target):

config.lua:

rsg-target:

qr-target:

qbr-target:

meta_target:

  1. Fix: When you cancel animation/task via some external script - bear trap animation will be played again.
1 Like

How to Add Kad Darem Select Entity

image

  1. Download latest version of beartrap from keymasters
  2. Update beartrap/config.lua:
Config.EnableInteractionTargetScript = true
Config.TargetScriptName = 'mouse-selection' -- rsg-target, qr-target, qbr-target, meta_target
  1. Update beartrap/client/target.lua by replacing old content with next one:
if Config.EnableInteractionTargetScript then
    if Config.TargetScriptName == 'mouse-selection' then
        local CMenu = {}
        TriggerEvent('CMenu:Get', function (_menu)
            CMenu = _menu
        end)
        AddEventHandler('mouse-selection:ClickEntity', function(_entityHover)
            local model = GetEntityModel(_entityHover)
            if model ~= VARIABLES.BEAR_TRAP_MODEL then
                return    
            end
            if not CanOpenTrap(_entityHover) then
                return
            end
        
            CMenu.AddItem({
                title = _('open_the_trap'),
                id = 'openTrap',
                callback = 'beartrap:kaddarem-mouse-selection:openTrap'
            })
            CMenu.AddItem({
                title = _('take_the_trap'),
                id = 'takeTrap',
                callback = 'beartrap:kaddarem-mouse-selection:takeTrap'
            })
        end)
        AddEventHandler('beartrap:kaddarem-mouse-selection:openTrap', function(_entityHover)
            openTrap(_entityHover)
        end)
        AddEventHandler('beartrap:kaddarem-mouse-selection:takeTrap', function(_entityHover)
            takeTrap(_entityHover)
        end)

    else
        -- meta_target compatibility
        if Config.TargetScriptName == 'meta_target' then
            Config.TargetScriptName = 'qb-target'
        end
        exports[Config.TargetScriptName]:AddTargetModel({VARIABLES.BEAR_TRAP_MODEL}, {
            options = {
                {
                    icon = 'fas fa-scrubber',
                    label = _('open_the_trap'),
                    canInteract = function(entity)
                        return CanOpenTrap(entity)
                    end,
                    action = function(entity)
                        openTrap(entity)
                    end,
                },
                {
                    icon = 'fas fa-backpack',
                    label = _('take_the_trap'),
                    canInteract = function(entity)
                        return CanOpenTrap(entity)
                    end, 
                    action = function(entity)
                        takeTrap(entity)
                    end,
                }
            },
            distance = 2.5,
        })
    end
end
2 Likes

Update

  • You asked for it, and we’ve added it - a new Bait Mechanic. You can now place bait on a bear trap to attract animals. You have the option to configure the bait, specifying the item to be used, its effective range, and the specific animals it will attract:

1 Like

You can test the beartrap on next RedM server:

image

https://servers.redm.gg/servers/detail/d93dby

1 Like

Update

  • You can configure multiple items for bait.

image

  • Bait system can be disabled if needed.

image

Fixes

  • Fixed: Prompts disappearing.
  • Fixed: Desynced beartrap animation.
1 Like

:heart: Hot Fix (14.02.2024) :heart:

  • Fixed: Missing prompts

image

1 Like

Script is highly recommended, excellent job!

4 Likes

Thank you!

Based on suggestions in our community, we’ve updated the Beartrap:

1. Slow HP Decrease: Watch Beartrap - Slow HP decrease | Streamable

You can enable this option to make trapped players slowly decrease their health. You can enable/disable this feature and configure how much damage player receives per second.

Added new variables into config.lua:

Config.EnableDeathTimout = true -- Player Death timeout enabled/disabled
Config.DeathTimeout = 30000 -- 30000 ms player will be killed after this amount of time

Config.EnableHealthDecrease = false -- Player Slow HP decrease enabled/disabled
Config.HealthDecrease = 3 -- how much player hp decreased every second

2. Bait selection (via default in-game Prompts): Watch Beartrap - Bait selection (Prompts) | Streamable (via target menu): Watch Beartrap - Bait Selection (Target Menu) | Streamable

Now you can choose which bait should be placed. Depends on placed bait it will attract different type of animals. For example, meat attracts only predators. You can define your own categories of baits and set any items you like (but we already made some presset for you, just in case):

Config.BaitItems = { -- item name = category
    ['apple'] = 'Vegetation',
    ['bread'] = 'Insects', 
    ['meat'] = 'Meat',
} -- Items which are used for placing bait
Config.BaitCategories = {
    Meat = {`AT_BEAR_BLACK`, `AT_FOX_SILVER`, `AT_WOLF_TIMBER`},
    Vegetation = {`AT_BUCK`, `AT_DEER`, `AT_OX`},
    Insects = {`AT_EGRET`, `AT_RABBIT`},
}

Update is available on https://keymaster.fivem.net/asset-grants