<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.rage.mp/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MCtheBoss</id>
	<title>RAGE Multiplayer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.rage.mp/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MCtheBoss"/>
	<link rel="alternate" type="text/html" href="https://wiki.rage.mp/wiki/Special:Contributions/MCtheBoss"/>
	<updated>2026-06-04T11:43:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Peds::new&amp;diff=17677</id>
		<title>Peds::new</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Peds::new&amp;diff=17677"/>
		<updated>2019-05-30T07:41:56Z</updated>

		<summary type="html">&lt;p&gt;MCtheBoss: Updated the page to represent the change in syntax, as well as provide the function for legacy syntax support.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;mp.peds.new(model, position, heading, dimension);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Required Arguments ===&lt;br /&gt;
*&#039;&#039;&#039;modelHash:&#039;&#039;&#039; Model hash&lt;br /&gt;
*&#039;&#039;&#039;position:&#039;&#039;&#039; Vector3 position&lt;br /&gt;
*&#039;&#039;&#039;heading:&#039;&#039;&#039; float&lt;br /&gt;
*&#039;&#039;&#039;dimension:&#039;&#039;&#039; int&lt;br /&gt;
===Return value===&lt;br /&gt;
*&#039;&#039;&#039;Ped handle or object&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function relies on the &#039;entityStreamIn&#039; event to handle the Ped&#039;s streamInEvent. If you do not have this event in your script, you can find it below.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
{{ClientSide}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
let Ped = mp.peds.new(mp.game.joaat(&#039;MP_F_Freemode_01&#039;), new mp.Vector3( 100.0, -100.0, 25.0), 270.0, mp.players.local.dimension);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== ==&lt;br /&gt;
&lt;br /&gt;
==Legacy Syntax Variation==&lt;br /&gt;
&lt;br /&gt;
If you would like to use the legacy syntax for mp.peds.new(), refer to the following function:&lt;br /&gt;
{{ClientSide}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mp.peds.newLegacy = (hash, position, heading, streamIn, dimension) =&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    let ped = mp.peds.new(hash, position, heading, dimension);&lt;br /&gt;
    ped.streamInHandler = streamIn;&lt;br /&gt;
    return ped;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above function to work, you must add the following &#039;entityStreamIn&#039; event to your script:&lt;br /&gt;
{{ClientSide}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mp.events.add(&amp;quot;entityStreamIn&amp;quot;, (entity) =&amp;gt;    &lt;br /&gt;
{&lt;br /&gt;
   if(entity.streamInHandler)&lt;br /&gt;
   {&lt;br /&gt;
       entity.streamInHandler(entity);&lt;br /&gt;
   }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
{{ClientSide}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
let Ped = mp.peds.newLegacy(mp.game.joaat(model), location, 0, (streamPed) =&amp;gt; {&lt;br /&gt;
        // Ped Streamed&lt;br /&gt;
    streamPed.setAlpha(255);&lt;br /&gt;
    streamPed.freezePosition(false);&lt;br /&gt;
    streamPed.setInvincible(false);&lt;br /&gt;
    streamPed.setProofs(false, false, false, false, false, false, false, false); &lt;br /&gt;
}, 0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Ped_functions_c}}&lt;br /&gt;
[[Category:Clientside API]]&lt;/div&gt;</summary>
		<author><name>MCtheBoss</name></author>
	</entry>
</feed>