This script makes it possible to put a slap to another player with a beautiful violent animation and with a slap sound. Small bonus with an animation that allows whistle another player with the sound of whistling.
Keys of use :
Slap : ALT + G
Whistling : ALT + A
Updates
V1.0.1 : Addition of the sync with other players to play the animation to collapse on the ground during the slap and they have the sound of the slap also. I also add a very short translation system in English / Spanish / French in the client file for the notification system
Change numbers at lines - 13 and 19:
if IsControlPressed(1, 19) and IsControlJustPressed(1, 74) then – alt + H
if IsControlPressed(1, 19) and IsControlJustPressed(1, 47) then – alt + G
On keyboard: 19 = ALT , 74 = H , 47 = G
Down below you can find numbers for others keyboard keys
Can you add slap delay for like 10sec? Because now you can spam ALT+G all the time and even if you on ground you can slap spam other guy who slapped you.
I add “Citizen.Wait(10000)” now when I press ALT+G, it’s slaps other guy only after 10 sec, not instantly. How to fix it that I slap other guy instantly and then I have to wait 10 sec?
CreateThread(function()
while true do
Wait(0)
if IsControlPressed(1, 19) and IsControlJustPressed(1, 47) then -- alt + G
TriggerEvent("RebornProject:Notification", Notif1)
local CitoyenCible, distance = getNearPlayer()
if (distance ~= -1 and distance < 2.0001) then
if IsPedArmed(GetPlayerPed(-1), 7) then
SetCurrentPedWeapon(GetPlayerPed(-1), GetHashKey('WEAPON_UNARMED'), true)
end
if (DoesEntityExist(GetPlayerPed(-1)) and not IsEntityDead(GetPlayerPed(-1))) then
ChargementAnimation("melee@unarmed@streamed_variations")
Citizen.Wait(10000)
TaskPlayAnim(GetPlayerPed(-1), "melee@unarmed@streamed_variations", "plyr_takedown_front_slap", 8.0, 1.0, 1500, 1, 0, 0, 0, 0)
TriggerServerEvent("RebornProject:SyncGiffle", GetPlayerServerId(CitoyenCible))
end
else
--TriggerEvent("RebornProject:Notification", Notif1)
end
end
end