Advertisement
Dodikman

sosat

Jul 5th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.10 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2.  
  3. function smooth_show(object, speed, size)
  4. local actual_size = size
  5. object.Size = UDim2.new(0.05, 0, 0.05, 0)
  6. object.Visible = true
  7. if object:FindFirstChild('shrinking') then
  8. return
  9. end
  10. for i = 0.01 * speed, actual_size.X.Scale, 0.01 * speed do
  11. object.Size = object.Size + UDim2.new(0.01 * speed, 0, 0, 0)
  12. wait()
  13. end
  14. for i = 0.01 * speed, actual_size.Y.Scale, 0.01 * speed do
  15. object.Size = object.Size + UDim2.new(0, 0, 0.01 * speed, 0)
  16. wait()
  17. end
  18. end
  19.  
  20. function smooth_shrink(object, speed)
  21. local actual_size = object.Size
  22. local shrinking = Instance.new('IntValue')
  23. shrinking.Name = 'shrinking'
  24. shrinking.Parent = object
  25. for i = actual_size.X.Scale, 0.01, -0.01 do
  26. if object.Size.X.Scale - 0.01 * speed < 0 then
  27. if object.Size.X.Scale - 0.01 < 0 then
  28. break
  29. else
  30. object.Size = object.Size - UDim2.new(0.01, 0, 0, 0)
  31. end
  32. else
  33. object.Size = object.Size - UDim2.new(0.01 * speed, 0, 0, 0)
  34. end
  35. wait()
  36. end
  37. for i = actual_size.Y.Scale, 0.01, -0.01 * speed do
  38. if object.Size.Y.Scale - 0.01 * speed < 0 then
  39. if object.Size.Y.Scale - 0.01 < 0 then
  40. break
  41. else
  42. object.Size = object.Size - UDim2.new(0, 0, 0.01, 0)
  43. end
  44. else
  45. object.Size = object.Size - UDim2.new(0, 0, 0.01 * speed, 0)
  46. end
  47. wait()
  48. end
  49. object.Visible = false
  50. shrinking:Remove()
  51. end
  52.  
  53. function check_table(item, tablee)
  54. for _, v in pairs(tablee) do
  55. if v == item then
  56. return true
  57. end
  58. end
  59. return false
  60. end
  61.  
  62. local current_working = {}
  63. function show_text(object, text, speed)
  64. if object:FindFirstChild('showing') then
  65. return
  66. end
  67. local showing = Instance.new('IntValue')
  68. showing.Name = 'showing'
  69. showing.Parent = object
  70. object.Text = ''
  71. for i = 1, #text, 1 do
  72. if object.Visible == false then object.Text = ''; break end
  73. object.Text = object.Text .. string.sub(text, i, i)
  74. wait(speed)
  75. end
  76. showing:Remove()
  77. end
  78.  
  79. function confirm_options(object, options)
  80. for k, v in pairs(options) do
  81. object[k] = v
  82. end
  83. end
  84.  
  85. function decorate_button(object, options)
  86. local current_background = object.BackgroundColor3
  87. local current_text = object.TextColor3
  88. object.MouseEnter:Connect(function()
  89. object.BackgroundColor3 = options['Enter']['Background']
  90. object.TextColor3 = options['Enter']['Text']
  91. end)
  92. object.MouseLeave:Connect(function()
  93. object.BackgroundColor3 = current_background
  94. object.TextColor3 = current_text
  95. end)
  96. end
  97.  
  98. local gui = Instance.new('ScreenGui')
  99. gui.ResetOnSpawn = false
  100. gui.Parent = player.PlayerGui
  101.  
  102. local main_frame = Instance.new('Frame')
  103. main_frame.Visible = false
  104. main_frame.Style = Enum.FrameStyle.DropShadow
  105. main_frame.Size = UDim2.new(0.125, 0, 0.25, 0)
  106. main_frame.Position = UDim2.new(0, 0, 0.5, 0)
  107. main_frame.Parent = gui
  108.  
  109. smooth_show(main_frame, 1, main_frame.Size)
  110.  
  111. local caption = Instance.new('TextLabel')
  112. caption.Size = UDim2.new(1, 0, 0.125, 0)
  113. caption.BackgroundColor3 = Color3.new(0, 0, 0)
  114. caption.BackgroundTransparency = 0.5
  115. caption.TextColor3 = Color3.new(200, 0, 0)
  116. caption.TextSize = 18
  117. caption.Font = Enum.Font.Fantasy
  118. caption.Text = ""
  119. caption.Parent = main_frame
  120. show_text(caption, "Sarnaif'S GUI", 0.01)
  121.  
  122. local mf_standard_button = {
  123. ['Size'] = UDim2.new(1, 0, 0.3, 0),
  124. ['BackgroundColor3'] = Color3.new(0, 0, 0),
  125. ['BackgroundTransparency'] = 0.5,
  126. ['TextColor3'] = Color3.new(0, 200, 200),
  127. ['TextSize'] = 18,
  128. ['Font'] = Enum.Font.Fantasy,
  129. ['Parent'] = main_frame
  130. }
  131.  
  132. mf_standard_label = {
  133. ['Size'] = UDim2.new(2, 0, 0.29, 0),
  134. ['BackgroundColor3'] = Color3.new(0, 0, 0),
  135. ['BackgroundTransparency'] = 0.5,
  136. ['TextColor3'] = Color3.new(0, 200, 200),
  137. ['TextScaled'] = true,
  138. ['TextSize'] = 18,
  139. ['Font'] = Enum.Font.Fantasy,
  140. ['Parent'] = main_frame
  141. }
  142.  
  143. mf_standard_frame = {
  144. ['Style'] = Enum.FrameStyle.DropShadow,
  145. ['Size'] = UDim2.new(0.875, 0, 0.3, 0),
  146. ['Position'] = UDim2.new(0.16, 0, 0.5, 0),
  147. ['Parent'] = gui
  148. }
  149.  
  150. local misc = Instance.new('Frame')
  151. misc.Visible = false
  152. misc.Name = 'Misc'
  153. confirm_options(misc, mf_standard_frame)
  154.  
  155. local teleports = Instance.new('Frame')
  156. teleports.Visible = false
  157. teleports.Name = 'Teleports'
  158. confirm_options(teleports, mf_standard_frame)
  159.  
  160. local explorer = Instance.new('Frame')
  161. explorer.Visible = false
  162. explorer.Name = 'Explorer'
  163. confirm_options(explorer, mf_standard_frame)
  164.  
  165. local mf_buttons = {
  166. ['Part. Explorer'] = {
  167. ['Frame'] = explorer,
  168. ['Description'] = 'Displays a menu consisting of available Haki Books / Devil Fruits / Treasure Chests. You\'re able to teleport yourself to them / teleport them to you.'
  169. },
  170. ['Teleports'] = {
  171. ['Frame'] = teleports,
  172. ['Description'] = 'Shows the most important points of the game and makes you able to teleport to them.'
  173. },
  174. ['Misc'] = {
  175. ['Frame'] = misc,
  176. ['Description'] = 'Shows miscellaneous options.'
  177. }
  178. }
  179.  
  180. local mf_decorate = {
  181. ['Enter'] = {
  182. ['Background'] = Color3.new(0, 20, 20),
  183. ['Text'] = Color3.new(0, 180, 180)
  184. }
  185. }
  186.  
  187. for _, v in pairs({misc, teleports, explorer}) do
  188. local frame_caption = Instance.new('TextLabel')
  189. confirm_options(frame_caption, mf_standard_label)
  190. frame_caption.Position = UDim2.new(0, 0, 0, 0)
  191. frame_caption.Size = UDim2.new(0.45, 0, 0.125, 0)
  192. frame_caption.Text = v.Name
  193. frame_caption.Parent = v
  194. end
  195. --START
  196. -- Misc
  197.  
  198. --Teleports
  199.  
  200. --Explorer
  201.  
  202. -- END
  203. local opened = {false, nil}
  204.  
  205. local current_shift = 0.12
  206. for k, v in pairs(mf_buttons) do
  207. local mf_button = Instance.new('TextButton')
  208. local size = v['Frame'].Size
  209. confirm_options(mf_button, mf_standard_button)
  210. mf_button.Position = UDim2.new(0, 0, current_shift, 0)
  211. decorate_button(mf_button, mf_decorate)
  212. show_text(mf_button, k, 0.01)
  213. mf_button.MouseButton1Click:Connect(function()
  214. if opened[1] == false then
  215. smooth_show(v['Frame'], 10, size)
  216. opened[1] = true
  217. opened[2] = v['Frame']
  218. else
  219. if opened[2] == v['Frame'] then
  220. smooth_shrink(v['Frame'], 10)
  221. opened[1] = false
  222. opened[2] = nil
  223. else
  224. smooth_shrink(opened[2], 10)
  225. smooth_show(v['Frame'], 10, size)
  226. opened[2] = v['Frame']
  227. end
  228. end
  229. end)
  230. current_shift = current_shift + 0.29
  231. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement