What's new

Question Hud adding headshot blur

Lucent94

Member
Joined
Sep 10, 2022
Messages
7
Reaction score
0
Points
156
Location
Naousa
Hello everyone after a lot of days that i m trying all the different ways to make this script i decided to make a thread here so i can find some help about that,

so this is the way how i type the code if someone know how to type it correctly i will really appreciate his help.



local function IsWhitelistedWeaponStress(weapon)
if weapon then
for _, v in pairs(config.WhitelistedWeaponStress) do
if weapon == v then
return true
end
end
end
return false
end
CreateThread(function() -- Headshot blur
while true do
if LocalPlayer.state.isLoggedIn then
local ped = PlayerPedId()
local weapon = GetSelectedPedWeapon(ped)
if weapon ~= `WEAPON_UNARMED` then
if IsPedheadshotReady(ped) and not IsWhitelistedWeaponStress(weapon) then
if math.random() < config.StressChance then
TriggerServerEvent('hud:server:GainStress', math.random(99, 100))
end
Wait(100)
else
Wait(500)
end
else
Wait(1000)
end
else
Wait(1000)
end
end
end)
 
Top