After alot of trail an error, i still cant find a solution, and getting realy annoyed, LOL.
im using this:
I want to use the string variables "Question & Answer" So the NPC displays the random question and answer to compare it to the input, but i dont know how to implement it into the NPC.
if someone could help me with this id be realy grateful.
im using this:
Code:
if (File.Exists(@"C:\OldCODB\Questions.txt"))
{
string[] Lines = File.ReadAllLines(@"C:\OldCODB\Questions.txt");
List<string> Words = new List<string>();
foreach (string line in Lines)
{
foreach (string s in line.Split('\n'))
Words.Add(s);
}
string[] WordsArray = new string[Words.Count];
Words.CopyTo(WordsArray);
Random Rnd = new Random();
int RandomLine = Rnd.Next(0,12);
string LineToConvert = WordsArray[RandomLine];
string[] ConvertedString = LineToConvert.Split(' ');
string Question = ConvertedString[0].Replace("~", " ");
string Answer = ConvertedString[1];
}
else
{
Console.WriteLine("Questions.txt doesnt exist.");
}
if someone could help me with this id be realy grateful.