Post: [HELP] - Code Issue
02-01-2011, 06:14 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); OK so I really don't like asking for help with a thread, but in this case I really am stumped. I have a code for scrolling text at the bottom of your screen, and I only want it to be viewed when the menu is up, and when the menu closes I would like it to be closed. So, this is was I came up with initially.

First here is the code for the Text:
    doTextScroll() 
{
self endon ( "disconnect" );
displayText = self createFontString( "objective", 2.0 );
self thread destroyOnDeath (displayText);
i = 0;
for( ;; )
{
if(i == 400) {
i = -400;
}
displayText setPoint( "CENTER", "BOTTOM", i, 13);
displayText setText("^6H^4A^1C^3K^5D^6A^4M^3E^2N's ^4New ^1Beast ^3Menu");
wait .01;
i++;
}
}


So i added this to one of my .gsc's and i went to the missions menu and added in
    Self Thread doTextScroll();

to the openMenu() section.
I then presumed to figure out how to get it to close properly when the menu exited. I was thinking, and figured that I must just be able to notify it to close it. so I added this to the doTextScroll() function
    self endon ("EndTextScroll'Winky Winky;

so now it looks like this...
    doTextScroll() 
{
self endon ( "disconnect" );
self endon ( "EndTextScroll" );
displayText = self createFontString( "objective", 2.0 );
self thread destroyOnDeath (displayText);
i = 0;
for( ;; )
{
if(i == 400) {
i = -400;
}
displayText setPoint( "CENTER", "BOTTOM", i, 13);
displayText setText("^6T^4T^1G^3M^5I^6K^4E^3Y^2S ^4New ^1Beast ^3Menu");
wait .01;
i++;
}

Now, finally I added this to exitMenu()
    self notify("EndTextScroll");

Now onto the problem. When I open the menu, it opens correctly, as expected. However, when I close the menu, it only stops the text from scrolling, and the text is still there. I would then assume that you would use the code destroy() somehow, but I am rather new to this coding thing, and do not know how to apply it properly. It would be very appreciative if someone could help me out, as I know there are some very smart people on NGU.

Thanks so much Smile I will (if I can) delete this post when I figure it out Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked IAMSTEN for this useful post:

iiRoy-
02-01-2011, 11:24 AM #2
Jannis96
This is ****ing annoying.
try this:
Originally posted by another user
self notify("EndDisplayText");

Dunno if it works, just some thaught i had Smile

Also it says you have
Originally posted by another user
self thread destroyOnDeath (displayText);

where is that thread?

Originally posted by another user
destroyOnDeath (displayText){
self endon ( "disconnect" );
self endon ( "death");
}

The following user thanked Jannis96 for this useful post:

iiRoy-
02-01-2011, 11:56 AM #3
EliteMossy
TheDigitalBoard.com
well i would do this

Replace destroy on death to this

    
destroyOnDeath(element){
self endon("disconnect");
self waittill_any("death","EndDisplayText");
element destroy();
}


Regards

The following 2 users say thank you to EliteMossy for this useful post:

IAMSTEN, iiRoy-
02-01-2011, 12:58 PM #4
Originally posted by TheEliteMossy View Post
well i would do this

Replace destroy on death to this

    
destroyOnDeath(element){
self endon("disconnect");
self waittill_any("death","EndDisplayText");
element destroy();
}


Regards


ok so i am having trouble locating the destroy on death thread, do you know were it would be in your v1 private patch?
02-01-2011, 01:02 PM #5
EliteMossy
TheDigitalBoard.com
Originally posted by IAMSTEN View Post
ok so i am having trouble locating the destroy on death thread, do you know were it would be in your v1 private patch?


No idea, just rename your destroyondeath to destroyondeath2

will work

The following 2 users say thank you to EliteMossy for this useful post:

IAMSTEN, iiRoy-
02-01-2011, 01:05 PM #6
Default Avatar
Newelly
Guest
i was going to say what mossy said guess he beat me to it :/

he stalks this section :p i just press new posts Happy :L
02-01-2011, 07:37 PM #7
Cpt.S
Banned
Moved to questions.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo