SebTDZ

Portal

Jul 14th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Portal Model
  2.  
  3. local Portal = Instance.new("Model", script)
  4. Portal.Name = "Portal"
  5.  
  6. -- Portal Main
  7.  
  8. local PortalMain = Instance.new("Part", Portal)
  9. PortalMain.Name = "PortalMain"
  10. PortalMain.Rotation = Vector3.new(0,90,0)
  11. PortalMain.Position = Vector3.new(0,5.5,10)
  12. PortalMain.BrickColor = BrickColor.new("Bright blue")
  13. PortalMain.Size = Vector3.new(1,10,10)
  14. PortalMain.Anchored = true
  15. PortalMain.CanCollide = false
  16. PortalMain.Shape = Enum.PartType.Cylinder
  17. PortalMain.Material = "ForceField"
  18.    
  19. PortalMain.Touched:Connect(function(TPart)
  20.     TPart.CFrame = CFrame.new(700* 3,1.2 + 5,700 * 3)
  21. end)
  22.  
  23. -- Portal Frame
  24.  
  25. local PortalFrame = Instance.new("Part", Portal)
  26. PortalFrame.Name = "PortalFrame"
  27. PortalFrame.CFrame = PortalMain.CFrame
  28. PortalFrame.BrickColor = BrickColor.new("Bright blue")
  29. PortalFrame.Size = PortalMain.Size + Vector3.new(0,2.5,02.5)
  30. PortalFrame.Anchored = true
  31. PortalFrame.CanCollide = false
  32. PortalFrame.Shape = Enum.PartType.Cylinder
  33. PortalFrame.Material = "ForceField"
  34.  
  35. -- Base
  36.  
  37. local NewBase = Instance.new("Part", Portal)
  38. NewBase.Name = "Base"
  39. NewBase.Locked = true
  40. NewBase.Position = Vector3.new(700 * 3,1.2,700 * 3)
  41. NewBase.Size = Vector3.new(700,1.2,700)
  42. NewBase.Anchored = true
  43. NewBase.Material = Enum.Material.Grass
  44. NewBase.TopSurface = Enum.SurfaceType.Smooth
  45. NewBase.BottomSurface = Enum.SurfaceType.Smooth
  46. NewBase.BrickColor = BrickColor.new("Bright green")
  47.  
  48. -- Portal Model
  49.  
  50. local Portal2 = Instance.new("Model", script)
  51. Portal2.Name = "Portal2"
  52.  
  53. -- Portal Main
  54.  
  55. local Portal2Main = Instance.new("Part", Portal)
  56. Portal2Main.Name = "Portal2Main"
  57. Portal2Main.Rotation = Vector3.new(0,90,0)
  58. Portal2Main.Position = Vector3.new(700* 3,1.2 + 5,700 * 3) + Vector3.new(0,0,-5)
  59. Portal2Main.BrickColor = BrickColor.new("Bright red")
  60. Portal2Main.Size = Vector3.new(1,10,10)
  61. Portal2Main.Anchored = true
  62. Portal2Main.CanCollide = false
  63. Portal2Main.Shape = Enum.PartType.Cylinder
  64. Portal2Main.Material = "ForceField"
  65.    
  66. Portal2Main.Touched:Connect(function(TPart)
  67.     TPart.CFrame = CFrame.new(0,5.5,5)
  68. end)
  69.  
  70. -- Portal Frame
  71.  
  72. local Portal2Frame = Instance.new("Part", Portal)
  73. Portal2Frame.Name = "Portal2Frame"
  74. Portal2Frame.CFrame = Portal2Main.CFrame
  75. Portal2Frame.BrickColor = BrickColor.new("Bright red")
  76. Portal2Frame.Size = Portal2Main.Size + Vector3.new(0,2.5,02.5)
  77. Portal2Frame.Anchored = true
  78. Portal2Frame.CanCollide = false
  79. Portal2Frame.Shape = Enum.PartType.Cylinder
  80. Portal2Frame.Material = "ForceField"
Add Comment
Please, Sign In to add comment