OnPlayWeaponHitEffects: Difference between revisions

From Onset Developer Wiki
Chloe (talk | contribs)
mNo edit summary
REDRUM (talk | contribs)
 
Line 18: Line 18:
== Example ==
== Example ==
<syntaxhighlight lang="Lua">
<syntaxhighlight lang="Lua">
AddEvent("OnPlayWeaponHitEffects", funtion (PlayerId, Weapon, HitType, HitId, StartLocation, HitLocation, HitLocationRelative, HitNormal, HitResult)
AddEvent("OnPlayWeaponHitEffects", function (PlayerId, Weapon, HitType, HitId, StartLocation, HitLocation, HitLocationRelative, HitNormal, HitResult)


end)
end)

Latest revision as of 16:43, 24 January 2020

OnPlayWeaponHitEffects

Type: Event
Context: Client
Introduced: v1.0

Description

This event handles visual effects of weapons. The Weapons.lua contains a pre-configured event that shows the same visual hit effects as always. It is called for local and remote players. If it is called for remote players the parameters will contain the synced values from the other client.

Syntax

OnPlayWeaponHitEffects(PlayerId, Weapon, HitType, HitId, StartLocation, HitLocation, HitLocationRelative, HitNormal, HitResult)

Parameters

  • PlayerId
    The player identifier.
  • Weapon
    The weapon instance.
  • HitType
    https://dev.playonset.com/wiki/HitType
  • HitId
    The identifier of the hit entity.
  • StartLocation
    Trace start location of this bulet/hit.
  • HitLocation
    Trace hit location.
  • HitLocationRelative
    Hit location relative to the entity that was hit.
  • HitNormal
    Bullet impact normal.
  • HitResult
    Line trace result.

Example

AddEvent("OnPlayWeaponHitEffects", function (PlayerId, Weapon, HitType, HitId, StartLocation, HitLocation, HitLocationRelative, HitNormal, HitResult)

end)

See also