Price
UnknownA script by PandaScriptZ
Price
UnknownPandaScriptZ | Knockout
Hello!
This knockout system gives your players the ability to attack people to make them unconscious. They can use an item that is followed by a synced attack animation that causes the victim to collapse and be unconscious for a specified time.
Features:
Config = {}
Config.item = 'syringe' -- Which item is needed for usage
Config.interactRange = 2 -- What is the maximum distance to knock out a person
Config.knockoutTime = 5 -- How long the player should be knocked out | Time in seconds
Config.AnimsDict = 'melee@small_wpn@streamed_core' -- All anims need to be from the same dict!
Config.Anims = {
{attacker = 'plyr_stealth_kill', victim = 'victim_stealth_kill'},
{...}
}
Config.UseInteractsound = true -- set to true if using interact sound and want to have a sound playing during knockout
Config.Soundfile = 'heartbeatsound' -- The name of your sound file inside Interact-Sound
Config.Cooldown = true -- Should the player get a cooldown on usage
Config.CooldownTime = 1 -- Time until being able to knock out again | Time in minutes
Config.effectAfterKO = true -- Show visual effect after being Knockedout
Config.effectAfterKOTime = 30 -- Time in seconds
Config.KnockoutOnPunch = true -- If you want to enable the option that players are being knocked out when they get punched below a certain health threshold
Config.KnockoutOnPunchHealth = 40 -- The health threshold that players get knocked out when they get punched below this threshold (Value between 0 and 100 (0 NOT RECOMMENDED, may cause problems with ambulance job))
Config.KnockoutWeapons = {'WEAPON_UNARMED', 'WEAPON_KNUCKLE', 'WEAPON_NIGHTSTICK'} -- You can add any weapon hash here that should be able to knock out players.
Config.Messages = {
['no_player'] = 'There is no person near you',
['used_item'] = 'You used your syringe to knock out a person',
['got_ko'] = 'You have been knocked out by another person',
['recovered'] = 'You recovered from your knockout',
-- If cooldown enabled --
['on_cooldown'] = 'You need to wait until you can knock out again',
}
-- change the below functions to your notification system
-- Current example using standard ESX
function ShowInfoNotification(message)
ESX.ShowNotification("~y~"..message)
end
function ShowErrorNotification(message)
ESX.ShowNotification("~r~"..message)
end
function ShowSuccessNotification(message)
ESX.ShowNotification("~g~"..message)
end```
Preview
Packages
Plans for future updates:
|-------------------------------------|----------------------------|
| Code is accessible | Yes (if opensource version)
| Subscription-based | No
| Lines (approximately) | ~ 230 Lines
| Requirements | ESX, interact-sound (optional)
| Support | No, unmaintained
See what others are saying about this script.
Share your experience and help others.