Blueisim

Untitled

Aug 13th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.24 KB | None | 0 0
  1. --Portal Gifted by TheRedAngel, Local Script!
  2.  
  3. me = game.Players.LocalPlayer
  4.  
  5. if script.Parent.className ~= "HopperBin" then
  6. h = Instance.new("HopperBin",me.Backpack)
  7. h.Name = "Portal"
  8. script.Parent = h
  9. end
  10.  
  11. bin = script.Parent
  12. mode = true
  13. hold = false
  14.  
  15. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  16. part.Parent = parent
  17. part.formFactor = form
  18. part.CanCollide = collide
  19. part.Transparency = tran
  20. part.Reflectance = ref
  21. part.Size = Vector3.new(x,y,z)
  22. part.BrickColor = BrickColor.new(color)
  23. part.TopSurface = 0
  24. part.BottomSurface = 0
  25. part.Anchored = anchor
  26. part:BreakJoints()
  27. end
  28.  
  29. function weld(w, p, p0, p1, a, b, c, x, y, z)
  30. w.Parent = p
  31. w.Part0 = p0
  32. w.Part1 = p1
  33. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  34. end
  35.  
  36. function mesh(mesh, parent, x, y, z, type)
  37. mesh.Parent = parent
  38. mesh.Scale = Vector3.new(x, y, z)
  39. mesh.MeshType = type
  40. end
  41.  
  42. out = false
  43. inn = false
  44.  
  45. function sel(mouse)
  46. local mk = nil
  47. local km = nil
  48. mouse.Button1Down:connect(function()
  49. if mode then
  50. if inn == false then
  51. inn = true
  52. mode = false
  53. hold = true
  54. local holdpos = mouse.Hit.p + Vector3.new(0,4,0)
  55. local portal = Instance.new("Model",workspace)
  56. portal.Name = "InPortal"
  57. local main = Instance.new("Part")
  58. prop(main, portal, false, 0.1, 0.1, 2.4, 2.4, 0.6, "Medium blue", true, "Custom")
  59. main.CFrame = CFrame.new(holdpos,mouse.Hit.p) * CFrame.new(0,3,0)
  60. local mes = Instance.new("SpecialMesh")
  61. mesh(mes,main,7,7,4,"FileMesh")
  62. mes.MeshId = "http://www.roblox.com/asset/?id=3270017"
  63. local f = Instance.new("Fire",main)
  64. f.Size = 7
  65. f.Heat = 0
  66. f.Color = Color3.new(0.1,0.2,1)
  67. f.SecondaryColor = Color3.new(0.4,0.4,0.6)
  68. while hold do
  69. wait()
  70. main.CFrame = CFrame.new(holdpos,mouse.Hit.p)
  71. end
  72. mk = main
  73. end
  74. else
  75. if inn == true and out == false then
  76. out = true
  77. mode = true
  78. hold = true
  79. local holdpos = mouse.Hit.p + Vector3.new(0,4,0)
  80. local portal = Instance.new("Model",workspace)
  81. portal.Name = "OutPortal"
  82. local main = Instance.new("Part")
  83. prop(main, portal, false, 0.1, 0.1, 2.4, 2.4, 0.6, "Neon orange", true, "Custom")
  84. main.CFrame = CFrame.new(holdpos,mouse.Hit.p) * CFrame.new(0,3,0)
  85. local mes = Instance.new("SpecialMesh")
  86. mesh(mes,main,7,7,4,"FileMesh")
  87. mes.MeshId = "http://www.roblox.com/asset/?id=3270017"
  88. local f = Instance.new("Fire",main)
  89. f.Size = 7
  90. f.Heat = 0
  91. f.Color = Color3.new(1,0.2,0.1)
  92. f.SecondaryColor = Color3.new(0.8,0.1,0.08)
  93. km = main
  94. hold = true
  95. while hold do
  96. wait()
  97. main.CFrame = CFrame.new(holdpos,mouse.Hit.p)
  98. end
  99. local tuch = true
  100. mk.Touched:connect(function(hit)
  101. local pla = game.Players:findFirstChild(hit.Parent.Name)
  102. if pla then
  103. if tuch then
  104. tuch = false
  105. local ff = Instance.new("Part")
  106. prop(ff,me.Character,false,1,0.2,2.3,2.3,1,"Medium blue",true,"Custom")
  107. local mag = (mk.Position - main.Position).magnitude
  108. ff.Size = Vector3.new(2.3,2.3,1)
  109. ff.CFrame = CFrame.new(mk.Position, main.Position) * CFrame.new(0,0,-mag/2)
  110. local mee = Instance.new("SpecialMesh",ff)
  111. mee.MeshType = "Brick"
  112. mee.Scale = Vector3.new(0.65,0.65,mag)
  113. for i=0.1, 1.1, 0.05 do
  114. mk.Transparency = i
  115. ff.Transparency = ff.Transparency - 0.04
  116. mee.Scale = Vector3.new(math.random(5,130)/100,math.random(5,130)/100,mag)
  117. wait()
  118. end
  119. pla.Character.Torso.CFrame = main.CFrame * CFrame.new(0,0,-3)
  120. for i=0.1,1.1,0.05 do
  121. main.Transparency = i
  122. ff.Transparency = ff.Transparency + 0.08
  123. mee.Scale = Vector3.new(math.random(30,120)/100,math.random(30,120)/100,mag)
  124. wait()
  125. end
  126. ff:remove()
  127. main:remove()
  128. mk:remove()
  129. mk = nil
  130. inn = false
  131. out = false
  132. end
  133. end
  134. end)
  135. end
  136. end
  137. end)
  138. mouse.Button1Up:connect(function()
  139. hold = false
  140. end)
  141. mouse.KeyDown:connect(function(key)
  142. key = key:lower()
  143. if (key == "q") then
  144. mode = true
  145. if mk ~= nil then
  146. mk:remove()
  147. mk = nil
  148. inn = false
  149. end
  150. if km ~= nil then
  151. km:remove()
  152. km = nil
  153. out = false
  154. end
  155. end
  156. end)
  157. end
  158.  
  159. bin.Selected:connect(sel)
Add Comment
Please, Sign In to add comment