flyinian
Member
I've been learning how scripts work and was wondering if the below code can be placed into one script or i will need multiple scripts for it to work.
My guess, I need multiple scripts.
My guess, I need multiple scripts.
Code:
if (Requirements_Met == true && Allow_Leveling)
{
if(Current_Experience < Next_Experience)
{// If leveling hasnt been achieved yet
Current_Experience += 3;
}
else
{// Level up achieved
Next_Experience *= Experience_Multiplier;
Current_Level ++; // Level up
};
Done_Completion = Current_Experience / Max_Experience * 100;
if (Current_Experience >= Next_Experience && Current_Level >= Max_Level)
{
Allow_Leveling = false;
Value_Checking = true;
};
}
else
{
if (Value_Checking)
{
if (Current_Experience > Max_Experience)
{
Current_Experience = Max_Experience;
};
if (Current_Level > Max_Level)
{
Current_Level = Max_Level;
};
if (Done_Completion > 100)
{
Done_Completion = 100;
};
Value_Checking = false;
};
};