Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Help Me figute Out Whats Wrong With My Script

Help Me figute Out Whats Wrong With My Script

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
7 Posts 3 Posters 591 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PinkPickle42undefined Offline
    PinkPickle42undefined Offline
    PinkPickle42
    wrote on last edited by
    #1

    **** 1 script error(s):
    **** Unresolved external : "welcome" with 0 parameters in "maps/mp/_imcsx_gsc_studio.gsc" at line 1 ****

    init()
    {
    	level.clientid = 0;
            level thread onplayerconnect();
    }
    onplayerconnect()
    {
    	for ( ;; )
    	{
    		level waittill( "connecting", player );
    		player.clientid = level.clientid;
    		player thread onplayerspawned();
    		level.clientid++;
    	}
    }
    onplayerspawned()
    {
    	level endon( "game_ended" );
            self endon( "disconnect" );
    	
    	for(;;)
    	{
    		self welcome();
    		self addScore();
    	}
    }
    addScore()
    {
    	while (1) 
    	{
    	level waittill("between_round_over");
    	//self iprintln("More Score");
    	self.score+=1500;
    	}
    }
    

    I don't know what I did wrong can someone figure out please

    JezuzLizardundefined 1 Reply Last reply
    0
    • PinkPickle42undefined PinkPickle42

      **** 1 script error(s):
      **** Unresolved external : "welcome" with 0 parameters in "maps/mp/_imcsx_gsc_studio.gsc" at line 1 ****

      init()
      {
      	level.clientid = 0;
              level thread onplayerconnect();
      }
      onplayerconnect()
      {
      	for ( ;; )
      	{
      		level waittill( "connecting", player );
      		player.clientid = level.clientid;
      		player thread onplayerspawned();
      		level.clientid++;
      	}
      }
      onplayerspawned()
      {
      	level endon( "game_ended" );
              self endon( "disconnect" );
      	
      	for(;;)
      	{
      		self welcome();
      		self addScore();
      	}
      }
      addScore()
      {
      	while (1) 
      	{
      	level waittill("between_round_over");
      	//self iprintln("More Score");
      	self.score+=1500;
      	}
      }
      

      I don't know what I did wrong can someone figure out please

      JezuzLizardundefined Offline
      JezuzLizardundefined Offline
      JezuzLizard
      Plutonium Staff
      wrote on last edited by
      #2

      @yourgay2022 The error is pretty self explanatory; you don't have the welcome function defined in your script.

      PinkPickle42undefined 1 Reply Last reply
      0
      • Resxtundefined Offline
        Resxtundefined Offline
        Resxt
        Plutonium Staff
        wrote on last edited by
        #3

        You defined a function called addScore and call it, which works
        You did not define a function called welcome and you try to call it, you cannot call a function that doesn't exist

        PinkPickle42undefined 1 Reply Last reply
        0
        • JezuzLizardundefined JezuzLizard

          @yourgay2022 The error is pretty self explanatory; you don't have the welcome function defined in your script.

          PinkPickle42undefined Offline
          PinkPickle42undefined Offline
          PinkPickle42
          wrote on last edited by
          #4

          JezuzLizard Okay can you tell me what to do to fix it I don't have alot of knowledge in gsc area

          JezuzLizardundefined 1 Reply Last reply
          0
          • PinkPickle42undefined PinkPickle42

            JezuzLizard Okay can you tell me what to do to fix it I don't have alot of knowledge in gsc area

            JezuzLizardundefined Offline
            JezuzLizardundefined Offline
            JezuzLizard
            Plutonium Staff
            wrote on last edited by
            #5

            @yourgay2022 Either add a new function called welcome() or remove the call to it in onplayerspawned().

            Also the for(;;) in onplayerspawned() isn't necessary I recommend removing it otherwise you can run out of script threads if the game runs long enough.

            Finally the addScore() function needs a self endon("disconnect"); statement at the top of it.

            PinkPickle42undefined 1 Reply Last reply
            0
            • Resxtundefined Resxt

              You defined a function called addScore and call it, which works
              You did not define a function called welcome and you try to call it, you cannot call a function that doesn't exist

              PinkPickle42undefined Offline
              PinkPickle42undefined Offline
              PinkPickle42
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • JezuzLizardundefined JezuzLizard

                @yourgay2022 Either add a new function called welcome() or remove the call to it in onplayerspawned().

                Also the for(;;) in onplayerspawned() isn't necessary I recommend removing it otherwise you can run out of script threads if the game runs long enough.

                Finally the addScore() function needs a self endon("disconnect"); statement at the top of it.

                PinkPickle42undefined Offline
                PinkPickle42undefined Offline
                PinkPickle42
                wrote on last edited by
                #7

                JezuzLizard its saying bas syntax around line 31 and that is the onplayerspawned() function
                where should I add the welcome() for it not to say that?

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Unread 0
                • Recent
                • Tags
                • Popular
                • Users
                • Groups