Difference between revisions of "GetPlayerExperience - Game"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Lisselli
imported>Rasikko
m (→‎Examples: syntax and spacing)
 
(3 intermediate revisions by one other user not shown)
Line 16: Line 16:
<source lang="papyrus">
<source lang="papyrus">
Float Function GetExperienceRemaining()
Float Function GetExperienceRemaining()
; returns the amount of experience remaining for the current level.
    ; returns the amount of experience remaining for the current level.
Int CurrentLevel = Game.GetPlayer().GetLevel()
    Return Game.GetExperienceForLevel(Game.GetPlayer().GetLevel()) - Game.GetPlayerExperience()
Float CurrentEXP = Game.GetPlayerExperience()
Float RequiredEXP = Game.GetExperienceForLevel(CurrentLevel)
Float RemainingEXP = RequiredEXP - CurrentEXP
return RemainingEXP
EndFunction
EndFunction
</source>
</source>

Latest revision as of 05:56, 5 May 2018

SKSE Member of: Game Script

Returns the current amount of experience for the current level. (This function requires SKSE.)

Syntax[edit | edit source]

Float Function GetPlayerExperience()

Return Value[edit | edit source]

  • Returns the current amount of experience for the current level.

Examples[edit | edit source]

Float Function GetExperienceRemaining()
    ; returns the amount of experience remaining for the current level.
    Return Game.GetExperienceForLevel(Game.GetPlayer().GetLevel()) - Game.GetPlayerExperience()
EndFunction

See Also[edit | edit source]