Advertisement
advancedev

gui in script

Jan 24th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.65 KB | None | 0 0
  1.  
  2. local showWhenCharacterRespawns = true -- If set to true, then the welcome GUI will show up whenever a person respawns
  3.  
  4. function createWGUI(player)
  5.  
  6. while (not player.DataReady and player:FindFirstChild("PlayerGui") == nil) do
  7. wait()
  8. end
  9.  
  10. local pgui = player.PlayerGui
  11.  
  12. local textColorR = 230 -- Change only if you know about Color3 values
  13. local textColorG = 230 -- Change only if you know about Color3 values
  14. local textColorB = 230 -- Change only if you know about Color3 values
  15.  
  16. local textTransparency = 0.5 -- Select a value between 0 and 1
  17.  
  18. local leftToRight = false -- if false then it will go from right to left
  19.  
  20. local text = "Scirpt builder!" -- Place any text you desire here; this will be shown on the welcome GUI
  21.  
  22. local font = "ArialBold" -- You can change this to any of the following: Arial, ArialBold, Legacy
  23.  
  24. local fontSize = "Size24" -- You can change this to any of the following: Size8, Size9, Size10, Size11, Size12, Size18, Size24, Size36, Size48
  25.  
  26. local scaled = false -- If this is set to true, then the font size chosen will be useless because it'll adjust the size of the font to fit the frame
  27.  
  28. local primaryFrameColorR = 255 -- Change only if you know about Color3 values
  29. local primaryFrameColorG = 0 -- Change only if you know about Color3 values
  30. local primaryFrameColorB = 0 -- Change only if you know about Color3 values
  31.  
  32. local secondaryFrameColorR = 100 -- Change only if you know about Color3 values
  33. local secondaryFrameColorG = 100 -- Change only if you know about Color3 values
  34. local secondaryFrameColorB = 100 -- Change only if you know about Color3 values
  35.  
  36. local primaryFrameTransparency = 0.4 -- Select a value between 0 and 1
  37.  
  38. local secondaryFrameTransparency = 0.5 -- Select a value between 0 and 1
  39.  
  40. local totaltime = 5 -- Change this to how long you want the GUI to take to get across the screen
  41.  
  42. local intervaltime = 5 -- Change this to how long you want the GUI to wait until it goes across the screen again
  43.  
  44. local numberofTimes = 3 -- Change this to how many times you want the GUI to go from left to right across the screen before disappearing
  45. local sgui = Instance.new("ScreenGui", pgui)
  46. sgui.Name = "WelcomeGUI"
  47. local mainf = Instance.new("Frame", sgui)
  48. mainf.Name = "Main"
  49. mainf.Size = UDim2.new(1, 0, 0.05, 0)
  50. mainf.Position = UDim2.new(-1, 0, 0.05, 0)
  51. mainf.BorderSizePixel = 0
  52. mainf.BackgroundTransparency = primaryFrameTransparency
  53. mainf.BackgroundColor3 = Color3.new(primaryFrameColorR/255, primaryFrameColorG/255, primaryFrameColorB/255)
  54. local if1 = Instance.new("Frame", mainf)
  55. if1.Size = UDim2.new(1, 0, 0.2, 0)
  56. if1.Position = UDim2.new(0, 0, -0.2, 0)
  57. if1.BackgroundTransparency = secondaryFrameTransparency
  58. if1.BackgroundColor3 = Color3.new(secondaryFrameColorR/255,secondaryFrameColorG/255, secondaryFrameColorB/255)
  59. if1.BorderSizePixel = 0
  60. if1.Name = "detailF1"
  61. local if2 = Instance.new("Frame", mainf)
  62. if2.Size = UDim2.new(1, 0, 0.2, 0)
  63. if2.Position = UDim2.new(0, 0, 1, 0)
  64. if2.BackgroundTransparency = secondaryFrameTransparency
  65. if2.BackgroundColor3 = Color3.new(secondaryFrameColorR/255,secondaryFrameColorG/255, secondaryFrameColorB/255)
  66. if2.BorderSizePixel = 0
  67. if2.Name = "detailF2"
  68. local textl = Instance.new("TextLabel", mainf)
  69. textl.Size = UDim2.new(1, 0, 1, 0)
  70. textl.TextColor3 = Color3.new(textColorR/255,textColorG/255, textColorB/255)
  71. textl.TextTransparency = textTransparency
  72. textl.BackgroundTransparency = 1
  73. textl.Text = text
  74. textl.Font = font
  75. textl.FontSize = fontSize
  76. if scaled then
  77. text.TextScaled = true
  78. end
  79. for i = 1, numberofTimes do
  80. if leftToRight then
  81. mainf.Position = UDim2.new(-1, 0, 0.05, 0)
  82. wait()
  83. mainf:TweenPosition(UDim2.new(1, 0, 0.05, 0), "Out", "Linear", totaltime, true)
  84. wait(totaltime)
  85. wait(intervaltime)
  86. else
  87. mainf.Position = UDim2.new(1, 0, 0.05, 0)
  88. wait()
  89. mainf:TweenPosition(UDim2.new(-1, 0, 0.05, 0), "Out", "Linear", totaltime, true)
  90. wait(totaltime)
  91. wait(intervaltime)
  92. end
  93. end
  94.  
  95. sgui:Destroy()
  96.  
  97. end
  98.  
  99. game.Players.PlayerAdded:connect(function(player)
  100. local coro = coroutine.create(createWGUI)
  101. coroutine.resume(coro, player)
  102. wait(10)
  103. player.CharacterAdded:connect(function(char)
  104. if showWhenCharacterRespawns then
  105. local coro2 = coroutine.create(createWGUI)
  106. coroutine.resume(coro2, player)
  107. end
  108. end)
  109. end)
  110.  
  111. for _,v in pairs(game.Players:GetChildren()) do
  112. local coro = coroutine.create(createWGUI)
  113. coroutine.resume(coro, v)
  114. v.CharacterAdded:connect(function(char)
  115. if showWhenCharacterRespawns then
  116. local coro2 = coroutine.create(createWGUI)
  117. coroutine.resume(coro2, v)
  118. end
  119. end)
  120. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement