Help Me figute Out Whats Wrong With My Script
-
**** 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
-
**** 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
@yourgay2022 The error is pretty self explanatory; you don't have the welcome function defined in your script.
-
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 -
@yourgay2022 The error is pretty self explanatory; you don't have the welcome function defined in your script.
JezuzLizard Okay can you tell me what to do to fix it I don't have alot of knowledge in gsc area
-
JezuzLizard Okay can you tell me what to do to fix it I don't have alot of knowledge in gsc area
@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.
-
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 existThis post is deleted! -
@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.
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?
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