-
Notifications
You must be signed in to change notification settings - Fork 3
PlayerResource
lnx00 edited this page Jul 23, 2023
·
2 revisions
Helper functions for easy and type-annotated access to PlayerResource props. All functions return tables. You can access the ping value of a given player index using PlayerResource.GetPing()[index + 1] for example.
Make sure to always use index + 1 since indexing in Lua starts at 1!
DT_PlayerResource
-
.GetPing()Returns the ping table. -
.GetScore()Returns the score table. -
.GetDeaths()Returns the deaths table. -
.GetConnected()Returns the connection state table. -
.GetTeam()Returns the team numer table. -
.GetAlive()Returns the alive state table. -
.GetHealth()Returns the health table. -
.GetAccountID()Returns the account ID table. -
.GetValid()Returns the valid state table. -
.GetUserID()Returns the user ID table.
DT_TFPlayerResource
-
.GetTotalScore()Returns the total score table. -
.GetMaxHealth()Returns the max health table. -
.GetMaxBuffedHealth()Returns the max buffed health table. -
.GetPlayerClass()Returns the class number table. .GetArenaSpectator()-
.GetActiveDominations()Returns the amount of active dominations table. -
.GetNextRespawnTime()Returns the respawn time table. .GetChargeLevel()-
.GetDamage()Returns the damage amount table. -
.GetDamageAssist()Returns the damage assist amount table. -
.GetDamageBoss()Returns the boss damage table. -
.GetHealing()Returns the healing table. -
.GetHealingAssist()Returns the healing assist amount table. -
.GetDamageBlocked()Returns the blocked damage table. -
.GetCurrencyCollected()Returns the amount of currency collected table. .GetBonusPoints()-
.GetPlayerLevel()Returns the level table. .GetStreaks().GetUpgradeRefundCredits().GetBuybackCredits().GetPartyLeaderRedTeamIndex().GetPartyLeaderBlueTeamIndex().GetEventTeamStatus().GetPlayerClassWhenKilled()-
.GetConnectionState()Returns the connection state table. -
.GetConnectTime()Returns the connected time table.
Print your score in the console:
local PlayerResource = lnxLib.TF2.PlayerResource
local scores = PlayerResource.GetScore()
print("My Score: " .. scores[client.GetLocalPlayerIndex() + 1])