Advertisement
BungoEntertainment

MorphUiNotRespawnable

Sep 20th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.97 KB | None | 0 0
  1. --Main Screen Gui
  2. local main = Instance.new("ScreenGui")
  3. main.Name = "Morphs"
  4.  
  5. --Setting up the gui
  6. local bg = Instance.new("Frame", main)
  7. bg.Name = "MainFrame"
  8. bg.Size = UDim2.new(0,400,0,250)
  9. bg.Position = UDim2.new(0.5, -200, 0.5, -125)
  10. bg.BackgroundColor3 = Color3.fromRGB(42, 55, 62)
  11. local catFrame = Instance.new("ScrollingFrame", bg)
  12. catFrame.Name = "CatScrollingFrame"
  13. catFrame.Size = UDim2.new(1,-20,1,-60)
  14. catFrame.Position = UDim2.new(0,10,0,50)
  15. catFrame.BackgroundColor3 = Color3.fromRGB(31, 40, 45)
  16. catFrame.CanvasSize = UDim2.new(0,0,15,0)
  17. local Template = Instance.new("Frame", bg)
  18. Template.Name = "Template"
  19. Template.Size = UDim2.new(1,-10,0, 65)
  20. Template.Position = UDim2.new(0,0,0,0)
  21. Template.BackgroundColor3 = Color3.fromRGB(31, 40, 45)
  22. Template.Visible = false
  23. local design = Instance.new("Frame", bg)
  24. design.Name = "design"
  25. design.Size = UDim2.new(1,0,0,1)
  26. design.Position = UDim2.new(0,0,0,0)
  27. design.BackgroundColor3 = Color3.fromRGB(255,255,255)
  28. local title = Instance.new("TextLabel", bg)
  29. title.Name = "Title"
  30. title.Text = "Morphs"
  31. title.Font = "SourceSansBold"
  32. title.Size = UDim2.new(1,0,0,40)
  33. title.BackgroundTransparency = 1
  34. title.TextColor3 = Color3.fromRGB(255,255,255)
  35. title.TextSize = 18
  36. title.TextXAlignment = "Center"
  37. title.TextYAlignment = "Center"
  38. local sf = Instance.new("ScrollingFrame", bg)
  39. sf.Name = "ScrollingFrame"
  40. sf.Position = UDim2.new(0,10,0,50)
  41. sf.Size = UDim2.new(1,-20,1,-60)
  42. sf.CanvasSize = UDim2.new(0,0,15,0)
  43. sf.BackgroundColor3 = Color3.fromRGB(31, 40, 45)
  44. sf.Visible = false
  45. sf.ZIndex = 1
  46. local sflayout = Instance.new("UIListLayout", sf)
  47. sflayout.FillDirection = "Vertical"
  48. sflayout.HorizontalAlignment = "Left"
  49. sflayout.SortOrder = "Name"
  50. sflayout.VerticalAlignment = "Top"
  51. sflayout.Padding = UDim.new(0,0)
  52.  
  53. --UI Styles
  54. local catFrameLayout = Instance.new("UIListLayout", catFrame)
  55. catFrameLayout.Padding = UDim.new(0,0)
  56. catFrameLayout.FillDirection = "Vertical"
  57. catFrameLayout.HorizontalAlignment = "Left"
  58. catFrameLayout.SortOrder = "Name"
  59. catFrameLayout.VerticalAlignment = "Top"
  60.  
  61. --Template Settings
  62. local button = Instance.new("TextButton", Template)
  63. button.Name = "TextButton"
  64. button.BackgroundTransparency = 1
  65. button.Size = UDim2.new(1,0,1,0)
  66. button.BackgroundColor3 = Color3.fromRGB(27, 42, 53)
  67. button.ZIndex = 3
  68. local imLab = Instance.new("ImageLabel", Template)
  69. imLab.Name = "ImageLabel"
  70. imLab.Size = UDim2.new(0,55,0,55)
  71. imLab.Position = UDim2.new(0,5,0.5,-27)
  72. imLab.ZIndex = 2
  73. imLab.Image = "rbxassetid://17767705"
  74. imLab.BackgroundTransparency = 1
  75. local lab1 = Instance.new("TextLabel", Template)
  76. lab1.Name = "ButtonName"
  77. lab1.Size = UDim2.new(1,-70,0,25)
  78. lab1.Position = UDim2.new(0,65,0,0)
  79. lab1.BackgroundTransparency = 1
  80. lab1.ZIndex = 2
  81. lab1.TextXAlignment = "Left"
  82. lab1.TextYAlignment = "Center"
  83. lab1.TextColor3 = Color3.fromRGB(255,255,255)
  84.  
  85. --Extras
  86. local decal = Instance.new("Decal", bg)
  87. decal.Texture = "rbxassetid://429379228"
  88.  
  89. --Open/Close Button
  90. local but2 = Instance.new("TextButton", main)
  91. but2.Name = "OpenClose"
  92. but2.Size = UDim2.new(0.037,0,0.021,0)
  93. but2.Position = UDim2.new(0.004,0,0.912,0)
  94. but2.Text = "Open"
  95. but2.BackgroundColor3 = Color3.fromRGB(136, 136, 136)
  96. but2.BackgroundTransparency = 0.5
  97.  
  98. --Close Button
  99. local cat = Instance.new("Frame", bg)
  100. cat.Name = "Categories"
  101. cat.Size = UDim2.new(0,40,0,40)
  102. cat.Position = UDim2.new(1,0,0.32,-80)
  103. cat.ZIndex = 2
  104. cat.BackgroundColor3 = Color3.fromRGB(42, 55, 62)
  105. local but = Instance.new("TextButton", cat)
  106. but.Name = "button"
  107. but.Size = UDim2.new(1,0,1,0)
  108. but.Position = UDim2.new(0,0,0,0)
  109. but.BackgroundTransparency = 1
  110. but.Text = ""
  111. button.ZIndex = 3
  112. local imlab1 = Instance.new("ImageLabel", cat)
  113. imlab1.Size = UDim2.new(1,-20,1,-20)
  114. imlab1.Position = UDim2.new(0,10,0,10)
  115. imlab1.BackgroundTransparency = 1
  116. imlab1.Image = "rbxassetid://713294902"
  117. imlab1.ZIndex = 2
  118. local des = Instance.new("Frame", cat)
  119. des.Name = "design"
  120. des.Size = UDim2.new(1,0,0,1)
  121. des.Position = UDim2.new(0,0,0,0)
  122. des.ZIndex = 5
  123.  
  124. --Confirm
  125. local con = Instance.new("Frame", bg)
  126. con.Name = "Confirm"
  127. con.BackgroundColor3 = Color3.fromRGB(42, 55, 62)
  128. con.Position = UDim2.new(0.5,-200,0.5,-125)
  129. con.Size = UDim2.new(0,400,0,250)
  130. con.ZIndex = 2
  131. con.Visible = false
  132. local yes = Instance.new("TextButton", con)
  133. yes.Name = "Yes"
  134. yes.Position = UDim2.new(0.2,0,0.6,0)
  135. yes.Size = UDim2.new(0.2,0,0.15,0)
  136. yes.BackgroundColor3 = Color3.fromRGB(0, 166, 0)
  137. yes.Font = "SourceSansBold"
  138. yes.TextSize = 22
  139. yes.TextXAlignment = "Center"
  140. yes.TextYAlignment = "Center"
  141. yes.Text = "Yes"
  142. yes.TextColor3 = Color3.fromRGB(255,255,255)
  143. yes.ZIndex = 3
  144. local no = Instance.new("TextButton", con)
  145. no.Name = "No"
  146. no.Position = UDim2.new(0.6,0,0.6,0)
  147. no.Size = UDim2.new(0.2,0,0.15,0)
  148. no.BackgroundColor3 = Color3.fromRGB(166, 0, 0)
  149. no.Font = "SourceSansBold"
  150. no.TextSize = 22
  151. no.TextXAlignment = "Center"
  152. no.TextYAlignment = "Center"
  153. no.ZIndex = 3
  154. no.Text = "No"
  155. local title2 = Instance.new("TextLabel", con)
  156. title2.Name = "Title"
  157. title2.BackgroundTransparency = 1
  158. title2.Position = UDim2.new(0,0,0.2,0)
  159. title2.Size = UDim2.new(1,0,0,40)
  160. title2.Text = "Are you sure you want to put the morph on?"
  161. title2.TextSize = 18
  162. title2.TextXAlignment = "Center"
  163. title2.TextYAlignment = "Center"
  164. title2.ZIndex = 3
  165.  
  166. --[[Below is the code just ignore it it is right from their morph scripts]]--
  167. local Player = game:GetService("Players").LocalPlayer
  168. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  169. local GUI = bg
  170. local Events = game.ReplicatedStorage:WaitForChild("Events")
  171. local DestroyEvent = Events:WaitForChild("DestroyEvent")
  172.  
  173. function CalculateCategories()
  174. local ScrollingFrame = GUI:WaitForChild("CatScrollingFrame")
  175. local Template = GUI:FindFirstChild("Template")
  176. for _,v in pairs(ScrollingFrame:GetChildren()) do
  177. if v.Name ~= "UIListLayout" then v:Destroy() end
  178. end
  179. for i,v in pairs(ReplicatedStorage.Morphs:GetChildren()) do
  180. local Decal = v:FindFirstChild("Decal")
  181. local NewCategory = Template:Clone()
  182. NewCategory.Parent = ScrollingFrame
  183. NewCategory.ImageLabel.Image = Decal.Texture
  184. NewCategory.Name = v.Name
  185. NewCategory.ButtonName.Text = v.Name
  186. NewCategory.Visible = true
  187.  
  188. local Button = NewCategory:FindFirstChild("TextButton")
  189. if Button then
  190. Button.MouseButton1Down:connect(function()
  191. ScrollingFrame.Visible = false
  192. local Category = v
  193. CalculateMorphs(Category)
  194. end)
  195. end
  196. end
  197. end
  198.  
  199. function CalculateMorphs(Category)
  200. local ScrollingFrame = GUI:FindFirstChild("ScrollingFrame")
  201. local Template = GUI:FindFirstChild("Template")
  202. for _,v in pairs(ScrollingFrame:GetChildren()) do
  203. if v.Name ~= "UIListLayout" then v:Destroy() end
  204. end
  205. ScrollingFrame.Visible = true
  206. for i,v in pairs(Category:GetChildren()) do
  207. if v:IsA("Folder") then
  208. if v:FindFirstChild("PlayerName") then
  209. local PlayerName = v:FindFirstChild("PlayerName")
  210. GenerateButton(v, Template, ScrollingFrame)
  211. elseif v:FindFirstChild("Rank") then
  212. GenerateButton(v, Template, ScrollingFrame)
  213. elseif v:FindFirstChild("GroupID") then
  214. GenerateButton(v, Template, ScrollingFrame)
  215. end
  216. end
  217. end
  218. end
  219.  
  220. function GenerateButton(v, Template, ScrollingFrame)
  221. local Decal = v.Parent:FindFirstChild("Decal")
  222. local NewButton = Template:Clone()
  223. if Decal then
  224. NewButton.ImageLabel.Image = Decal.Texture
  225. end
  226. NewButton.Parent = ScrollingFrame
  227. NewButton.Name = v.Name
  228. NewButton.ButtonName.Text = v.Name
  229. NewButton.Visible = true
  230.  
  231. local Button = NewButton:FindFirstChild("TextButton")
  232. if Button then
  233. Button.MouseButton1Down:connect(function()
  234. sf.Visible = false
  235. con.Visible = true
  236. con.No.MouseButton1Click:connect(function()
  237. con.Visible = false
  238. sf.Visible = true
  239. end)
  240. yes.MouseButton1Click:connect(function()
  241. Events:WaitForChild("EquipMorph"):FireServer(v, main, _G.Key)
  242. bg.Visible = false
  243. sf.Visible = false
  244. con.Visible = false
  245. catFrame.Visible = true
  246. but2.Text = "Open"
  247. open = false
  248. end)
  249. end)
  250. end
  251. end
  252.  
  253.  
  254. but.MouseButton1Down:connect(function()
  255. sf.Visible = false
  256. catFrame.Visible = true
  257. end)
  258.  
  259. local open = false
  260. but2.MouseButton1Down:connect(function()
  261. if open == true then
  262. open = false
  263. but2.Text = "Open"
  264. bg.Visible = false
  265. return
  266. elseif open == false then
  267. open = true
  268. but2.Text = "Close"
  269. bg.Visible = true
  270. return
  271. end
  272. wait(1)
  273. end)
  274.  
  275. main.Parent = game:GetService("Players").LocalPlayer.PlayerGui
  276. bg.Visible = false
  277. --main.Parent = game:GetService("CoreGui")
  278. CalculateCategories()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement