How would it work? And would it be able to save for example, a variable, in my case player_exp which changes its value throughout the script. for example, lets say it would gain 5 when a mob is killed like so:
Would it be able to save the amount that is gained? Because after gaining exp then restarting block launcher it resets to 0. Would it be able to fix that?
Sorry if i sounded confusing, any help would be much appreciated.
How would it work? And would it be able to save for example, a variable, in my case player_exp which changes its value throughout the script. for example, lets say it would gain 5 when a mob is killed like so:
Would it be able to save the amount that is gained? Because after gaining exp then restarting block launcher it resets to 0. Would it be able to fix that?
Sorry if i sounded confusing, any help would be much appreciated.
function leaveGame()
{
ModPE.saveData(XPName, player_xp);
}
function newLevel()
{
ModPE.readData(XPName);
}
(function procCmd was at there but no shown also var player_exp = 0; was there too.)
But it says XPName is not defined. What did i do wrong?
function leaveGame()
{
ModPE.saveData(XPName, player_xp);
}
function newLevel()
{
ModPE.readData(XPName);
}
(function procCmd was at there but no shown also var player_exp = 0; was there too.)
But it says XPName is not defined. What did i do wrong?
function deathHook(murderer, victim)
{
clientMessage("Gained 5 exp!")
player_exp = player_exp + 5;
}
Would it be able to save the amount that is gained? Because after gaining exp then restarting block launcher it resets to 0. Would it be able to fix that?
Sorry if i sounded confusing, any help would be much appreciated.
Link:
http://www.minecraft.../#entry29816329
function deathHook(murderer, victim) { clientMessage("Gained 5 exp!") player_exp = player_exp + 5; }do:
function deathHook(murderer, victim) { clientMessage("Gained 5 exp!") player_exp = player_exp + 5; } function leaveGame() { ModPE.saveData(XPName,player_xp); }Now when you leave the game it saves your XP.
Hope this helps if it does press the
Link:
http://www.minecraft.../#entry29816329
That's just the key variable that you can call back later, to read the data.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
function deathHook(murderer, victim)
{
clientMessage("Gained 5 exp!")
player_exp = player_exp + 5;
}
function leaveGame()
{
ModPE.saveData(XPName, player_xp);
}
function newLevel()
{
ModPE.readData(XPName);
}
(function procCmd was at there but no shown also var player_exp = 0; was there too.)
But it says XPName is not defined. What did i do wrong?
Link:
http://www.minecraft.../#entry29816329
Link:
http://www.minecraft.../#entry29816329
{
clientMessage("Gained 5 exp!")
player_exp = player_exp + 5;
}
function leaveGame()
{
ModPE.saveData("XPName",player_exp);
}
function newLevel()
{
player_exp = ModPE.readData("XPName")
}
Try this .
doesnt work!
add it:
var XPName;