Advertisement
ModuleForRBLX

Untitled

Feb 26th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1.  
  2. local LocalPlayer = game:GetService("Players").LocalPlayer
  3. local mouse = LocalPlayer:GetMouse()
  4. local movetool = Instance.new("Tool", LocalPlayer.Backpack)
  5. local deletetool = Instance.new("Tool", LocalPlayer.Backpack)
  6. local undotool = Instance.new("Tool", LocalPlayer.Backpack)
  7. local identifytool = Instance.new("Tool", LocalPlayer.Backpack)
  8. local movedetect = false
  9. local movingpart = nil
  10. local movetransparency = 0
  11. if editedparts == nil then
  12. editedparts = {}
  13. parentfix = {}
  14. positionfix = {}
  15. end
  16. deletetool.Name = "Delete"
  17. undotool.Name = "Undo"
  18. identifytool.Name = "Identify"
  19. movetool.Name = "Move"
  20. undotool.CanBeDropped = false
  21. deletetool.CanBeDropped = false
  22. identifytool.CanBeDropped = false
  23. movetool.CanBeDropped = false
  24. undotool.RequiresHandle = false
  25. deletetool.RequiresHandle = false
  26. identifytool.RequiresHandle = false
  27. movetool.RequiresHandle = false
  28. local function createnotification(title, text)
  29. game:GetService("StarterGui"):SetCore("SendNotification", {
  30. Title = title;
  31. Text = text;
  32. Duration = 1;
  33. })
  34. end
  35. deletetool.Activated:Connect(function()
  36. createnotification("Delete Tool", "You have deleted "..mouse.Target.Name)
  37. table.insert(editedparts, mouse.Target)
  38. table.insert(parentfix, mouse.Target.Parent)
  39. table.insert(positionfix, mouse.Target.CFrame)
  40. spawn(function()
  41. local deletedpart = mouse.Target
  42. repeat
  43. deletedpart.Anchored = true
  44. deletedpart.CFrame = CFrame.new(1000000000, 1000000000, 1000000000)
  45. wait()
  46. until deletedpart.CFrame ~= CFrame.new(1000000000, 1000000000, 1000000000)
  47. end)
  48. end)
  49. undotool.Activated:Connect(function()
  50. createnotification("Undo Tool", "You have undone "..editedparts[#editedparts].Name)
  51. editedparts[#editedparts].Parent = parentfix[#parentfix]
  52. editedparts[#editedparts].CFrame = positionfix[#positionfix]
  53. table.remove(positionfix, #positionfix)
  54. table.remove(editedparts, #editedparts)
  55. table.remove(parentfix, #parentfix)
  56. end)
  57. identifytool.Activated:Connect(function()
  58. createnotification("Identify Tool", "Instance: "..mouse.Target.ClassName.."\nName: "..mouse.Target.Name)
  59. end)
  60. movetool.Activated:Connect(function()
  61. createnotification("Move Tool", "You are moving: "..mouse.Target.Name)
  62. movingpart = mouse.Target
  63. movedetect = true
  64. movingpart.CanCollide = false
  65. movetransparency = movingpart.Transparency
  66. movingpart.Transparency = 0.5
  67. mouse.TargetFilter = movingpart
  68. table.insert(editedparts, movingpart)
  69. table.insert(parentfix, movingpart.Parent)
  70. table.insert(positionfix, movingpart.CFrame)
  71. movingpart.Transparency = movingpart.Transparency / 2
  72. repeat
  73. mouse.Move:Wait()
  74. movingpart.CFrame = CFrame.new(mouse.Hit.p)
  75. until movedetect == false
  76. end)
  77. movetool.Deactivated:Connect(function()
  78. createnotification("Move Tool", "You have stopped moving: "..mouse.Target.Name)
  79. movingpart.CanCollide = true
  80. movedetect = false
  81. mouse.TargetFilter = nil
  82. movingpart.Transparency = movetransparenc
  83. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement