Quest Reward
Posted: Sat Dec 05, 2015 3:03 pm
I have a script to record variables and I want to manipulate those variables after quest is finished, I need help
Support and discussion forum for Pixel Crushers products
https://www.pixelcrushers.com:443/phpbb/
Code: Select all
GiveXP(50);
Variable["Alert"] = "Gained 50 XP!";
Quest["Some_Quest"].State = "success"
Code: Select all
public class PlayerLevel : MonoBehaviour {
public int xp;
void OnEnable() {
Lua.RegisterFunction("GiveXP", this, typeof(PlayerLevel).GetMethod("GiveXP"));
}
void OnDisable() {
Lua.UnregisterFunction("GiveXP");
}
public void GiveXP(double amount) { //<--Numbers must be doubles.
// Your code here to award XP. For example:
xp += (int) amount;
}
}