ModuleForRBLX

Untitled

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