Advertisement
TheUnknownDiscord

Untitled

Sep 6th, 2021 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. Part = Instance.new("Part")
  2. Part.Parent = game.Workspace
  3. Part.Size = Vector3.new(5, 9, 1)
  4. Part.Position = Vector3.new(0, 4.5, 5)
  5. Part.Anchored = true
  6. Part.CanTouch = false
  7. function thinghere()
  8. touching = true
  9. while touching do
  10. if Part.CFrame ~= CFrame.new(2.5,0,0) then
  11. Part.CFrame = Part.CFrame * CFrame.new(0.05,0,0)
  12. task.wait()
  13. end
  14. end
  15. end
  16. else
  17. touching = false
  18. end
  19.  
  20. function thinghere2()
  21. touching = false
  22. while not touching do
  23. if Part.CFrame ~= CFrame.new(-2.5,0,0) then
  24. Part.CFrame = Part.CFrame * CFrame.new(-0.05,0,0)
  25. task.wait()
  26. end
  27. end
  28. end
  29. else
  30. touching = true
  31. end
  32. part1 = Instance.new("Part", game.Workspace)
  33. part1.Size = Vector3.new(10,9,5)
  34. part1.Position = Vector3.new(0,4.55,0)
  35. part1.Anchored = true
  36. part1.CanCollide = false
  37. part1.Transparency = 0.75
  38. part1.Touched:Connect(thinghere)
  39.  
  40. part1.TouchEnded:Connect(thinghere2)
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement