paul216
|
  |
| Joined: 20 Jul 2008 |
| Total Posts: 231 |
|
|
| 27 Sep 2014 05:18 PM |
Pretty much what the title says. I'm trying to get a TextButton in my GUI to work so that way the intro bit of the GUI would close, but alas, it won't close despite me clicking on the TextButton. I don't really have much experience with scripting, let alone GUIs, so I hope someone here can help me with getting it to work. Sorry if my coding is . . . "messy," to say the least.
Code:
print('HUD is go.') function Start() Frame = Instance.new('Frame', script.Parent) Img = Instance.new('ImageLabel', Frame) Text = Instance.new('TextLabel', Frame) Button = Instance.new('TextButton', Frame) Frame.Size = UDim2.new(1, 0, 1, 0) Frame.Position = UDim2.new(0, 0, 0, 0) Frame.BackgroundColor3 = Color3.new(0,0,0) Frame.BorderColor3 = Color3.new(0,0,0) Frame.ZIndex = 1 Frame.BackgroundTransparency = 0
Img.BackgroundColor3 = Color3.new(0,0,0) Img.BackgroundTransparency = 0 Img.BorderColor3 = Color3.new(0,0,0) Img.BorderSizePixel = 1 Img.Image = 'rbxassetid://179308085' Img.Position = UDim2.new(.25, 0, .25, 0) Img.Size = UDim2.new(.5, 0, .5, 0) Img.ImageTransparency = 1 Img.ZIndex = 2 Text.Size = UDim2.new(1, 0, 1, 0) Text.Position = UDim2.new(0, 0, 0, 0) Text.BackgroundColor3 = Color3.new(0,0,0) Text.BorderColor3 = Color3.new(0,0,0) Text.TextColor3 = Color3.new(255,255,255) Text.ZIndex = 2 Text.BackgroundTransparency = 1 Text.TextTransparency = 1 Text.Font = 'ArialBold' Text.FontSize = 'Size18' Text.Text = [==[ Das Test Text ]==] Button.Size = UDim2.new(0, 100, 0, 50) Button.Position = UDim2.new(.5, -50, .8, 0) Button.TextColor3 = Color3.new(255,255,255) Button.ZIndex = 2 Button.Text = 'Continue' Button.Font = 'ArialBold' Button.FontSize = 'Size18' Button.Transparency = 1 Button.BorderColor3 = Color3.new(0, 0, 0) Button.BackgroundColor3 = Color3.new(0, 0, 0)
local Titlecard = game.Soundscape.Titlecard Titlecard:Play()
local i = 1 while i < 10 do i = i + .5 Img.ImageTransparency = Img.ImageTransparency - .05 wait(.05) end wait(3) while i <= 10 do i = i - .5 Img.ImageTransparency = Img.ImageTransparency + .05 Text.TextTransparency = Text.TextTransparency - .05 Button.Transparency = Button.Transparency - .05 Button.BorderColor3 = Color3.new(Button.BorderColor3.r + 12.75) wait(.05) end Button.MouseButton1Click:connect(function(Button) print('IntroCam func. fired.') Img:Destroy() Button:Destroy() local i = 1 while i <= 10 do i = i + .5 Text.TextTransparency = Text.TextTransparency + .05 Frame.BackgroundTransparency = Frame.BackgroundTransparency + .05 end Text:Destroy() Frame:Destroy() end) end game.Players.PlayerAdded:connect (Start())
for _, player in pairs(game.Players:GetPlayers()) do Start() end |
|
|
| Report Abuse |
|
paul216
|
  |
| Joined: 20 Jul 2008 |
| Total Posts: 231 |
|
| |