G.LocalPlayer
From GMod Wiki
Revision as of 22:45, 7 November 2009 by Unrealomega (Talk | contribs)
| Function | |
| Syntax |
LocalPlayer( ) Where is this used? |
| Description: | |
| Returns the player object of the client the script is running on. | |
| Returns: | Player |
| Part of Library: | Global Functions |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.LocalPlayer]G.LocalPlayer [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | This example shows practical uses. |
|---|---|
| Used on | |
| Code | LocalPlayer():ChatPrint("You are talking to yourself") |
| Output | You are talking to yourself. |
Additional Notes
- You cannot store LocalPlayer() into a variable on initialization of your lua script. LocalPlayer() will return NULL until all entities have been initialized. See InitPostEntity.