Sliding GUI Text is out of place - help?
Hello! I'm making a Sliding GUI Text that will be synced with my website.
However, the problem is, is that obviously because when there is a lot of text, the text is positioned somewhere else or it cuts off part of it. Is there a way to fix that?
Currently I have this:
03 | function explode(str, separator, withpattern) |
04 | if separator = = "" then |
07 | ret [ i ] = string.sub(str,i,i) |
12 | local index,lastPosition = 1 , 1 |
13 | if not withpattern then separator = string.gsub( separator, "[%-%^%$%(%)%%%.%[%]%*%+%?]" , "%%%1" ) end |
14 | for startPosition,endPosition in string.gmatch( str, "()" .. separator.. "()" ) do |
15 | ret [ index ] = string.sub( str, lastPosition, startPosition- 1 ) |
17 | lastPosition = endPosition |
19 | ret [ index ] = string.sub( str, lastPosition) |
29 | coroutine.resume(coroutine.create( function () |
32 | if sav ~ = prevsav then |
34 | local pages 2 = explode(sav, "(;break;)" ) |
36 | for i,_ in pairs (pages) do |
39 | for _,v in pairs (pages 2 ) do |
40 | local one,x = string.gsub(v, "%%player%%" ,script.Parent.Parent.Parent.Parent.Parent.Name) |
41 | local two,x = string.gsub(one, "%%place%%" ,place) |
42 | table.insert(pages,two) |
45 | for i,_ in pairs (pages) do |
48 | table.insert(pages,sav) |
57 | repeat wait() until #pages > = 1 |
58 | coroutine.resume(coroutine.create( function () |
59 | script.Parent.TextLabel.Size = UDim 2. new( 0 , 1 , 1 , 0 ) |
60 | script.Parent.TextLabel.Position = UDim 2. new( tonumber ( "1." ..string.len(script.Parent.TextLabel.Text).. "" )/ 2 , 0 , 0 , 0 ) |
61 | script.Parent.TextLabel.TextTransparency = i |
62 | script.Parent.TextLabel.TextStrokeTransparency = i |
64 | curpagen = curpagen + 1 |
65 | if curpagen > #pages then |
68 | curpage = pages [ curpagen ] |
69 | script.Parent.TextLabel.Text = curpage |
70 | script.Parent.TextLabel.Size = UDim 2. new( 0 , 1 , 1 , 0 ) |
71 | local ting = tonumber ( "1." ..(string.len(script.Parent.TextLabel.Text)/ 2 ).. "" ) |
73 | script.Parent.TextLabel.Position = UDim 2. new(ting, 0 , 0 , 0 ) |
74 | script.Parent.TextLabel:TweenPosition(UDim 2. new( 0 , 0 , 0 , 0 ), "Out" , "Linear" , 30 , false , nil ) |
75 | coroutine.resume(coroutine.create( function () |
77 | script.Parent.TextLabel.TextTransparency = i |
78 | script.Parent.TextLabel.TextStrokeTransparency = i |
84 | script.Parent.TextLabel.TextTransparency = i |
85 | script.Parent.TextLabel.TextStrokeTransparency = i |
Does anyone know something like a mathematical formulae for a sliding text GUI that is properly positioned?
Thank you.