Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
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 153 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
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
    • JezuzLizardundefined Offline
      JezuzLizardundefined Offline
      JezuzLizard Plutonium Staff
      replied to PinkPickle42 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
        • PinkPickle42undefined Offline
          PinkPickle42undefined Offline
          PinkPickle42
          replied to JezuzLizard 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
          • JezuzLizardundefined Offline
            JezuzLizardundefined Offline
            JezuzLizard Plutonium Staff
            replied to PinkPickle42 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
            • PinkPickle42undefined Offline
              PinkPickle42undefined Offline
              PinkPickle42
              replied to Resxt on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • PinkPickle42undefined Offline
                PinkPickle42undefined Offline
                PinkPickle42
                replied to JezuzLizard 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

                • Login

                • Don't have an account? Register

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