Snakegold Posted November 6, 2023 Share Posted November 6, 2023 شباب بدي لما اضرب هيدشوت بالأسلحة الموجودة في الجدول اللاعب يموت على الفور و ينقطع رأسه و بقية الأسلحة تزيل 80 dmg في الهيدشوت هذا كودي وين المشكلة ؟ local removeHeadOnHeadshot = true local function onPlayerDamage(attacker, weapon, bodypart, loss) local allowedWeapons = { [24] = true, [25] = true, [33] = true, [34] = true } if bodypart == 9 then if isElement(source) and getElementType(source) == "ped" then if allowedWeapons[weapon] then setElementHealth(source, 0) if removeHeadOnHeadshot then setPedHeadless(source, true) end else loss = 80 setElementHealth(source, getElementHealth(source) - loss) end end end end addEventHandler("onPlayerDamage", root, onPlayerDamage) Link to comment
Scripting Moderators xLive Posted November 7, 2023 Scripting Moderators Share Posted November 7, 2023 setPedHeadless راح يزيل رأس الاعب فقط killPed عشان تقتل الاعب تستخدم 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now