Advertisement
DrawingJhon

._.

May 24th, 2020 (edited)
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. --//Script hecho por: JhonXD2006\\--
  2.  
  3. local Part1 = Instance.new("Part", workspace)
  4. Part1.Position = Vector3.new(0, 1, 0)
  5. Part1.Size = Vector3.new(2, 2, 2)
  6. Part1.Anchored = true
  7. Part1.TopSurface = Enum.SurfaceType.Smooth
  8. Part1.BottomSurface = Enum.SurfaceType.Smooth
  9. Part1.Name = "MyPart1"
  10.  
  11. local Part2 = Instance.new("Part", workspace)
  12. Part2.Position = Vector3.new(0, 1, 2)
  13. Part2.Size = Vector3.new(2, 2, 2)
  14. Part2.Anchored = true
  15. Part2.TopSurface = Enum.SurfaceType.Smooth
  16. Part2.BottomSurface = Enum.SurfaceType.Smooth
  17. Part2.Name = "MyPart2"
  18.  
  19. wait(1)
  20. print("Don't touch parts :P")
  21. local reOne = false
  22. local reAll = false
  23. local lastCF = {Part1 = Part1.CFrame, Part2 = Part2.CFrame}
  24. function onChanged(pr, parta)
  25.     if pr == "CFrame" then
  26.         print("Don't move the part >:I")
  27.         parta.CFrame = lastCF[parta]
  28.     end
  29.     if pr == "Parent" then
  30.         if parta.Parent == nil then
  31.             if reOne then
  32.                 print("NOOOO :(")
  33.                 reAll = true
  34.                 reOne = false
  35.             else
  36.                 print("nu :c")
  37.                 reOne = true
  38.             end
  39.         elseif parta.Parent == workspace then
  40.             if reAll then
  41.                 print("good")
  42.                 reAll = false
  43.                 reOne = true
  44.             elseif reOne then
  45.                 print("YAA")
  46.                 reOne = false
  47.             end
  48.         end
  49.     end
  50. end
  51. Part1.Changed:Connect(function(p)
  52.     onChanged(p, Part1)
  53. end)
  54. Part2.Changed:Connect(function(p)
  55.     onChanged(p, Part2)
  56. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement