Daiyus Posted March 20, 2015 Share Posted March 20, 2015 (edited) All, I am trying to write a script that does certain things depending on your race. I've referenced all the races and PlayerRef corrcetly, and my syntax is good, however the function always returns me as an Argonian, no matter what race I am. The code is as follows: IF PlayerRef.GetRace() == ArgonianRace || ArgonianRaceVampire PlayerRef.SetAV("Health", PlayerRef.GetBaseAV("Health") - 10) PlayerRef.SetAV("Magicka", PlayerRef.GetBaseAV("Magicka") + 10) PlayerRef.SetAV("Stamina", PlayerRef.GetBaseAV("Stamina")) PlayerRef.SetAV("CarryWeight", PlayerRef.GetBaseAV("CarryWeight") - 100) ELSEIF PlayerRef.GetRace() == BretonRace || BretonRaceVampire Player Ref.SetAV("Health", PlayerRef.GetBaseAV("Health") - 10) PlayerRef.SetAV("Magicka", PlayerRef.GetBaseAV("Magicka") + 20) PlayerRef.SetAV("Stamina", PlayerRef.GetBaseAV("Stamina") - 10) PlayerRef.SetAV("CarryWeight", PlayerRef.GetBaseAV("CarryWeight") - 105) ELSEIF PlayerRef.GetRace() == DarkElfRace || DarkElfRaceVampire PlayerRef.SetAV("Health", PlayerRef.GetBaseAV("Health")) PlayerRef.SetAV("Magicka", PlayerRef.GetBaseAV("Magicka") + 10) PlayerRef.SetAV("Stamina", PlayerRef.GetBaseAV("Stamina") - 10) PlayerRef.SetAV("CarryWeight", PlayerRef.GetBaseAV("CarryWeight") - 105) Etc, Etc, for each race. The actual functions I want to happen work flawlessly. It just never returns anything but being an Argonian. I've tried breaking it into individual IF statements; it ran every single one so in that instance it returned me as every race. I've tried calling the player race as a variable and then replacing the actual PlayerRef.GetRace() command with that. I've even called the function directly on my script, despite it extending quest and not having to have called any other functions directly. It's as if the GetRace() function just doesn't work. Anyone got any ideas? Thanks. Edited March 20, 2015 by Daiyus Link to comment Share on other sites More sharing options...
EnaiSiaion Posted March 20, 2015 Share Posted March 20, 2015 IF PlayerRef.GetRace() == ArgonianRace || ArgonianRaceVampire The second condition is "ArgonianRaceVampire" as in "is ArgonianRaceVampire not null". It isn't because you filled out the parameter. So this always returns yes. What you're trying to do is IF PlayerRef.GetRace() == ArgonianRace || PlayerRef.GetRace() == ArgonianRaceVampire Link to comment Share on other sites More sharing options...
Daiyus Posted March 20, 2015 Author Share Posted March 20, 2015 Thank you very much. I knew it would be something glaringly simple, but you know what it's like when you're wrapped up in things. Many thanks for your time and advice! Link to comment Share on other sites More sharing options...
Recommended Posts