|
| 19 Oct 2015 08:20 PM |
Is there an easier way to code the transparency parts? It seems so inefficient and ugly. game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) local gui = Instance.new("ScreenGui", p.PlayerGui) local frame = Instance.new("Frame", gui) frame.Size = UDim2.new(1,0,1,0) frame.BackgroundColor = BrickColor.new("Really black") local label = Instance.new('TextLabel', frame) label.Size = UDim2.new(1,frame.AbsoluteSize/2,1,frame.AbsoluteSize/2) label.BackgroundTransparency = 1 label.FontSize = 'Size36' label.TextColor3 = Color3.new(255,255,255) label.Text = 'Are you awake?' wait(1.3) for i = 1,10 do label.TextTransparency = label.TextTransparency + .1 -- MAKE IT INVISIBLE wait(.1) end label.Text = 'Okay, good. I am NiL.' for i = 1,10 do label.TextTransparency = label.TextTransparency - .1 -- MAKE IT VISIBLE wait(.1) end for i = 1,10 do label.TextTransparency = label.TextTransparency + .1 -- INVISIBLE wait(.1) end label.Text = 'This, this game.' for i = 1,10 do label.TextTransparency = label.TextTransparency - .1 -- VISIBLE wait(.1) end for i = 1,10 do label.TextTransparency = label.TextTransparency + .1 -- INVISIBLE wait(.1) end label.Text = 'Is your adventure.' for i = 1,10 do label.TextTransparency = label.TextTransparency - .1 wait(.1) end local button = Instance.new('TextButton', frame) button:TweenPosition(UDim2.new(0,0,.8,0), 'Out', 'Quad', .7, false) button.Size = UDim2.new(1,50,.06,50) button.Text = 'Play' button.BackgroundTransparency = .3 button.FontSize = 'Size36' button.MouseButton1Down:connect(function() print('Clicked') wait(.2) gui:remove() end) while wait(.5) do button.BackgroundColor = BrickColor.Random() end end) end)
F3X Moderator / GFX Designer / Coder / Clothing Designer |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 08:33 PM |
Bump
F3X Moderator / GFX Designer / Coder / Clothing Designer |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Oct 2015 08:53 AM |
| You could put each statement inside a table and than the for loops for transparency could be part of a for loop through each table index |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2015 08:56 AM |
function ShowLabel(state, label) for i = 1,10 do label.TextTransparency = label.TextTransparency + state*.1 wait(.1) end end
ShowLabel(1, label) label.Text = 'Okay, good. I am NiL.' LabelEffect(-1, label) LabelEffect(1, label) label.Text = 'This, this game.' LabelEffect(-1, label) LabelEffect(1, label) label.Text = 'Is your adventure.' LabelEffect(-1, label) |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2015 08:57 AM |
*oops;
ShowLabel(1, label) label.Text = 'Okay, good. I am NiL.' ShowLabel(-1, label) ShowLabel(1, label) label.Text = 'This, this game.' ShowLabel(-1, label) ShowLabel(1, label) label.Text = 'Is your adventure.' ShowLabel(-1, label) |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 20 Oct 2015 09:02 AM |
or you could just put them both into one function
function ShowLabel(label) for i = 0,1, 0.05 do label.TextTransparency = label.TextTransparency + (i <= .5 and i*2 or 1-i*2) wait(.1) end label.Text = 'Are you awake?' end |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 20 Oct 2015 09:04 AM |
err, this
function ShowLabel(label, text) for i = 0,2,0.1 do label.TextTransparency = label.TextTransparency + (i <= 1 and i or 2-i) wait(.1) end label.Text = text end |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2015 09:04 AM |
| The first time he loops it it only goes visible |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 20 Oct 2015 09:09 AM |
then slap it all into one function give the function a parameter that determines how many times you want it to loop or something
there are a lot of ways to go about this, i'm just too lazy to put it into context |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2015 03:29 PM |
I'm still a noob scripter. q.q
F3X Moderator / GFX Designer / Coder / Clothing Designer |
|
|
| Report Abuse |
|
|