FantasyGamer

Fantasy Btools

Jul 14th, 2017
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.07 KB | None | 0 0
  1. --------------------------------
  2. --\\ FantasyBtools-------------
  3. --\\ Created by fantasygamery-
  4. --\\ Require:Script to be a LocalScript, Have a BackPack.
  5. -----------------------------
  6.  
  7. --GUI---
  8. -- Objects
  9.  
  10. local GUI = Instance.new("ScreenGui")
  11. local Frame = Instance.new("Frame")
  12. local Change = Instance.new("TextButton")
  13. local X = Instance.new("TextBox")
  14. local Y = Instance.new("TextBox")
  15. local Z = Instance.new("TextBox")
  16.  
  17. -- Properties
  18.  
  19. GUI.Name = "Resize"
  20.  
  21. Frame.Parent = GUI
  22. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  23. Frame.Position = UDim2.new(1, -239, 0, 50)
  24. Frame.Size = UDim2.new(0, 195, 0, 58)
  25.  
  26. Change.Name = "Change"
  27. Change.Parent = Frame
  28. Change.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
  29. Change.BorderColor3 = Color3.new(1, 1, 1)
  30. Change.Position = UDim2.new(0, 0, 0, 29)
  31. Change.Size = UDim2.new(0, 195, 0, 29)
  32. Change.Font = Enum.Font.SourceSansBold
  33. Change.FontSize = Enum.FontSize.Size14
  34. Change.Text = "Change"
  35. Change.TextColor3 = Color3.new(1, 1, 1)
  36. Change.TextSize = 14
  37.  
  38. X.Name = "X"
  39. X.Parent = Frame
  40. X.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
  41. X.BorderColor3 = Color3.new(1, 1, 1)
  42. X.Size = UDim2.new(0, 65, 0, 29)
  43. X.Font = Enum.Font.Code
  44. X.FontSize = Enum.FontSize.Size14
  45. X.Text = "X"
  46. X.TextColor3 = Color3.new(1, 1, 1)
  47. X.TextSize = 14
  48. X.TextWrapped = true
  49.  
  50. Y.Name = "Y"
  51. Y.Parent = Frame
  52. Y.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
  53. Y.BorderColor3 = Color3.new(1, 1, 1)
  54. Y.Position = UDim2.new(0, 65, 0, 0)
  55. Y.Size = UDim2.new(0, 65, 0, 29)
  56. Y.Font = Enum.Font.Code
  57. Y.FontSize = Enum.FontSize.Size14
  58. Y.Text = "Y"
  59. Y.TextColor3 = Color3.new(1, 1, 1)
  60. Y.TextSize = 14
  61. Y.TextWrapped = true
  62.  
  63. Z.Name = "Z"
  64. Z.Parent = Frame
  65. Z.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
  66. Z.BorderColor3 = Color3.new(1, 1, 1)
  67. Z.Position = UDim2.new(0, 130, 0, 0)
  68. Z.Size = UDim2.new(0, 65, 0, 29)
  69. Z.Font = Enum.Font.Code
  70. Z.FontSize = Enum.FontSize.Size14
  71. Z.Text = "Z"
  72. Z.TextColor3 = Color3.new(1, 1, 1)
  73. Z.TextSize = 14
  74. Z.TextWrapped = true
  75. --------
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85. local services = {
  86. Players = game:GetService('Players');
  87. Run = game:GetService('RunService')
  88. }
  89. local adding_part = false
  90. local removing_part = false
  91. local resizing_part = false
  92. local mousePressing = false
  93. --[[script.Parent.Parent = script.Parent.Parent]]
  94. local LocalPlayer = services.Players.LocalPlayer
  95. local ToolFolder = LocalPlayer:FindFirstChildOfClass'Backpack'
  96. local tools = {
  97. AddPart = Instance.new('HopperBin',ToolFolder);
  98. remove = Instance.new('HopperBin',ToolFolder);
  99. resize = Instance.new('HopperBin',ToolFolder);
  100.  
  101. }
  102.  
  103. tools.AddPart.Name = "Add part"
  104. tools.remove .Name = "Remove"
  105. tools.resize .Name = "Resize"
  106. --[[
  107. tools.AddPart.ToolTip = "FantasyBtools"
  108. tools.remove .ToolTip = "FantasyBtools"
  109. tools.resize .ToolTip = "FantasyBtools"
  110. ]]
  111. local player = {
  112. mouse = LocalPlayer:GetMouse();
  113. player = LocalPlayer;
  114. character = LocalPlayer.Character;
  115. playergui = LocalPlayer:FindFirstChildOfClass'PlayerGui'
  116. }
  117. --
  118. --for _,tool in pairs(tools) do
  119. --tool.Parent = ToolFolder.Parent
  120. --end
  121.  
  122.  
  123.  
  124. tools.AddPart.Selected:Connect(function()
  125. adding_part = true
  126. end)
  127.  
  128. tools.AddPart.Deselected:Connect(function()
  129. adding_part = false
  130. end)
  131.  
  132. tools.resize.Selected:Connect(function()
  133. resizing_part = true
  134. end)
  135.  
  136. tools.resize.Deselected:Connect(function()
  137. resizing_part = false
  138. if player.playergui:FindFirstChild'Resize' then
  139. player.playergui:FindFirstChild'Resize':Destroy()
  140. end
  141. end)
  142.  
  143. tools.remove.Selected:Connect(function()
  144. removing_part = true
  145. end)
  146.  
  147. tools.remove.Deselected:Connect(function()
  148. removing_part = false
  149. end)
  150.  
  151. local backup = nil
  152. local keyName = 'ModelFantasyBTOOLS['.. player.player.Name ..']'
  153. local m = Instance.new('Model')
  154. m.Parent = workspace
  155. m.Name = keyName
  156. workspace.ChildRemoved:Connect(function(mm)
  157. local abcd = mm:Clone()
  158. if mm.ClassName == 'Model' then
  159. if mm.Name == keyName then
  160. if backup == nil then
  161. m = Instance.new('Model',workspace)
  162. m.Name = keyName
  163. else
  164. backup:Clone().Parent = workspace
  165. end
  166. end
  167.  
  168. end
  169. end)
  170.  
  171. --SelectionBox--
  172. local select_box_keyName = "FantasyBToolsAlphaSelectBox"
  173. local select_box = Instance.new('SelectionBox',m)
  174. select_box.Name = select_box_keyName
  175. m.ChildRemoved:Connect(function(s)
  176. if s.Name == select_box_keyName then
  177. select_box = Instance.new('SelectionBox',m)
  178. select_box.Name = select_box_keyName
  179. end
  180. end)
  181. ----------------
  182.  
  183.  
  184. player.mouse.Button1Down:Connect(function()
  185. --print('Down')
  186. mousePressing = true
  187. if adding_part then
  188. print('Adding part...')
  189. local p = Instance.new('Part',workspace)
  190. p.Anchored = true
  191. p.Parent = m
  192. select_box.Adornee = p
  193. repeat wait()
  194. if player.mouse.Target ~= p then
  195. p.CFrame = CFrame.new(math.floor(player.player:GetMouse().Hit.p.x),player.player:GetMouse().Hit.p.y+.6,math.floor(player.player:GetMouse().Hit.p.z))
  196. end
  197. until not mousePressing
  198.  
  199. backup = m:Clone()
  200. select_box.Adornee = nil
  201. --REMOVE--
  202. elseif removing_part then
  203. if player.mouse.Target ~= nil then
  204. if player.mouse.Target.Parent.Name == keyName then
  205.  
  206. player.mouse.Target:Destroy()
  207. select_box.Adornee = nil
  208. end
  209. end
  210. ----------
  211. --RESIZE--
  212. elseif resizing_part then
  213. if player.mouse.Target ~= nil then
  214. if player.mouse.Target.Parent.Name == keyName then
  215.  
  216. local obj = player.mouse.Target
  217. local s
  218. if player.playergui:FindFirstChild'Resize' then
  219. s = player.playergui:FindFirstChild'Resize'
  220. else
  221. s = GUI:Clone()
  222. end
  223.  
  224. local x,y,z = s.Frame.X,s.Frame.Y,s.Frame.Z
  225. local open_pos = UDim2.new(1,-239,0,50)
  226. s.Frame.Position = UDim2.new(1,0,0,50)
  227. x.Text = obj.Size.X
  228. y.Text = obj.Size.Y
  229. z.Text = obj.Size.Z
  230. s.Parent = player.playergui
  231. s.Frame:TweenPosition(UDim2.new(open_pos),'Out','Quad',1,true)
  232. select_box.Adornee = obj
  233. local button = s.Frame.Change
  234. button.MouseButton1Down:Connect(function()
  235. select_box.Adornee = nil
  236. obj.Size = Vector3.new(tonumber(x.Text),tonumber(y.Text),tonumber(z.Text))
  237. s.Frame:TweenPosition(UDim2.new(1,0,0,50),'Out','Quad',1,true)
  238. wait(1)
  239. s:Destroy()
  240. end)
  241.  
  242. end
  243. end
  244.  
  245. ----------
  246. end
  247. end)
  248.  
  249. player.mouse.Button1Up:Connect(function()
  250. mousePressing = false
  251. end)
Advertisement
Add Comment
Please, Sign In to add comment