Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. me = game.Players.hankjonny
  2.  
  3. if script.Parent.className ~= "HopperBin" then
  4. h = Instance.new("HopperBin")
  5. h.Parent = me.Backpack
  6. h.Name = "Castle"
  7. script.Parent = h
  8. end
  9.  
  10. bin = script.Parent
  11. hold = false
  12.  
  13. bin.Selected:connect(function(mouse)
  14. mouse.Button1Down:connect(function()
  15. startpoint = Instance.new("Part",me.Character)
  16. startpoint.Size = Vector3.new(1,1,1)
  17. startpoint.Anchored = true
  18. startpoint.CFrame = CFrame.new(mouse.Hit.p)
  19. gopoint = Instance.new("Part",me.Character)
  20. gopoint.Size = Vector3.new(1,1,1)
  21. gopoint.Anchored = true
  22. gopoint.CFrame = CFrame.new(mouse.Hit.p)
  23. hold = true
  24. while hold do
  25. gopoint.CFrame = CFrame.new(mouse.Hit.p)
  26. wait()
  27. end
  28. end)
  29. mouse.Button1Up:connect(function()
  30. hold = false
  31. local dist = (startpoint.Position - gopoint.Position).magnitude
  32. local lastangle = 0
  33. local wall = Instance.new("Part")
  34. wall.formFactor = "Custom"
  35. wall.Size = Vector3.new(dist/3,dist/4,dist/8)
  36. wall.Anchored = true
  37. wall.TopSurface = 0
  38. wall.BottomSurface = 0
  39. wall.BrickColor = BrickColor.new("Dark grey")
  40. for i=1, math.pi*2 + 0.3, 0.3 do
  41. wait()
  42. local wal = Instance.new("Part",workspace)
  43. wal.formFactor = "Custom"
  44. wal.Size = Vector3.new(dist/3,dist/4,dist/8)
  45. wal.Anchored = true
  46. wal.TopSurface = 0
  47. wal.BottomSurface = 0
  48. wal.BrickColor = BrickColor.new("Dark grey")
  49. wal.CFrame = CFrame.new(startpoint.Position) * CFrame.Angles(0,i,0)
  50. wal.CFrame = wal.CFrame * CFrame.new(0,wal.Size.Y/2,dist)
  51. local tip = wal:clone()
  52. tip.Parent = workspace
  53. tip.Size = Vector3.new(wal.Size.X/2.3,wal.Size.Y/3,wal.Size.Z/2)
  54. tip.CFrame = wal.CFrame * CFrame.new(0,wal.Size.Y/2,wal.Size.Z/2)
  55. lastangle = i
  56. end
  57. local door = wall:clone()
  58. door.Size = Vector3.new(dist/12,dist/4,dist/3)
  59. door.Parent = workspace
  60. door.BrickColor = BrickColor.new("Reddish brown")
  61. door.CFrame = CFrame.new(startpoint.Position) * CFrame.Angles(0,lastangle + 0.18,0)
  62. door.CFrame = door.CFrame * CFrame.new(0,door.Size.Y/2,dist*1.15)
  63. local door2 = door:clone()
  64. door2.Parent = workspace
  65. door2.CFrame = CFrame.new(startpoint.Position) * CFrame.Angles(0,lastangle + 0.7,0)
  66. door2.CFrame = door2.CFrame * CFrame.new(0,door2.Size.Y/2,dist*1.15)
  67. startpoint:remove()
  68. gopoint:remove()
  69. end)
  70. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement