Advertisement
Guest User

Untitled

a guest
Nov 26th, 2020
2,911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. --// Simple Ctrl Delete Script With Undo By Jalos34
  2. local HoldToSelect  = Enum.KeyCode.LeftControl
  3. local HoldToUndoAll = Enum.KeyCode.LeftAlt
  4. local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
  5. local Parts = {}
  6. local Box = Instance.new("SelectionBox",game.Workspace)
  7. local Sound0 = Instance.new("Sound")
  8. local Sound1 = Instance.new("Sound")
  9. Box.Name="Box"Box.LineThickness=0.01;Box.Adornee=nil;Box.Color3=Color3.fromRGB(255,0,0)Box.Visible=true;Sound1.Name="Sound"Sound1.SoundId="http://www.roblox.com/asset/?id=773858658"Sound1.Volume=1;Sound1.Looped=false;Sound1.archivable=false;Sound1.Parent=game.Workspace;Sound0.Name="Sound"Sound0.SoundId="http://www.roblox.com/asset/?id=4676738150"Sound0.Volume=1;Sound0.Looped=false;Sound0.archivable=false;Sound0.Parent=game.Workspace;for a,b in pairs(game.Workspace:GetDescendants())do if b.ClassName=="Part"then b.Locked=false end end;Mouse.Button1Down:connect(function()if game:GetService("UserInputService"):IsKeyDown(HoldToSelect)then table.insert(Parts,Mouse.Target)Mouse.Target.Parent=game.CoreGui;Sound0:Play()end end)while wait()do Box.Adornee=nil;if game:GetService("UserInputService"):IsKeyDown(HoldToSelect)then Box.Adornee=Mouse.Target or nil end;if game:GetService("UserInputService"):IsKeyDown(HoldToUndoAll)then local c=0;for a,b in pairs(Parts)do c=a end;pcall(function()Parts[c].Parent=workspace;table.remove(Parts,c)Sound1:Play()end)wait(.1)end end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement