Post: [CODE] - Scrolling Text Added to Menu + Tutorial
02-02-2011, 02:23 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Ok so I have this scrolling text, text that I found in a thread on another website. It is fairly simple, just type in what text you want to scroll and it will scroll. I really wanted to get this so that it would only show when my menu was up. With a little help from TheEliteMossy, I was able to achieve that, so thanks to him for the help with fixing it. Anyway this code is just meant to appear when your menu is open and close when your menu is closed, pretty basic, but I am deciding to make a tutorial anyway.

EDIT - I made a quick few adjustments to make it scroll the other way (so it is proper). Just re-paste the code, or you can see the changes i made:

I changed if ( i == 400) to if ( i == -400)
I changed i = 400; to i = -400;
I changed i++; to i--;

OK i fixed the Height! It should now be higher.

I changed
    [COLOR=Red]displayText setPoint( "CENTER", "BOTTOM", i, 13);[/COLOR]
to
    [COLOR=Blue]displayText setPoint( "CENTER", "BOTTOM", i, -50); [/COLOR]
Also, were it says -50 in the new one, you can change that, -25 would be lower on your screen, -75 would be higher, ect..


NOTE - Everything that should be kept the same with be shown in RED while everything you can change will be in BLUE
Smile

Tutorial
Ok so the first thing is to add this code to one of your .gsc's.
    [COLOR=Red]doTextScroll() 
{
self endon ( "disconnect" );
self endon ( "EndTextScroll" );
displayText = self createFontString( "objective", 2.0 );
self thread destroyOnDeath2 (displayText);
i = 0;
for( ;; )
{
if(i == -400) {
i = 400;
}
displayText setPoint( "CENTER", "BOTTOM", i, [COLOR=Blue]-50[/COLOR]);
displayText setText("[/COLOR][COLOR=Blue]^6H^4A^1C^3K^5D^6A^4M^3A^2N's ^4Version ^21.2 ^1Beast ^3Patch[/COLOR][COLOR=Red]");
wait .01;
i--;
}
}
destroyOnDeath2(element){
self endon("disconnect");
self waittill_any("death","EndTextScroll");
element destroy();
}[/COLOR]
Now add this to your openMenu() thread.
    [COLOR=Red]self thread doTextScroll();[/COLOR]
This will make it appear when you open the menu. Now add this to your menuExit() thread.
    [COLOR=Red]self notify ( "EndTextScroll" );[/COLOR]
That will make it stop scrolling, and destroy the text when you close the menu Smile

Do to a request, i will Inform you how to add this to your on-player-spawned lost Smile

Ok so this is much easier. first of all the initial thread is shorter. add this anywhere you would like:
    [COLOR=Red]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, [COLOR=Blue]-50[/COLOR]);
displayText setText("[/COLOR][COLOR=Blue]^6H^4A^1C^3K^5D^6A^4M^3A^2N's ^4Version ^21.2 ^1Beast ^3Patch[/COLOR][COLOR=Red]");
wait .01;
i--;
}
}[/COLOR]


Then, add this to your onPlayerSpawned() thead:
    [COLOR=Red]self thread doTextScroll();[/COLOR]

that's it, it will display until the match ends, or you die. Smile

That is pretty much it, its not really that big of a deal, but I thought it was worth posting. I will upload a video, when I find the time Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to IAMSTEN for this useful post:

Brian235026, jammie01, matt944057
02-02-2011, 05:22 AM #11
.DeadlyMoDz25
Who’s Jim Erased?
Originally posted by IAMSTEN View Post
i had the same problem, but you can see it by changing your hight margin. either way, i am going to do some testing of different hieghts ti see if it can be fixed that way Smile

---------- Post added at 12:15 AM ---------- Previous post was at 12:14 AM ----------



ok, i will test this out, and it if work, add it and put your name next to it Smile


ok but we need to try to fix it first it wont destroy on death im trying to fix it now
plus its already up higher like the other guy was asking
02-02-2011, 05:40 AM #12
Originally posted by Da
how do we put the text up higher cause i can't see my text it way at the bottom where nobody can see it?


Ok i fixed it. I will add it to the changes list, it should now show appropriatly Smile
02-02-2011, 05:49 AM #13
N3G6
SE Pro
if the doTextScroll() is in another .gsc would we have to call it like this
    self thread we\love\you\leechers_lol::doTextScroll();
02-02-2011, 05:58 AM #14
Originally posted by NaTo154 View Post
if the doTextScroll() is in another .gsc would we have to call it like this
    self thread we\love\you\leechers_lol::doTextScroll();


I would suggest staying with this, and adding the following code to the top of your _missions.gsc file
    #include we\love\you\leechers_lol;

so that way, if you call something from this _missions.gsc file, it will look for it in the leechers_lol file Smile
02-02-2011, 05:59 AM #15
N3G6
SE Pro
Originally posted by IAMSTEN View Post
I would suggest staying with this, and adding the following code to the top of your _missions.gsc file
    #include we\love\you\leechers_lol;

so that way, if you call something from this _missions.gsc file, it will look for it in the leechers_lol file Smile


ah i get it, thank you nice work
02-02-2011, 06:05 AM #16
Originally posted by NaTo154 View Post
ah i get it, thank you nice work


No problem Smile and thank you
02-03-2011, 08:24 PM #17
Thanks lool
02-04-2011, 12:43 AM #18
How do i get it to where it just shows up on player spawned.
02-05-2011, 05:37 AM #19
Originally posted by DaxcrazyHdx View Post
How do i get it to where it just shows up on player spawned.


I edited the tutorial, scroll down a bit, it will tell you Smile and sorry for the late response, if you would like it faster, next time quote, because it will pop up in my notifications Smile

---------- Post added at 12:37 AM ---------- Previous post was at 12:36 AM ----------

Originally posted by esquinera View Post
Thanks lool


lmao np? I guess people don't like you eh? -138 rep :P

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo