Squirrel/Client/Events/Pickup/onPickupRespawn
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|onPickupRespawn}} This event is called a pickup has been respawned. == Syntax == <code>function onPickupRespawn( pickup )</code> === Arguments === * '''picku…') |
(Added example) |
||
Line 16: | Line 16: | ||
== Example == | == Example == | ||
− | + | This function teleports a player near a pickup after it respawns. | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPickupRespawn( pickup ) | |
+ | { | ||
+ | local player = FindLocalPlayer(); | ||
+ | player.Pos = Vector( (pickup.Pos.x - 3), (pickup.Pos.y - 3), pickup.Pos.z ); | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The client functions [[Squirrel/Client/Functions/Pickups/Pos|Pickup.Pos]], [[Squirrel/Client/Functions/Players/Pos|Player.Pos]] and [[Squirrel/Client/Functions/Players/FindLocalPlayer|FindLocalPlayer]] were used in this example. More information can be found on their corresponding pages. | |
== Related Events == | == Related Events == | ||
{{Squirrel/Client/Events/Pickups}} | {{Squirrel/Client/Events/Pickups}} |
Revision as of 12:39, 2 August 2011
This event is called a pickup has been respawned.
Syntax
function onPickupRespawn( pickup )
Arguments
- pickup - The pointer of the pickup thats been respawned
Returns
This event does not handle return values.
Example
This function teleports a player near a pickup after it respawns.
function onPickupRespawn( pickup ) { local player = FindLocalPlayer(); player.Pos = Vector( (pickup.Pos.x - 3), (pickup.Pos.y - 3), pickup.Pos.z ); }
Notes
The client functions Pickup.Pos, Player.Pos and FindLocalPlayer were used in this example. More information can be found on their corresponding pages.
Related Events
- onPickupPickedUp
- onPickupRespawn