Advertisement
Dodikman

Steve's One Piece GUI

Jul 3rd, 2019
9,844
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.27 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2.  
  3. local gui = Instance.new('ScreenGui')
  4. gui.Parent = plr.PlayerGui
  5. gui.ResetOnSpawn = false
  6.  
  7. local frame = Instance.new('Frame')
  8. frame.Parent = gui
  9. frame.Style = Enum.FrameStyle.DropShadow
  10. frame.Size = UDim2.new(1, 0, 0.125, 0)
  11. frame.Position = UDim2.new(0, 0, 0.675, 0)
  12.  
  13. local close_button = Instance.new('TextButton')
  14. close_button.Parent = frame
  15. close_button.Style = Enum.ButtonStyle.RobloxButtonDefault
  16. close_button.TextColor3 = Color3.new(255, 0, 0)
  17. close_button.TextScaled = true
  18. close_button.Text = '<'
  19. close_button.Size = UDim2.new(0.02, 0, 1, 0)
  20. close_button.Position = UDim2.new(0.98, 0, 0, 0)
  21.  
  22.  
  23.  
  24. local current = 0
  25. close_button.MouseButton1Click:Connect(function()
  26. if current == 0 then
  27. frame.Position = UDim2.new(-0.97, 0, 0.675, 0)
  28. close_button.Text = '>'
  29. current = 1
  30. else
  31. frame.Position = UDim2.new(0, 0, 0.675, 0)
  32. close_button.Text = '<'
  33. current = 0
  34. end
  35. end)
  36.  
  37. function check_for_tools()
  38. local to_return = {}
  39. for _, v in pairs(game.Workspace:GetChildren()) do
  40. if v.ClassName == 'Tool' and v:FindFirstChild('Handle') then
  41. to_return[#to_return + 1] = v
  42. end
  43. end
  44. return to_return
  45. end
  46.  
  47. local cfr_button = Instance.new('TextButton')
  48. cfr_button.Parent = frame
  49. cfr_button.Style = Enum.ButtonStyle.RobloxButtonDefault
  50. cfr_button.Size = UDim2.new(0.125, 0, 0.45, 0)
  51. cfr_button.TextColor3 = Color3.new(255, 0, 0)
  52. cfr_button.Text = 'Check for tools.'
  53.  
  54. local whitelist = {cfr_button}
  55.  
  56. function check_if_in(item, tablee)
  57. for _, v in pairs(tablee) do
  58. if v == item then
  59. return true
  60. end
  61. end
  62. return false
  63. end
  64.  
  65. cfr_button.MouseButton1Click:Connect(function()
  66. for _, v in pairs(frame:GetChildren()) do
  67. if not check_if_in(v, whitelist) then
  68. v:Remove()
  69. end
  70. end
  71. local current_tools = check_for_tools()
  72. local current_shift = 0
  73. for k, v in pairs(current_tools) do
  74. local button = cfr_button:Clone()
  75. button.Parent = frame
  76. button.Position = UDim2.new(current_shift, 0, -0.5, 0)
  77. button.Text = current_tools[k].Name
  78. button.MouseButton1Click:Connect(function()
  79. current_tools[k].Handle.Position = plr.Character.Head.Position
  80. button:Remove()
  81. end)
  82. current_shift = current_shift + 0.125
  83. end
  84. end)
  85.  
  86. local limit = 500
  87.  
  88. function linear_move(where, amount)
  89. local char = plr.Character
  90. local root = char.HumanoidRootPart.Position
  91. if where == 'X' then
  92. char:MoveTo(Vector3.new(amount, root.Y, root.Z))
  93. end
  94. if where == 'Y' then
  95. char:MoveTo(Vector3.new(root.X, amount, root.Z))
  96. end
  97. if where == 'Z' then
  98. char:MoveTo(Vector3.new(root.X, root.Y, amount))
  99. end
  100. local diff = math.abs(math.abs(root[where]) - math.abs(amount))
  101. end
  102.  
  103. function safe_move(where, amount)
  104. local char = plr.Character
  105. local root = char.HumanoidRootPart
  106. local temp_pos = root.Position
  107. local mult = 1
  108. if amount <= 0 then
  109. mult = -1
  110. end
  111. local diff = math.abs(math.abs(temp_pos[where]) - math.abs(amount))
  112. if diff <= limit then
  113. linear_move(where, amount)
  114. else
  115. local count = 1
  116. while diff > limit do
  117. temp_pos = root.Position
  118. local group = Instance.new('Model')
  119. group.Parent = game.Workspace
  120. local part_one = Instance.new('Part')
  121. part_one.Size = Vector3.new(4, 1, 4)
  122. part_one.Position = temp_pos + Vector3.new(0, -2, 0)
  123. part_one.Anchored = true
  124. part_one.Parent = group
  125. local part_two = part_one:Clone()
  126. part_two.BrickColor = BrickColor.Green()
  127. part_two.Position = part_two.Position + Vector3.new(0, 0, -4)
  128. part_two.Parent = group
  129. local working = true
  130. part_two.Touched:Connect(function(hit)
  131. if hit.Parent:FindFirstChild('Humanoid') then
  132. working = false
  133. end
  134. end)
  135. while working do
  136. wait()
  137. end
  138. group:Remove()
  139. linear_move(where, limit * mult * count)
  140. diff = math.abs(math.abs(temp_pos[where]) - math.abs(amount))
  141. count = count + 1
  142. end
  143. linear_move(where, amount)
  144. end
  145. end
  146.  
  147. function move_to(location)
  148. local char = plr.Character
  149. local root = char.HumanoidRootPart
  150. safe_move('X', location.X)
  151. safe_move('Y', location.Y)
  152. safe_move('Z', location.Z)
  153. end
  154.  
  155. local teleports = {
  156. ['starter island'] = Vector3.new(39, 5, 494),
  157. ['orange town'] = Vector3.new(-4216, 6, 1331)
  158. }
  159.  
  160. local teleports_frame = Instance.new('Frame')
  161. teleports_frame.Parent = frame
  162. teleports_frame.Size = UDim2.new(0.5, 0, 1, 0)
  163. teleports_frame.Style = Enum.FrameStyle.DropShadow
  164. teleports_frame.Position = UDim2.new(0.48, 0, 0, 0)
  165.  
  166. whitelist[#whitelist + 1] = teleports_frame
  167.  
  168. local current = UDim2.new(0, 0, 0, 0)
  169.  
  170. for k, v in pairs(teleports) do
  171. local button = Instance.new('TextButton')
  172. button.Parent = teleports_frame
  173. button.Size = UDim2.new(0.125, 0, 0.45, 0)
  174. button.Position = current
  175. button.Style = Enum.ButtonStyle.RobloxButtonDefault
  176. button.Text = k
  177. button.TextScaled = true
  178. button.TextColor3 = Color3.new(255, 0, 0)
  179. button.MouseButton1Click:Connect(function()
  180. move_to(v)
  181. end)
  182. current = UDim2.new(current.X.Scale + 0.125, 0, 0, 0)
  183. if current.X.Scale >= 1 then
  184. current = UDim2.new(0, 0, current.Y.Scale + 0.5, 0)
  185. end
  186. end
  187.  
  188. local teleport_input = Instance.new('TextBox')
  189. teleport_input.BackgroundColor3 = Color3.new(0, 0, 0)
  190. teleport_input.TextScaled = true
  191. teleport_input.Size = UDim2.new(0.125, 0, 0.25, 0)
  192. teleport_input.TextColor3 = Color3.new(255, 0, 0)
  193. teleport_input.Position = UDim2.new(0.35, 0, 0, 0)
  194. teleport_input.Parent = frame
  195. teleport_input.Text = ''
  196.  
  197. whitelist[#whitelist + 1] = teleport_input
  198. whitelist[#whitelist + 1] = close_button
  199.  
  200. local teleport_confirm = Instance.new('TextButton')
  201. teleport_confirm.Style = Enum.ButtonStyle.RobloxButtonDefault
  202. teleport_confirm.TextScaled = true
  203. teleport_confirm.Size = UDim2.new(0.125, 0, 0.25, 0)
  204. teleport_confirm.TextColor3 = Color3.new(255, 0, 0)
  205. teleport_confirm.Position = UDim2.new(0.35, 0, 0.3, 0)
  206. teleport_confirm.Parent = frame
  207. teleport_confirm.Text = 'TP'
  208.  
  209. whitelist[#whitelist + 1] = teleport_confirm
  210.  
  211. teleport_confirm.MouseButton1Click:Connect(function()
  212. local raw = teleport_input.Text
  213. local cord_x = string.sub(raw, 1, string.find(raw, ';') - 1)
  214. local wth_x = string.sub(raw, string.find(raw, ';') + 1)
  215. local cord_y = string.sub(wth_x, 1, string.find(wth_x, ';') - 1)
  216. local cord_z = string.sub(wth_x, string.find(wth_x, ';') + 1)
  217. local cords = Vector3.new(cord_x, cord_y, cord_z)
  218. move_to(cords)
  219. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement