- Home /
 
 
               Question by 
               makram · Apr 15, 2011 at 02:11 PM · 
                javascriptloadlevel  
              
 
              Restart game script.
hi i need the script for restart the game i used this script
function PauseMenu() { BeginPage(200,200); if (GUILayout.Button (IsBeginning() ? "Play" : "Continue")) {
 
                    UnPauseGame();
 }
 if (GUILayout.Button ("Options")) {
     currentPage = Page.Options;
 }
 if (GUILayout.Button ("Credits")) {
     currentPage = Page.Credits;
 }
 **if (!IsBrowser() && !IsBeginning() && GUILayout.Button ("Restart")) {
    currentPage = Page.Main;
 }**
 EndPage();
  
               }  
               Comment
              
 
               
              You forgot the 't' in restart in your title.
Your Question needs revising. I'm assu$$anonymous$$g you need to restart a level?
 
               Best Answer 
              
 
              Answer by poncho · Apr 15, 2011 at 02:15 PM
Application.LoadLevel(Application.loadedLevelName);
 
               
               this one works for me, hope it helps
in your case would be your main page -> currentPage
Your answer
 
             Follow this Question
Related Questions
Can you use a var to load a level? 2 Answers
level loader script wont work 1 Answer
Application.LoadLevel not loading levels 1 Answer
Loading with ArrayPrefs 1 Answer
Save/Load - Strange behaviour 1 Answer