Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Designed and Coded by Kangerujack 2016
- --Revisioned 2018
- wait(2)
- ----------------------Local Variables----------------------------
- local Player = game.Players.LocalPlayer
- local Char = Player.Character
- local Mouse = Player:GetMouse()
- local RealCamera = workspace.CurrentCamera
- ---------------------------CLEAN UP------------------------------
- --RealCamera:ClearAllChildren()
- --Player.PlayerGui:ClearAllChildren()
- for _,v in pairs(Char:GetChildren()) do
- print("Checking: "..v.Name)
- if v:IsA("Part") or v:IsA("Humanoid") or v:IsA("Hat") then
- print("Destroying part: "..v.Name)
- v:Destroy()
- end
- end
- -----------------------------------------------------------------
- local SizeX = 3
- local SizeY = 3
- local SizeZ = 3
- local menuUp = false
- local ScreenGui = Instance.new("ScreenGui",Player.PlayerGui)
- local Actions = {"Destroy","Kill","BreakJoints","Distort","Anchor","Push","Freeze",
- "Clone","Build","Laser","Rekt","Weld"}
- local Action = "Destroy"
- local Selection = 1
- local Mode = "Model"--{"Part","Model"}
- table.sort(Actions)
- local GuiM = Instance.new("TextButton",ScreenGui)
- GuiM.Size = UDim2.new(0,250,0,50)
- GuiM.Position = UDim2.new(0.7,1,0.8,1) --0.95= 5
- GuiM.Text = "Action: Destroy, Model"
- GuiM.BackgroundColor = BrickColor.new("Really black")
- GuiM.Transparency = 0.3
- GuiM.TextColor = BrickColor.new("White")
- GuiM.MouseButton1Click:connect(function()
- if menuUp == true then return end --Don't do it
- menuUp = true
- local selectionGui = nil
- local selectionGuiMode = nil
- local ActionsGui = {}
- for i,v in pairs(Actions) do
- local gui = Instance.new("TextButton",ScreenGui)
- gui.Size = UDim2.new(0,125,0,25)
- gui.Position = GuiM.Position + UDim2.new(0,0,0,-25 * i)
- gui.Text = v
- gui.BackgroundColor = BrickColor.new("Really black")
- gui.Transparency = 0.3
- gui.TextColor = BrickColor.new("White")
- gui.MouseButton1Click:connect(function()
- if selectionGui == nil then
- gui.BackgroundColor = BrickColor.new("Really red")
- selectionGui = gui
- else
- selectionGui.BackgroundColor = BrickColor.new("Really black")
- gui.BackgroundColor = BrickColor.new("Really red")
- selectionGui = gui
- end
- end)
- table.insert(ActionsGui, gui)
- end
- for i = 1, 2 do
- local gui = Instance.new("TextButton",ScreenGui)
- gui.Size = UDim2.new(0,125,0,25)
- gui.Position = GuiM.Position + UDim2.new(0,125,0,-25 * i)
- gui.BackgroundColor = BrickColor.new("Really black")
- gui.Transparency = 0.3
- gui.TextColor = BrickColor.new("White")
- if i == 1 then
- gui.Text = "Part"
- else
- gui.Text = "Model"
- end
- gui.MouseButton1Click:connect(function()
- if selectionGuiMode == nil then
- gui.BackgroundColor = BrickColor.new("Really red")
- selectionGuiMode = gui
- else
- selectionGuiMode.BackgroundColor = BrickColor.new("Really black")
- gui.BackgroundColor = BrickColor.new("Really red")
- selectionGuiMode = gui
- end
- end)
- table.insert(ActionsGui, gui)
- end
- local gui = Instance.new("TextButton",ScreenGui) ----------------Okay we will change what mode we are in!
- gui.Size = UDim2.new(0,50,0,25)
- gui.Position = GuiM.Position + UDim2.new(0,250,0,0)
- gui.Text = "Okay"
- gui.BackgroundColor = BrickColor.new("Bright green")
- gui.Transparency = 0.3
- gui.TextColor = BrickColor.new("White")
- gui.MouseButton1Click:connect(function()
- Action = selectionGui.Text
- Mode = selectionGuiMode.Text
- GuiM.Text = "Action: "..Action..", Mode: "..Mode
- for i,v in pairs(ActionsGui) do
- spawn(function()
- ActionsGui[i].Text = ""
- repeat
- wait()
- --ActionsGui[i].Size.X.Offset = ActionsGui[i].Size.X.Offset - 3
- ActionsGui[i].Size = UDim2.new(0,ActionsGui[i].Size.X.Offset - 15,0,ActionsGui[i].Size.Y.Offset)
- until ActionsGui[i].Size.X.Offset < 1
- ActionsGui[i]:Destroy()
- menuUp = false
- end)
- end
- end)
- table.insert(ActionsGui, gui)
- local gui = Instance.new("TextButton",ScreenGui)
- gui.Size = UDim2.new(0,50,0,25)
- gui.Position = GuiM.Position + UDim2.new(0,250,0,25)
- gui.Text = "Cancel"
- gui.BackgroundColor = BrickColor.new("Bright red")
- gui.Transparency = 0.3
- gui.TextColor = BrickColor.new("White")
- gui.MouseButton1Click:connect(function()
- for i,v in pairs(ActionsGui) do
- spawn(function()
- ActionsGui[i].Text = ""
- repeat
- wait()
- --ActionsGui[i].Size.X.Offset = ActionsGui[i].Size.X.Offset - 3
- ActionsGui[i].Size = UDim2.new(0,ActionsGui[i].Size.X.Offset - 15,0,ActionsGui[i].Size.Y.Offset)
- until ActionsGui[i].Size.X.Offset < 1
- ActionsGui[i]:Destroy()
- menuUp = false
- end)
- end
- end)
- table.insert(ActionsGui, gui)
- end)
- local SB = Instance.new("SelectionBox",workspace.CurrentCamera)
- local Camera = Instance.new("Part",Char) -- New character
- Camera.Size = Vector3.new(1.5,1.5,1.5)
- Camera.Shape = "Ball"
- Camera.BrickColor = BrickColor.new("Really black")
- Camera.CanCollide = false
- Camera.TopSurface = "Smooth"
- Camera.BottomSurface = "Smooth"
- Camera.Anchored = true
- Camera.Locked = true
- Camera.CFrame = CFrame.new(0,10,0)
- Camera.BackSurface = "Motor"
- local Eye = Instance.new("Part",Char)
- Eye.Size = Vector3.new(0.4,0.4,0.4)
- Eye.Shape = "Ball"
- Eye.BrickColor = BrickColor.new("White")
- Eye.CanCollide = false
- Eye.TopSurface = "Smooth"
- Eye.BottomSurface = "Smooth"
- Eye.Locked = true
- Eye:BreakJoints()
- local EyeWeld = Instance.new("Weld")
- EyeWeld.Parent = Char
- EyeWeld.Part0 = Eye
- EyeWeld.Part1 = Camera
- EyeWeld.C0 = CFrame.new(0,0,0.7)
- local GhostPart = Instance.new("Part")
- GhostPart.CanCollide = false
- GhostPart.Anchored = true
- GhostPart.Transparency = 0.5
- GhostPart.Size = Vector3.new(SizeX,SizeY,SizeZ)
- --workspace.CurrentCamera.CameraType = "Scriptable"
- workspace.CurrentCamera.CameraSubject = Camera
- function getMasterModel(target)
- repeat
- wait()
- print(Char:IsAncestorOf(target))
- if Char:IsAncestorOf(target) or menuUp then
- return nil
- end
- if target.Parent ~= workspace then
- target = target.Parent
- else
- if target.Name == "Base" then return nil end --We don't want to mess with the baseplate
- print(target:GetFullName())
- return target
- end
- until target == false
- end
- function DestroyFunction()
- if Mode == "Model" then
- getMasterModel(Mouse.Target):Destroy()
- elseif Mode == "Part" then
- Mouse.Target:Destroy()
- end
- end
- function KillFunction()
- for i,v in pairs(getMasterModel(Mouse.Target):GetDescendants()) do
- if v:IsA("Humanoid") then
- v.Health = 0
- v:Destroy()
- end
- end
- end
- function BreakJointsFunction()
- if Mode == "Model" then
- getMasterModel(Mouse.Target):BreakJoints()
- elseif Mode == "Part" then
- Mouse.Target:BreakJoints()
- end
- end
- function DistortFunction()
- if Mode == "Model" then
- for _,v in pairs(getMasterModel(Mouse.Target):GetDescendants()) do
- if v:IsA("Part") or v:IsA("WedgePart") then
- if v.Size.X > 1 and v.Size.Y > 1 and v.Size.Z > 1 then
- v.Size = Vector3.new(math.random(v.Size.X),math.random(v.Size.Y),math.random(v.Size.Z)) + Vector3.new(math.random(v.Size.X),math.random(v.Size.Y),math.random(v.Size.Z))
- v.Color = Color3.new(math.random(),math.random(),math.random())
- end
- end
- end
- elseif Mode == "Part" then
- local v = Mouse.Target
- v.Size = Vector3.new(math.random(v.Size.X),math.random(v.Size.Y),math.random(v.Size.Z)) + Vector3.new(math.random(v.Size.X),math.random(v.Size.Y),math.random(v.Size.Z))
- v.Color = Color3.new(math.random(),math.random(),math.random())
- end
- end
- function rektFunction()
- if Mode == "Model" then
- for _,v in pairs(getMasterModel(Mouse.Target):GetDescendants()) do
- if v:IsA("Part") or v:IsA("WedgePart") then
- v:breakJoints()
- v.Anchored = false
- v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
- v.Color = Color3.new(math.random(),math.random(),math.random())
- end
- end
- elseif Mode == "Part" then
- local v = Mouse.Target
- v:breakJoints()
- v.Anchored = false
- v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
- v.Color = Color3.new(math.random(),math.random(),math.random())
- end
- end
- function AnchorFunction()
- if Mode == "Model" then
- for _,v in pairs (getMasterModel(Mouse.Target):GetDescendants()) do
- if v:IsA("Part") or v:IsA("WedgePart") then
- v.Anchored = not v.Anchored
- end
- end
- elseif Mode == "Part" then
- Mouse.Target.Anchored = not Mouse.Target.Anchored
- end
- end
- function PushFunction()
- if Mode == "Model" then
- for _,v in pairs (getMasterModel(Mouse.Target):GetDescendants()) do
- if v:IsA("Part") or v:IsA("WedgePart") then
- v.Anchored = false
- v.Velocity = Mouse.Target.CFrame.lookVector * 1000
- end
- end
- elseif Mode == "Part" then
- Mouse.Target.Anchored = false
- Mouse.Target.Velocity = Mouse.Target.CFrame.lookVector * 1000
- end
- end
- function FreezeFunction()
- if Mode == "Model" then
- for _,v in pairs(getMasterModel(Mouse.Target):GetDescendants()) do
- if v:IsA("Part") or v:IsA("WedgePart") then
- v.BrickColor = BrickColor.new("Pastel Blue")
- v.Anchored = true
- v.Material = "Ice"
- end
- end
- elseif Mode == "Part" then
- Mouse.Target.Anchored = true
- Mouse.Material = "Ice"
- end
- end
- function CloneFunction()
- if Mode == "Model" then
- Mouse.Target.Parent.Archivable = true
- local c = getMasterModel(Mouse.Target):Clone()
- c.Parent = workspace
- c:MakeJoints()
- c:MoveTo(Mouse.Target.CFrame.p + Vector3.new(0,5,0))
- spawn(function()
- local targets = {}
- if c:findFirstChild("Humanoid") and c:findFirstChild("Torso") then
- local human = c.Humanoid
- local torso = c.Torso
- local bp = Instance.new("BodyPosition",torso)
- bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bp.Position = torso.Position
- print('cloned humanoid')
- repeat
- local players = workspace:GetChildren()
- for i,v in pairs(players) do
- if v:findFirstChild("Humanoid") and v:findFirstChild("Torso") and v ~= c and v.Name ~= c.Name then
- local enemyTorso = v.Torso
- local enemyHuman = v.Humanoid
- if (enemyTorso.Position - torso.Position).magnitude < 200 and enemyHuman.Health > 0 and
- enemyTorso:findFirstChild("BodyPosition") == nil then
- print("Target: "..v.Name.."I am: "..c.Name)
- human:MoveTo(enemyTorso.Position, enemyTorso)
- human.WalkSpeed = 20
- human.Jump = true
- bp.Position = enemyTorso.Position
- if (v.Torso.Position - torso.Position).magnitude < 7 then
- v.Humanoid:TakeDamage(math.huge)
- v.Humanoid:Destroy()
- v.Torso.Velocity = torso.CFrame.lookVector * math.huge
- end
- end
- end
- end
- wait(2)
- until human == nil or human.Health < 1 or torso == nil
- game:GetService("Debris"):AddItem(c, 2)
- end
- end)
- elseif Mode == "Part" then
- Mouse.Target.Archivable = true
- local c = Mouse.Target:Clone()
- c.Parent = workspace
- c.CFrame = Mouse.Target.CFrame + Vector3.new(0,5,0)
- end
- end
- function WeldFunction()
- if Mode == "Model" then
- local welds = {}
- for _,v in pairs(getMasterModel(Mouse.Target):GetDescendants()) do
- if v:IsA("Part") or v:IsA("WedgePart") then
- table.insert(welds, v)
- local weld = Instance.new("Weld")
- weld.Parent = workspace
- weld.Part0 = welds[math.random(#welds)]
- weld.Part1 = v
- weld.C1 = CFrame.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
- end
- end
- end
- end
- function BuildFunction()
- local p = Instance.new("Part",workspace)
- p.CFrame = GhostPart.CFrame
- p:MakeJoints()
- p.Anchored = true
- p.Size = Vector3.new(SizeX,SizeY,SizeZ)
- end
- function LaserFunction()
- if Mouse.Target.Parent:findFirstChild("Humanoid") then
- Mouse.Target.Parent.Humanoid:TakeDamage(25)
- end
- local Laser = Instance.new("Part",workspace)
- Laser.Anchored = true
- Laser.BrickColor = BrickColor.new("Really red")
- Laser.TopSurface = "Smooth"
- Laser.BottomSurface = "Smooth"
- Laser.Size = Vector3.new(0.4,0.4,(Mouse.Hit.p - Camera.CFrame.p).magnitude)
- Laser.CFrame = CFrame.new(Camera.CFrame.p, Mouse.Hit.p):toWorldSpace(CFrame.new(0,0,-(Camera.CFrame.p- Mouse.Hit.p).magnitude/2))
- game:GetService("Debris"):AddItem(Laser,1)
- spawn(function()
- repeat
- wait()
- Laser.Transparency = Laser.Transparency + 0.05
- Laser.Size = Laser.Size - Vector3.new(0.05,0,0.05)
- until Laser.Transparency > 1
- end)
- end
- function ActionFunction()
- if Action == "Destroy" then
- DestroyFunction()
- elseif Action == "Kill" then
- KillFunction()
- elseif Action == "BreakJoints" then
- BreakJointsFunction()
- elseif Action == "Distort" then
- DistortFunction()
- elseif Action == "Anchor" then
- AnchorFunction()
- elseif Action == "Push" then
- PushFunction()
- elseif Action == "Freeze" then
- FreezeFunction()
- elseif Action == "Clone" then
- CloneFunction()
- elseif Action == "Build" then
- BuildFunction()
- elseif Action == "Laser" then
- LaserFunction()
- elseif Action == "Rekt" then
- rektFunction()
- elseif Action == "Weld" then
- WeldFunction()
- end
- end
- local mouseTarget = nil
- Mouse.Move:connect(function()
- Camera.CFrame = CFrame.new(Camera.CFrame.p, RealCamera.CFrame.p)
- if Mouse.Target ~= nil then
- if mouseTarget == Mouse.Target then --Don't waste resources when we already have what we want
- return
- end
- if Mode == "Part" then
- mouseTarget = Mouse.Target
- SB.Adornee = Mouse.Target
- elseif Mode == "Model" then
- mouseTarget = Mouse.Target
- SB.Adornee = getMasterModel(Mouse.Target)--Mouse.Target.Parent
- end
- if Action == "Build" then
- GhostPart.Parent = Char
- if Mouse.Target ~= GhostPart then
- GhostPart.CFrame = CFrame.new(Mouse.Hit.p)
- end
- elseif Action ~= "Build" then
- GhostPart.Parent = nil
- end
- else
- SB.Adornee = ""
- end
- end)
- Mouse.Button1Down:connect(function()
- if Mouse.Target ~= nil then
- ActionFunction()
- end
- end)
- local keyS = false
- local keyW = false
- local keyA = false
- local keyD = false
- local speed = 0.7 -- fast is 5
- GuiSlider2 = nil
- GuiSlider1 = nil
- Mouse.KeyDown:connect(function(key)
- if key == "c" then
- Mode = "Part"
- elseif key == "v" then
- Mode = "Model"
- elseif key == "z" then
- Selection = Selection + 1
- if Selection > #Actions then
- Selection = 1
- end
- Action = Actions[Selection]
- elseif key == "x" then
- Selection = Selection - 1
- if Selection < 1 then
- Selection = #Actions
- end
- Action = Actions[Selection]
- end
- if Action == "Build" and key == "x" or key == "z" and Action == "Build" then
- GuiSlider1 = Instance.new("TextButton",ScreenGui)
- GuiSlider1.Text = "<"
- GuiSlider1.Size = UDim2.new(0,25,0,25)
- GuiSlider1.Transparency = 0.3
- GuiSlider1.BackgroundColor = BrickColor.new("Black")
- GuiSlider1.TextColor = BrickColor.new("White")
- GuiSlider1.Position = UDim2.new(0.7,1,0.895,1)
- GuiSlider1.MouseButton1Down:connect(function()
- SizeX = SizeX - 1
- if SizeX < 1 then
- SizeX = 3
- end
- end)
- GuiSlider2 = Instance.new("TextButton",ScreenGui)
- GuiSlider2.Text = ">"
- GuiSlider2.Size = UDim2.new(0,25,0,25)
- GuiSlider2.Transparency = 0.3
- GuiSlider2.BackgroundColor = BrickColor.new("Black")
- GuiSlider2.TextColor = BrickColor.new("White")
- GuiSlider2.Position = UDim2.new(0.859,1,0.895,1)
- GuiSlider2.MouseButton1Down:connect(function()
- SizeX = SizeX + 1
- if SizeX > 3 then
- SizeX = 1
- end
- end)
- elseif GuiSlider1 ~= nil and GuiSlider2 ~= nil and Action ~= "Build" then
- GuiSlider1:Destroy()
- GuiSlider2:Destroy()
- end
- if string.byte(key) == 48 then
- speed = 5
- elseif key == "s" then
- keyS = true
- repeat
- wait()
- Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,-speed))
- EyeWeld.C0 = CFrame.new(0,0,0.7)
- until keyS == false
- elseif key =="w" then
- keyW = true
- repeat
- wait()
- Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,speed))
- EyeWeld.C0 = CFrame.new(0,0,0.7)
- until keyW == false
- elseif key =="a" then
- keyA = true
- repeat
- wait()
- Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(speed,0,0))
- until keyA == false
- elseif key =="d" then
- keyD = true
- repeat
- wait()
- Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(-speed,0,0))
- until keyD == false
- elseif key == "e" then
- Camera.Transparency = math.abs(Camera.Transparency - 1)
- end
- GuiM.Text = "Action: "..Action..", Mode: "..Mode
- end)
- function keyLiftedFunction(key)
- print(string.byte(key))
- if key == "s" then keyS = false end
- if key == "a" then keyA = false end
- if key == "d" then keyD = false end
- if key == "w" then keyW = false end
- if string.byte(key) == 48 then speed = 0.7 end
- end
- Mouse.KeyUp:connect(keyLiftedFunction)
- wait(2)
- Player.Backpack:ClearAllChildren()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement