<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/GetPedHitBone?action=history&amp;feed=atom</id>
	<title>GetPedHitBone - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/GetPedHitBone?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedHitBone&amp;action=history"/>
	<updated>2026-05-15T09:48:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedHitBone&amp;diff=74526&amp;oldid=prev</id>
		<title>GalAnonim at 23:30, 7 May 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedHitBone&amp;diff=74526&amp;oldid=prev"/>
		<updated>2022-05-07T23:30:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:30, 7 May 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l66&quot;&gt;Line 66:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 66:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/section&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/section&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;'''Author:''' Rick&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-74521:rev-74526 --&gt;
&lt;/table&gt;</summary>
		<author><name>GalAnonim</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedHitBone&amp;diff=74521&amp;oldid=prev</id>
		<title>GalAnonim at 22:58, 7 May 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedHitBone&amp;diff=74521&amp;oldid=prev"/>
		<updated>2022-05-07T22:58:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:58, 7 May 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    assert(tonumber(hitY), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 3, got &amp;quot; .. tostring(hitY) .. &amp;quot;]&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    assert(tonumber(hitY), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 3, got &amp;quot; .. tostring(hitY) .. &amp;quot;]&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    assert(tonumber(hitZ), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 4, got &amp;quot; .. tostring(hitZ) .. &amp;quot;]&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    assert(tonumber(hitZ), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 4, got &amp;quot; .. tostring(hitZ) .. &amp;quot;]&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    local nowDistance&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    local nowDistance&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, hitBone&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    local boneIDs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 51, 52, 53, 54}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    local boneIDs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 51, 52, 53, 54}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    for _,bone in pairs(boneIDs) do&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    for _,bone in pairs(boneIDs) do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l45&quot;&gt;Line 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    assert(tonumber(hitY), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 3, got &amp;quot; .. tostring(hitY) .. &amp;quot;]&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    assert(tonumber(hitY), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 3, got &amp;quot; .. tostring(hitY) .. &amp;quot;]&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    assert(tonumber(hitZ), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 4, got &amp;quot; .. tostring(hitZ) .. &amp;quot;]&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    assert(tonumber(hitZ), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 4, got &amp;quot; .. tostring(hitZ) .. &amp;quot;]&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    local nowDistance&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    local nowDistance&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, hitBone&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    local boneIDs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 51, 52, 53, 54}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    local boneIDs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 51, 52, 53, 54}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    for _,bone in pairs(boneIDs) do&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    for _,bone in pairs(boneIDs) do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-74520:rev-74521 --&gt;
&lt;/table&gt;</summary>
		<author><name>GalAnonim</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedHitBone&amp;diff=74520&amp;oldid=prev</id>
		<title>GalAnonim: Created page with &quot;{{Useful Function}} &lt;lowercasetitle&gt;&lt;/lowercasetitle&gt; __NOTOC__ This function gets the approximate number of the bone where the ped is hit ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; int getPedHitBone( ped thePed, float hitX, float hitY, float hitZ ) &lt;/syntaxhighlight&gt; ===Required Arguments===  * '''thePed:''' the ped whose bone you want to get. *'''hitX''', '''hitY''', '''hitZ''': float world coordinates representing a hit point. ===Returns=== An '''int''' with the...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedHitBone&amp;diff=74520&amp;oldid=prev"/>
		<updated>2022-05-07T22:49:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function gets the approximate number of the bone where the ped is hit ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int getPedHitBone( ped thePed, float hitX, float hitY, float hitZ ) &amp;lt;/syntaxhighlight&amp;gt; ===Required Arguments===  * &amp;#039;&amp;#039;&amp;#039;thePed:&amp;#039;&amp;#039;&amp;#039; the &lt;a href=&quot;/wiki/Ped&quot; class=&quot;mw-redirect&quot; title=&quot;Ped&quot;&gt;ped&lt;/a&gt; whose bone you want to get. *&amp;#039;&amp;#039;&amp;#039;hitX&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;hitY&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;hitZ&amp;#039;&amp;#039;&amp;#039;: &lt;a href=&quot;/wiki/Float&quot; title=&quot;Float&quot;&gt;float&lt;/a&gt; world coordinates representing a hit point. ===Returns=== An &amp;#039;&amp;#039;&amp;#039;int&amp;#039;&amp;#039;&amp;#039; with the...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets the approximate number of the bone where the ped is hit&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getPedHitBone( ped thePed, float hitX, float hitY, float hitZ )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''thePed:''' the [[ped]] whose bone you want to get.&lt;br /&gt;
*'''hitX''', '''hitY''', '''hitZ''': [[float]] world coordinates representing a hit point.&lt;br /&gt;
===Returns===&lt;br /&gt;
An '''int''' with the approximate bone where the [[ped]] take damage, does not work properly serverside&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPedHitBone(thePed, hitX, hitY, hitZ)&lt;br /&gt;
   assert(isElement(thePed) and (getElementType(thePed) == &amp;quot;ped&amp;quot; or getElementType(thePed) == &amp;quot;player&amp;quot;), &amp;quot;Bad argument @ 'getPedHitBone' [Expected ped/player at argument 1, got &amp;quot; .. tostring(thePed) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
   assert(tonumber(hitX), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 2, got &amp;quot; .. tostring(hitX) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
   assert(tonumber(hitY), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 3, got &amp;quot; .. tostring(hitY) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
   assert(tonumber(hitZ), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 4, got &amp;quot; .. tostring(hitZ) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
   local nowDistance&lt;br /&gt;
   local boneIDs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 51, 52, 53, 54}&lt;br /&gt;
   for _,bone in pairs(boneIDs) do&lt;br /&gt;
      local boneX, boneY, boneZ = getPedBonePosition(thePed, bone)&lt;br /&gt;
      local distance = getDistanceBetweenPoints3D(hitX, hitY, hitZ, boneX, boneY, boneZ)&lt;br /&gt;
      if nowDistance and (distance &amp;lt; nowDistance) then&lt;br /&gt;
         nowDistance, hitBone = distance, bone&lt;br /&gt;
      elseif not nowDistance then&lt;br /&gt;
         nowDistance, hitBone = distance, bone&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   return hitBone&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPedHitBone(thePed, hitX, hitY, hitZ)&lt;br /&gt;
   assert(isElement(thePed) and (getElementType(thePed) == &amp;quot;ped&amp;quot; or getElementType(thePed) == &amp;quot;player&amp;quot;), &amp;quot;Bad argument @ 'getPedHitBone' [Expected ped/player at argument 1, got &amp;quot; .. tostring(thePed) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
   assert(tonumber(hitX), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 2, got &amp;quot; .. tostring(hitX) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
   assert(tonumber(hitY), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 3, got &amp;quot; .. tostring(hitY) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
   assert(tonumber(hitZ), &amp;quot;Bad argument @ 'getPedHitBone' [Expected vector3 at argument 4, got &amp;quot; .. tostring(hitZ) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
   local nowDistance&lt;br /&gt;
   local boneIDs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 51, 52, 53, 54}&lt;br /&gt;
   for _,bone in pairs(boneIDs) do&lt;br /&gt;
      local boneX, boneY, boneZ = getPedBonePosition(thePed, bone)&lt;br /&gt;
      local distance = getDistanceBetweenPoints3D(hitX, hitY, hitZ, boneX, boneY, boneZ)&lt;br /&gt;
      if nowDistance and (distance &amp;lt; nowDistance) then&lt;br /&gt;
         nowDistance, hitBone = distance, bone&lt;br /&gt;
      elseif not nowDistance then&lt;br /&gt;
         nowDistance, hitBone = distance, bone&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   return hitBone&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientPlayerWeaponFire&amp;quot;, root, function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement, startX, startY, startZ)&lt;br /&gt;
   if isElement(hitElement) then&lt;br /&gt;
      outputChatBox(&amp;quot;You hit bone &amp;quot;..getPedHitBone(hitElement, hitX, hitY, hitZ) )&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>GalAnonim</name></author>
	</entry>
</feed>