Categories > Exploiting > Scripts >

CTRL + Click (Delete Script) - Someone couldn't get this to work so I fixed it. (They just indented wrongly.)

ninjagunner59

Ninja Otaku

Posts: 1

Threads: 1

Joined: Dec, 2017

Reputation: 0

Posted

local Plr = game:GetService("Players").LocalPlayer
local Mouse = Plr:GetMouse()
 
Mouse.Button1Down:connect(function()
 
    -- NOTE: The if statements gets an indent or '4' spaces from the start of the line
    
    if not game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftControl) then
       
        -- This gets 2 indents or '8' spaces from the start of the line
        return end
 
    if not Mouse.Target then
        
        -- This also gets 2 indents or '8' spaces from the start of the line
        return end
Mouse.Target:Destroy()
end)
 
-- Copy and paste this script and then execute it. Then press CTRL + Click to destroy/delete objects for your view only
 
-- You can delete all of the comments, too!
 
-- Attached is an image of what it should look like in the executor!
 
  • 0

Posts: 199

Threads: 22

Joined: Jul, 2021

Reputation: -20

Replied

You should add a undo feature to it.

  • 1

tar

CoolNickname

Posts: 142

Threads: 15

Joined: Jul, 2021

Reputation: 1

Replied

@GoldenCheats

local Plr = game:GetService("Players").LocalPlayer
local Mouse = Plr:GetMouse()
local DeleteList = {}
Mouse.Button1Down:connect(function()
	if not game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftControl) then return end
	if not Mouse.Target then return end
	if not Mouse.Target.Parent then return end
	table.insert(DeleteList, {Mouse.Target, Mouse.Target.Parent})
	Mouse.Target.Parent = nil
end)
game:GetService("UserInputService").InputBegan:Connect(function (input)
	if #DeleteList > 0 and input.KeyCode == Enum.KeyCode.Z and game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftControl) then
		DeleteList[#DeleteList][1].Parent = DeleteList[#DeleteList][2]
		table.remove(DeleteList, #DeleteList)
	end
end)
-- Copy and paste this script and then execute it. Then press CTRL + Click to destroy/delete objects for your view only
-- press CTRL + Z for undo
  • 1

https://imgur.com/a/oOomuUo

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )