void getResult() { if (isServer && ServerBool) { if (ClientBool) { QuestionData.addScore(true); QuestionData.addScore(false); Debug.Log("Score added server"); Debug.Log("Score added client"); GameObject.Find("correct").GetComponent <Text>().text = "Correct"; GameObject.Find("Result").GetComponent <Text>().text = "Je hebt juist geraden!\nJe tegenstandeer heeft ook juist geraden!"; } else { Debug.Log("Score added sserver2"); QuestionData.addScore(true); GameObject.Find("correct").GetComponent <Text>().text = "Fout"; GameObject.Find("Result").GetComponent <Text>().text = "Je hebt juist geraden!\nJe tegenstandeer heeft fout geraden!"; } } else if (isServer) { if (ClientBool) { QuestionData.addScore(false); Debug.Log("Score added client 2"); GameObject.Find("correct").GetComponent <Text>().text = "Fout"; GameObject.Find("Result").GetComponent <Text>().text = "Je hebt fout geraden!\nJe tegenstander heeft juist geraden!"; } else { GameObject.Find("correct").GetComponent <Text>().text = "Fout"; GameObject.Find("Result").GetComponent <Text>().text = "Je hebt fout geraden!\nJe tegenstander heeft ook fout geraden!"; } } if (!isServer && ClientBool) { if (ServerBool) { GameObject.Find("correct").GetComponent <Text>().text = "Correct"; GameObject.Find("Result").GetComponent <Text>().text = "Je hebt juist geraden!\nJe tegenstandeer heeft ook juist geraden!"; } else { GameObject.Find("correct").GetComponent <Text>().text = "Correct"; GameObject.Find("Result").GetComponent <Text>().text = "Je hebt juist geraden!\nJe tegenstandeer heeft fout geraden!"; } } else if (!isServer) { if (ServerBool) { GameObject.Find("correct").GetComponent <Text>().text = "Fout"; GameObject.Find("Result").GetComponent <Text>().text = "Je hebt fout geraden!\nJe tegenstander heeft juist geraden!"; } else { GameObject.Find("correct").GetComponent <Text>().text = "Fout"; GameObject.Find("Result").GetComponent <Text>().text = "Je hebt fout geraden!\nJe tegenstander heeft ook fout geraden!"; } } resultShowed = true; if (isServer) { ServerScore = QuestionData.getScore(true); ClientScore = QuestionData.getScore(false); GameObject.Find("Scores").GetComponent <Text>().text = "Jouw score: " + ServerScore + "\nTegenstander score: " + ClientScore; } else { GameObject.Find("Scores").GetComponent <Text>().text = "Jouw score: " + ClientScore + "\nTegenstander score: " + ServerScore; } GameObject.Find("Titel").GetComponent <Text>().text = "Vraag " + QuestionNr.ToString() + ":"; for (int i = 0; i < Percents.Length; i++) { if (Percents[i] > HighestPercent) { HighestPercent = Percents[i]; RightAnswer = i + 1; } } //for (int i = 0; i < percenten.Length; i++) //{ // Debug.Log("Percent: " + percenten[i]); //} if (!isServer) { AnswerAmount = Answers.Length; } GameObject.Find("Results").GetComponent <Text>().text = "Resultaten:\n"; for (int i = 0; i < AnswerAmount; i++) { GameObject.Find("Results").GetComponent <Text>().text = GameObject.Find("Results").GetComponent <Text>().text + Answers[i] + ": " + Percents[i] + "%\n"; } }