Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- local Player = game.Players.LocalPlayer
- local Char = Player.Character
- local Mouse = Player:GetMouse()
- local RealCamera = workspace.CurrentCamera
- 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"}
- local GuiM = Instance.new("TextButton",ScreenGui)
- GuiM.Size = UDim2.new(0,150,0,25)
- GuiM.Position = UDim2.new(0.7,1,0.95,1)
- GuiM.Text = "Action: Destroy, Model"
- GuiM.BackgroundColor = BrickColor.new("Really black")
- GuiM.Transparency = 0.3
- GuiM.TextColor = BrickColor.new("White")
- local SB = Instance.new("SelectionBox",workspace.CurrentCamera)
- for _,v in pairs(Char:GetChildren()) do
- if v:IsA("Part") or v:IsA("Humanoid") or v:IsA("Hat") then
- v:Destroy()
- end
- end
- 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)
- --workspace.CurrentCamera.CameraType = "Scriptable"
- workspace.CurrentCamera.CameraSubject = Camera
- function getMasterModel(target)
- repeat
- wait()
- print('check')
- if target.Parent ~= workspace then
- target = target.Parent
- else
- 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))
- 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
- local SizeX = 3
- local SizeY = 3
- local SizeZ = 3
- function BuildFunction()
- local p = Instance.new("Part",workspace)
- p.CFrame = CFrame.new(Mouse.Hit.p)
- 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 GhostPart = Instance.new("Part")
- GhostPart.CanCollide = false
- GhostPart.Anchored = true
- GhostPart.Transparency = 0.5
- GhostPart.Size = Vector3.new(3,3,3)
- local mouseTarget = nil
- Mouse.Move:connect(function()
- Camera.CFrame = CFrame.new(Camera.CFrame.p, RealCamera.CFrame.p)
- if Mouse.Target ~= nil then
- if Mode == "Part" and mouseTarget ~= Mouse.Target then
- mouseTarget = Mouse.Target
- SB.Adornee = Mouse.Target
- elseif Mode == "Model" and mouseTarget ~= Mouse.Target 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
- 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
- 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
- local GuiSlider = Instance.new("TextButton",ScreenGui)
- GuiSlider.Text = "<"
- GuiSlider.Size = UDim2.new(0,25,0,25)
- GuiSlider.Transparency = 0.3
- GuiSlider.BackgroundColor = BrickColor.new("Black")
- GuiSlider.TextColor = BrickColor.new("White")
- GuiSlider.Position = UDim2.new(0.7,1,0.895,1)
- GuiSlider.MouseButton1Down:connect(function()
- SizeX = SizeX - 1
- if SizeX < 1 then
- SizeX = 3
- end
- end)
- local GuiSlider = Instance.new("TextButton",ScreenGui)
- GuiSlider.Text = ">"
- GuiSlider.Size = UDim2.new(0,25,0,25)
- GuiSlider.Transparency = 0.3
- GuiSlider.BackgroundColor = BrickColor.new("Black")
- GuiSlider.TextColor = BrickColor.new("White")
- GuiSlider.Position = UDim2.new(0.859,1,0.895,1)
- GuiSlider.MouseButton1Down:connect(function()
- SizeX = SizeX + 1
- if SizeX > 3 then
- SizeX = 1
- end
- end)
- elseif 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