136
Modding Questions/Help / Re: Hit Effect
« on: July 07, 2021, 09:12:21 AM »Your code as-is doesn't work at all for me.Thank you so much
It just runs once and then stops working.
You want to put it in a loop and remove that "Wait(0)" from the for statement. I've never seen it used there.Code: [Select]while true do
This works fine.
for NPC,Ped in {PedFindInAreaXYZ(0, 0, 0, 99999)} do
if PedIsHit(Ped) and PedIsValid(Ped) then
local hX, hY, hZ = PedGetHeadPos(Ped)
local Effect1 = EffectCreate("GymLightSmash", hX, hY, hZ)
EffectSlowKill(Effect1, 0.7)
end
end
Wait(0)
end