sub HiScoreLoad
{
	if(SelectedDifficult=="Moderate")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAEasy[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAEasy2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBEasy[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBEasy2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuCEasy[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuCEasy2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuDEasy[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuDEasy2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuEEasy[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuEEasy2[i],0);
				ScriptNameArray[i]=GetCommonDataDefaultEx(NsScore,NsHiScoreEasyName[i],0);
			}
		}
	}

	if(SelectedDifficult=="Extream")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuANormal[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuANormal2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBNormal[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBNormal2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuCNormal[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuCNormal2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuDNormal[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuDNormal2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuENormal[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuENormal2[i],0);
				ScriptNameArray[i]=GetCommonDataDefaultEx(NsScore,NsHiScoreNormalName[i],0);
			}
		}
	}


	if(SelectedDifficult=="Apocalypse")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAHard[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAHard2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBHard[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBHard2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuCHard[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuCHard2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuDHard[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuDHard2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuEHard[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuEHard2[i],0);
				ScriptNameArray[i]=GetCommonDataDefaultEx(NsScore,NsHiScoreHardName[i],0);
			}
		}
	}

	if(SelectedDifficult=="Arrange")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuALuna[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuALuna2[i],0);
				Hiscore3[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuALuna3[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBLuna[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBLuna2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuCLuna[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuCLuna2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuDLuna[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuDLuna2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuELuna[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuELuna2[i],0);
			}
		}
	}
}

//----------------------------------------------------------------------------------------------------------------------
sub HiScoreSave
{
	let score1 =ScoreNumber1;
	let score2 = ScoreNumber2;
	let score3 = ScoreNumber3;
	if(SelectedDifficult=="Moderate")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[j],score2);
					break;
				}

				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[j],score2);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuCEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuCEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuCEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuCEasy2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuCEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuCEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuCEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuCEasy2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuDEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuDEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuDEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuDEasy2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuDEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuDEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuDEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuDEasy2[j],score2);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuEEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuEEasy2[i],Hiscore2[i-1]);

						SetCommonDataEx(NsScore,NsHiScoreEasyName[i],ScriptNameArray[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuEEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuEEasy2[j],score2);

					SetCommonDataEx(NsScore,NsHiScoreEasyName[j],GetPlayerScriptName);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuEEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuEEasy2[i],Hiscore2[i-1]);

						SetCommonDataEx(NsScore,NsHiScoreEasyName[i],ScriptNameArray[i-1]);

					}
					SetCommonDataEx(NsScore,NsHiScoreReimuEEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuEEasy2[j],score2);

					SetCommonDataEx(NsScore,NsHiScoreEasyName[j],GetPlayerScriptName);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Extream")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[j],score2);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuCNormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuCNormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuCNormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuCNormal2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuCNormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuCNormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuCNormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuCNormal2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuDNormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuDNormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuDNormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuDNormal2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuDNormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuDNormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuDNormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuDNormal2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuENormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuENormal2[i],Hiscore2[i-1]);

						SetCommonDataEx(NsScore,NsHiScoreNormalName[i],ScriptNameArray[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuENormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuENormal2[j],score2);

					SetCommonDataEx(NsScore,NsHiScoreNormalName[j],GetPlayerScriptName);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuENormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuENormal2[i],Hiscore2[i-1]);

						SetCommonDataEx(NsScore,NsHiScoreNormalName[i],ScriptNameArray[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuENormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuENormal2[j],score2);

					SetCommonDataEx(NsScore,NsHiScoreNormalName[j],GetPlayerScriptName);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Apocalypse")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[j],score2);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuCHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuCHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuCHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuCHard2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuCHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuCHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuCHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuCHard2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuDHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuDHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuDHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuDHard2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuDHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuDHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuDHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuDHard2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuEHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuEHard2[i],Hiscore2[i-1]);

						SetCommonDataEx(NsScore,NsHiScoreHardName[i],ScriptNameArray[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuEHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuEHard2[j],score2);

					SetCommonDataEx(NsScore,NsHiScoreHardName[j],GetPlayerScriptName);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuEHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuEHard2[i],Hiscore2[i-1]);

						SetCommonDataEx(NsScore,NsHiScoreHardName[i],ScriptNameArray[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuEHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuEHard2[j],score2);

					SetCommonDataEx(NsScore,NsHiScoreHardName[j],GetPlayerScriptName);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Arrange")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score3 > Hiscore3[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[i],Hiscore2[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna3[i],Hiscore3[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[j],score2);
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna3[j],score3);
					break;
				}
				if(score3 == Hiscore3[j] && score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[i],Hiscore2[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna3[i],Hiscore3[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[j],score2);
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna3[j],score3);
					break;
				}
				if(score3 == Hiscore3[j] && score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[i],Hiscore2[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna3[i],Hiscore3[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[j],score2);
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna3[j],score3);
					break;
				}
/*
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuALuna2[j],score2);
					break;
				}
*/
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBLuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBLuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBLuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBLuna2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBLuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBLuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBLuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBLuna2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuCLuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuCLuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuCLuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuCLuna2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuCLuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuCLuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuCLuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuCLuna2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuDLuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuDLuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuDLuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuDLuna2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuDLuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuDLuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuDLuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuDLuna2[j],score2);
					break;
				}
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuELuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuELuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuELuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuELuna2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuELuna[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuELuna2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuELuna[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuELuna2[j],score2);
					break;
				}
			}
		}
	}
}
///////////////////////////////////////////////////////////////////////////////////////
	function StageHiscoreSave(let Stage)
	{
		Stage-=1;
		Stagescore2=ScoreNumber2-SubtotalStagescore2;
		if(ScoreNumber1-SubtotalStagescore<0)
		{
			Stagescore=1000000+ScoreNumber1-SubtotalStagescore;
			Stagescore2-=1;
		}
		else
		{
			Stagescore=ScoreNumber1-SubtotalStagescore;
		}
		alternative(SelectedDifficult)
		case("Moderate")
		{
			alternative(SelectedCharacter)
			case(DefinedPlayer1)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuAEasy2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuAEasy2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuAEasy[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuAEasy2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuAEasy[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuAEasy[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer2)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBEasy2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBEasy2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBEasy[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBEasy2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBEasy[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBEasy[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer3)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCEasy2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCEasy2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCEasy[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCEasy2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCEasy[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCEasy[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer4)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDEasy2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDEasy2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDEasy[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDEasy2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDEasy[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDEasy[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer5)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuEEasy2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuEEasy2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuEEasy[Stage],Stagescore);
///////siori
					SetCommonDataEx(NsScore,NsStageHiScoreEasyName[Stage],GetPlayerScriptName);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuEEasy2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuEEasy[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuEEasy[Stage],Stagescore);

					SetCommonDataEx(NsScore,NsStageHiScoreEasyName[Stage],GetPlayerScriptName);
					}
				}
			}
		}
		case("Extream")
		{
			alternative(SelectedCharacter)
			case(DefinedPlayer1)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuANormal2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuANormal2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuANormal[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuANormal2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuANormal[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuANormal[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer2)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBNormal2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBNormal2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBNormal[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBNormal2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBNormal[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBNormal[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer3)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCNormal2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCNormal2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCNormal[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCNormal2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCNormal[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCNormal[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer4)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDNormal2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDNormal2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDNormal[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDNormal2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDNormal[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDNormal[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer5)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuENormal2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuENormal2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuENormal[Stage],Stagescore);

					SetCommonDataEx(NsScore,NsStageHiScoreNormalName[Stage],GetPlayerScriptName);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuENormal2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuENormal[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuENormal[Stage],Stagescore);

					SetCommonDataEx(NsScore,NsStageHiScoreNormalName[Stage],GetPlayerScriptName);
					}
				}
			}
		}
		case("Apocalypse")
		{
			alternative(SelectedCharacter)
			case(DefinedPlayer1)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuAHard2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuAHard2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuAHard[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuAHard2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuAHard[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuAHard[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer2)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBHard2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBHard2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBHard[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBHard2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBHard[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBHard[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer3)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCHard2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCHard2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCHard[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCHard2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCHard[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCHard[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer4)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDHard2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDHard2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDHard[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDHard2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDHard[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDHard[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer5)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuEHard2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuEHard2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuEHard[Stage],Stagescore);

					SetCommonDataEx(NsScore,NsStageHiScoreHardName[Stage],GetPlayerScriptName);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuEHard2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuEHard[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuEHard[Stage],Stagescore);

					SetCommonDataEx(NsScore,NsStageHiScoreHardName[Stage],GetPlayerScriptName);
					}
				}
			}
		}
		case("Arrange")
		{
			alternative(SelectedCharacter)
			case(DefinedPlayer1)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuALuna2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuALuna2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuALuna[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuALuna2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuALuna[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuALuna[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer2)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBLuna2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBLuna2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBLuna[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBLuna2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuBLuna[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuBLuna[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer3)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCLuna2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCLuna2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCLuna[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCLuna2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuCLuna[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuCLuna[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer4)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDLuna2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDLuna2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDLuna[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDLuna2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuDLuna[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuDLuna[Stage],Stagescore);
					}
				}
			}
			case(DefinedPlayer5)
			{
				if(Stagescore2>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuELuna2[Stage],0))
				{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuELuna2[Stage],Stagescore2);
					SetCommonDataEx(NsScore,NsStageHiScoreReimuELuna[Stage],Stagescore);
				}
				else if(Stagescore2==GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuELuna2[Stage],0))
				{
					if(Stagescore>GetCommonDataDefaultEx(NsScore,NsStageHiScoreReimuELuna[Stage],0))
					{
					SetCommonDataEx(NsScore,NsStageHiScoreReimuELuna[Stage],Stagescore);
					}
				}
			}
		}
	}
////////////////////////////////////////////////////////////////////////////////////////////
//////////////////時間計測、回数記録部,初期ボーナス部/////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
		task UpTimeCount//起動時間とプレイ時間の計測
		{
			UpTime=GetCommonDataDefaultEx(NsScore,NsUpTime,0);
			PlayTime=GetCommonDataDefaultEx(NsScore,NsPlayTime,0);
			loop
			{
				UpTime++;
				if(StageState!=Menu)
				{
				PlayTime++;
				}
				wait(60);
			}
		}

		task PlayCharacterAndDifficult//プレイ回数を増やし難易度を決定
		{
			alternative(SelectedDifficult)
			case("Moderate")
			{
				alternative(SelectedCharacter)
				case(DefinedPlayer1)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuAEasy,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuAEasy,Frequency);		
				}
				case(DefinedPlayer2)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuBEasy,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuBEasy,Frequency);		
				}
				case(DefinedPlayer3)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuCEasy,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuCEasy,Frequency);		
				}
				case(DefinedPlayer4)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuDEasy,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuDEasy,Frequency);		
				}
				//case(DefinedPlayer5)
				others
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuEEasy,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuEEasy,Frequency);		
				}
			}
			case("Extream")
			{
				alternative(SelectedCharacter)
				case(DefinedPlayer1)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuANormal,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuANormal,Frequency);		
				}
				case(DefinedPlayer2)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuBNormal,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuBNormal,Frequency);		
				}
				case(DefinedPlayer3)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuCNormal,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuCNormal,Frequency);		
				}
				case(DefinedPlayer4)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuDNormal,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuDNormal,Frequency);		
				}
				case(DefinedPlayer5)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuENormal,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuENormal,Frequency);		
				}
			}
			case("Apocalypse")
			{
				alternative(SelectedCharacter)
				case(DefinedPlayer1)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuAHard,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuAHard,Frequency);		
				}
				case(DefinedPlayer2)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuBHard,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuBHard,Frequency);		
				}
				case(DefinedPlayer3)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuCHard,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuCHard,Frequency);		
				}
				case(DefinedPlayer4)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuDHard,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuDHard,Frequency);		
				}
				case(DefinedPlayer5)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuEHard,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuEHard,Frequency);		
				}
			}
			case("Arrange")
			{
				alternative(SelectedCharacter)
				case(DefinedPlayer1)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuALuna,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuALuna,Frequency);		
				}
				case(DefinedPlayer2)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuBLuna,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuBLuna,Frequency);		
				}
				case(DefinedPlayer3)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuCLuna,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuCLuna,Frequency);		
				}
				case(DefinedPlayer4)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuDLuna,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuDLuna,Frequency);		
				}
				case(DefinedPlayer5)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuELuna,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuELuna,Frequency);		
				}
			}
		}