Ever felt the frustration of watching suspects slip away in the blink of an eye? Whether you’re a law enforcement officer or an ordinary citizen, this script gives you the power to bring fleeing suspects to justice with a swift and satisfying tackle.
Around 200, but its more meant as a free reward for spending €10 on any other script from our store.
Still had people interested in only the tackle script despite this, so also gave the option to get just the tackle script. People are free the choose ofcourse
If we add distance control for the server as an extra, we can prevent cheaters from abusing the event.
Client
local tackling = false
-- Function to get the nearest player
function GetClosestPlayer()
local players = GetActivePlayers()
local closestDistance = 2.0
local closestPlayer = nil
local playerPed = PlayerPedId()
local playerCoords = GetEntityCoords(playerPed)
for _, player in ipairs(players) do
local targetPed = GetPlayerPed(player)
if targetPed ~= playerPed then
local targetCoords = GetEntityCoords(targetPed)
local distance = #(playerCoords - targetCoords)
if distance < closestDistance then
closestDistance = distance
closestPlayer = player
end
end
end
return closestPlayer
end
-- Listen for key press (Shift + E)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlPressed(0, 21) and IsControlJustPressed(0, 38) then -- Shift + E
if not tackling then
local targetPlayer = GetClosestPlayer()
if targetPlayer then
tackling = true
TriggerServerEvent("tackle:server", GetPlayerServerId(targetPlayer))
Citizen.Wait(3000) -- Cooldown to prevent spamming
tackling = false
end
end
end
end
end)
-- Apply ragdoll effect (client event)
RegisterNetEvent("tackle:apply")
AddEventHandler("tackle:apply", function()
local playerPed = PlayerPedId()
SetPedToRagdoll(playerPed, 5000, 5000, 0, 0, 0, 0) -- 5 seconds of ragdoll
end)
-- Apply ragdoll to the attacker as well
RegisterNetEvent("tackle:attacker")
AddEventHandler("tackle:attacker", function()
local playerPed = PlayerPedId()
SetPedToRagdoll(playerPed, 1500, 1500, 0, 0, 0, 0) -- 1.5 seconds of ragdoll
end)
Server
RegisterServerEvent("tackle:server")
AddEventHandler("tackle:server", function(targetId)
local attackerId = source
TriggerClientEvent("tackle:apply", targetId) -- Apply ragdoll to the tackled player
TriggerClientEvent("tackle:attacker", attackerId) -- Apply ragdoll to the attacker
end)
Hey, I checked out this tackling script, and from what I see, it just finds the closest player and triggers a ragdoll native. For $10, that seems pretty basic, and I feel like charging for something this simple isn’t really justified. A nice way to give back to your community would be releasing it for free on GitHub or Discord instead. No hate, just my honest feedback—I’ll be putting out a free version soon anyway.
Thanks for the honest message first of all, that is appreciated. The goal of the script is to be a little extra reward for anyone who spends €10+ on our store, in that case the script is granted for a 100% discount.
I agree, this is a simple script, but we offer a lot more interesting scripts on our website. I will try to think of a way in the future to better handle this. Still fairly new to tebex and not sure if there is an options to add free scripts only when a purchase exceeds €10.