Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------
- --\\ FantasyBtools-------------
- --\\ Created by fantasygamery-
- --\\ Require:Script to be a LocalScript, Have a BackPack.
- -----------------------------
- --GUI---
- -- Objects
- local GUI = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local Change = Instance.new("TextButton")
- local X = Instance.new("TextBox")
- local Y = Instance.new("TextBox")
- local Z = Instance.new("TextBox")
- -- Properties
- GUI.Name = "Resize"
- Frame.Parent = GUI
- Frame.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame.Position = UDim2.new(1, -239, 0, 50)
- Frame.Size = UDim2.new(0, 195, 0, 58)
- Change.Name = "Change"
- Change.Parent = Frame
- Change.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
- Change.BorderColor3 = Color3.new(1, 1, 1)
- Change.Position = UDim2.new(0, 0, 0, 29)
- Change.Size = UDim2.new(0, 195, 0, 29)
- Change.Font = Enum.Font.SourceSansBold
- Change.FontSize = Enum.FontSize.Size14
- Change.Text = "Change"
- Change.TextColor3 = Color3.new(1, 1, 1)
- Change.TextSize = 14
- X.Name = "X"
- X.Parent = Frame
- X.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
- X.BorderColor3 = Color3.new(1, 1, 1)
- X.Size = UDim2.new(0, 65, 0, 29)
- X.Font = Enum.Font.Code
- X.FontSize = Enum.FontSize.Size14
- X.Text = "X"
- X.TextColor3 = Color3.new(1, 1, 1)
- X.TextSize = 14
- X.TextWrapped = true
- Y.Name = "Y"
- Y.Parent = Frame
- Y.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
- Y.BorderColor3 = Color3.new(1, 1, 1)
- Y.Position = UDim2.new(0, 65, 0, 0)
- Y.Size = UDim2.new(0, 65, 0, 29)
- Y.Font = Enum.Font.Code
- Y.FontSize = Enum.FontSize.Size14
- Y.Text = "Y"
- Y.TextColor3 = Color3.new(1, 1, 1)
- Y.TextSize = 14
- Y.TextWrapped = true
- Z.Name = "Z"
- Z.Parent = Frame
- Z.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
- Z.BorderColor3 = Color3.new(1, 1, 1)
- Z.Position = UDim2.new(0, 130, 0, 0)
- Z.Size = UDim2.new(0, 65, 0, 29)
- Z.Font = Enum.Font.Code
- Z.FontSize = Enum.FontSize.Size14
- Z.Text = "Z"
- Z.TextColor3 = Color3.new(1, 1, 1)
- Z.TextSize = 14
- Z.TextWrapped = true
- --------
- local services = {
- Players = game:GetService('Players');
- Run = game:GetService('RunService')
- }
- local adding_part = false
- local removing_part = false
- local resizing_part = false
- local mousePressing = false
- --[[script.Parent.Parent = script.Parent.Parent]]
- local LocalPlayer = services.Players.LocalPlayer
- local ToolFolder = LocalPlayer:FindFirstChildOfClass'Backpack'
- local tools = {
- AddPart = Instance.new('HopperBin',ToolFolder);
- remove = Instance.new('HopperBin',ToolFolder);
- resize = Instance.new('HopperBin',ToolFolder);
- }
- tools.AddPart.Name = "Add part"
- tools.remove .Name = "Remove"
- tools.resize .Name = "Resize"
- --[[
- tools.AddPart.ToolTip = "FantasyBtools"
- tools.remove .ToolTip = "FantasyBtools"
- tools.resize .ToolTip = "FantasyBtools"
- ]]
- local player = {
- mouse = LocalPlayer:GetMouse();
- player = LocalPlayer;
- character = LocalPlayer.Character;
- playergui = LocalPlayer:FindFirstChildOfClass'PlayerGui'
- }
- --
- --for _,tool in pairs(tools) do
- --tool.Parent = ToolFolder.Parent
- --end
- tools.AddPart.Selected:Connect(function()
- adding_part = true
- end)
- tools.AddPart.Deselected:Connect(function()
- adding_part = false
- end)
- tools.resize.Selected:Connect(function()
- resizing_part = true
- end)
- tools.resize.Deselected:Connect(function()
- resizing_part = false
- if player.playergui:FindFirstChild'Resize' then
- player.playergui:FindFirstChild'Resize':Destroy()
- end
- end)
- tools.remove.Selected:Connect(function()
- removing_part = true
- end)
- tools.remove.Deselected:Connect(function()
- removing_part = false
- end)
- local backup = nil
- local keyName = 'ModelFantasyBTOOLS['.. player.player.Name ..']'
- local m = Instance.new('Model')
- m.Parent = workspace
- m.Name = keyName
- workspace.ChildRemoved:Connect(function(mm)
- local abcd = mm:Clone()
- if mm.ClassName == 'Model' then
- if mm.Name == keyName then
- if backup == nil then
- m = Instance.new('Model',workspace)
- m.Name = keyName
- else
- backup:Clone().Parent = workspace
- end
- end
- end
- end)
- --SelectionBox--
- local select_box_keyName = "FantasyBToolsAlphaSelectBox"
- local select_box = Instance.new('SelectionBox',m)
- select_box.Name = select_box_keyName
- m.ChildRemoved:Connect(function(s)
- if s.Name == select_box_keyName then
- select_box = Instance.new('SelectionBox',m)
- select_box.Name = select_box_keyName
- end
- end)
- ----------------
- player.mouse.Button1Down:Connect(function()
- --print('Down')
- mousePressing = true
- if adding_part then
- print('Adding part...')
- local p = Instance.new('Part',workspace)
- p.Anchored = true
- p.Parent = m
- select_box.Adornee = p
- repeat wait()
- if player.mouse.Target ~= p then
- 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))
- end
- until not mousePressing
- backup = m:Clone()
- select_box.Adornee = nil
- --REMOVE--
- elseif removing_part then
- if player.mouse.Target ~= nil then
- if player.mouse.Target.Parent.Name == keyName then
- player.mouse.Target:Destroy()
- select_box.Adornee = nil
- end
- end
- ----------
- --RESIZE--
- elseif resizing_part then
- if player.mouse.Target ~= nil then
- if player.mouse.Target.Parent.Name == keyName then
- local obj = player.mouse.Target
- local s
- if player.playergui:FindFirstChild'Resize' then
- s = player.playergui:FindFirstChild'Resize'
- else
- s = GUI:Clone()
- end
- local x,y,z = s.Frame.X,s.Frame.Y,s.Frame.Z
- local open_pos = UDim2.new(1,-239,0,50)
- s.Frame.Position = UDim2.new(1,0,0,50)
- x.Text = obj.Size.X
- y.Text = obj.Size.Y
- z.Text = obj.Size.Z
- s.Parent = player.playergui
- s.Frame:TweenPosition(UDim2.new(open_pos),'Out','Quad',1,true)
- select_box.Adornee = obj
- local button = s.Frame.Change
- button.MouseButton1Down:Connect(function()
- select_box.Adornee = nil
- obj.Size = Vector3.new(tonumber(x.Text),tonumber(y.Text),tonumber(z.Text))
- s.Frame:TweenPosition(UDim2.new(1,0,0,50),'Out','Quad',1,true)
- wait(1)
- s:Destroy()
- end)
- end
- end
- ----------
- end
- end)
- player.mouse.Button1Up:Connect(function()
- mousePressing = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment