Jump to content

GetRace() - Papyrus Trouble


alexalexalex11314

Recommended Posts

Got this code. Compiles, but doesn't work in game. What is incorrect?
PlayerRaceVar = Game.GetPlayer().GetRace()


if PlayerRaceVar=="ArgonianRace"

game.getplayer().setactorvalue("HealRate", 0.1);

game.getplayer().setactorvalue("StaminaRate", 3);

game.getplayer().setactorvalue("Lockpicking", rgx_player_skill_bonus);

game.getplayer().setactorvalue("Alteration", rgx_player_skill_bonus);

Debug.Notification("Argonian it is.");




else
;
donothing



endif

 

Also tried

 

if Game.GetPlayer().GetRace()=="ArgonianRace"
game.getplayer().setactorvalue("HealRate", 0.1);
game.getplayer().setactorvalue("StaminaRate", 3);
game.getplayer().setactorvalue("Lockpicking", rgx_player_skill_bonus);
game.getplayer().setactorvalue("Alteration", rgx_player_skill_bonus);
Debug.Notification("Argonian it is.")


else
;donothing


endif

UPD:

 

SOLUTION

Race Property ArgonianRace Auto

if Game.GetPlayer().GetRace() == ArgonianRace
code
else
code
endif
Edited by alexalexalex11314
Link to comment
Share on other sites

Try:

 

 

Quest stage fragment code - not designed for a full script - not tested for function or compilation

Actor PlayerRef = Game.GetPlayer()
Race PlayerRace = PlayerRef.GetRace()

PlayerRef.setactorvalue("HealRate", 0.1)

If PlayerRace == "ArgonianRace"
  PlayerRef.setactorvalue("HealRate", 0.1)
  PlayerRef.setactorvalue("StaminaRate", 3)
  PlayerRef.setactorvalue("Lockpicking", rgx_player_skill_bonus)
  PlayerRef.setactorvalue("Alteration", rgx_player_skill_bonus)
  Debug.Notification("Argonian it is.")
else
  ; do nothing
EndIf

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...