Difference between revisions of "OnClientPedStep"

From Multi Theft Auto: Wiki
(works fine with peds)
(Example)
Line 18: Line 18:
  
 
==Example==
 
==Example==
 
+
<section name="Client" class="client" show="true">
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
addEventHandler("onClientPedStep", localPlayer,
 
addEventHandler("onClientPedStep", localPlayer,
Line 30: Line 30:
 
)
 
)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
</section>
  
 
==See Also==
 
==See Also==

Revision as of 20:50, 5 April 2020

This event is called when a peds foot has come on to the ground after jumping or taking a full step.

[[{{{image}}}|link=]] Note: This event is only triggered for peds that are streamed in

Parameters

 bool leftFoot
  • leftFoot: a bool representing if it was the left foot that moved.

Source

The source of this event is the ped who stepped.

Requirements

Minimum supported server n/a
Minimum supported client 1.5.6.14735

Note: Using this function requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.6.14735" />

Example

Click to collapse [-]
Client
addEventHandler("onClientPedStep", localPlayer,
     function(leftFoot)
          if (leftFoot) then
               outputChatBox("Your left foot hit the ground.", 0, 255, 0)
          else
               outputChatBox("Your right foot hit the ground.", 0, 255, 0)
          end
     end
)

See Also

Client ped events


Client event functions