GivePlayerExperience: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Complete Lua function catalog
 
Line 30: Line 30:
* This is a convenience wrapper around <code>addPlayerStat</code> for <code>experience</code>.
* This is a convenience wrapper around <code>addPlayerStat</code> for <code>experience</code>.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:Progression Functions]]
[[Category:Progression Functions]]
[[Category:Player Functions]]
[[Category:Player Functions]]

Latest revision as of 09:53, 15 August 2026

givePlayerExperience

Adds an amount to a player's authoritative experience.

Syntax

bool givePlayerExperience(int playerId, number amount)

Parameters

Name Type Required Description
playerId int yes The connected player to update.
amount number yes The amount of experience to add.

Returns

Returns true when the updated value is accepted; otherwise returns false.

Examples

Award experience to a player:

givePlayerExperience(playerId, 100)

Notes

  • Available only in server-side resource scripts.
  • This is a convenience wrapper around addPlayerStat for experience.