Advertisement
_Thanh_Thy_Cute_

ROBLOX RICK AND MORTY PORTAL SCRIPT

Sep 21st, 2021
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.71 KB | None | 0 0
  1. function make_portal_gun_and_GUI()
  2. portal_gun = Instance.new("Tool")
  3. portal_gun.Name = "Portal_Gun"
  4. portal_gun.Parent = workspace
  5.  
  6. Handle = Instance.new("Part")
  7. Handle.Name = "Handle"
  8. Handle.Parent = portal_gun
  9. Handle.Color = Color3.fromRGB(231, 231, 236)
  10. Handle.Material = Enum.Material.Plastic
  11. Handle.Size = Vector3.new(1.045, 0.453, 0.453)
  12. Handle.Position = Vector3.new(-10.028, 4.312, 19.112)
  13. Handle.Orientation = Vector3.new(0, -180, 107.64)
  14. Handle.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  15. Handle.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  16. Handle.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  17. Handle.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  18. Handle.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  19. Handle.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  20.  
  21. Union = Instance.new("Part")
  22. Union.Color = Color3.fromRGB(0, 255, 0)
  23. Union.Material = Enum.Material.Plastic
  24. Union.Transparency = 0.45
  25. Union.Name = "Union"
  26.  
  27. Union.Size = Vector3.new(0.304, 0.476, 0.302)
  28. Union.Position = Vector3.new(-8.972, 5.269, 19.079)
  29. Union.Orientation = Vector3.new(0, 180, -3.64)
  30. Union.Parent = portal_gun
  31.  
  32. part1 = Instance.new("Part")
  33. part1.Name = "part1"
  34. part1.Color = Color3.fromRGB(17, 17, 17)
  35. part1.Material = Enum.Material.Plastic
  36. part1.Size = Vector3.new(0.2, 0.24, 0.99)
  37. part1.Position = Vector3.new(-8.716, 4.926, 19.111)
  38. part1.Orientation = Vector3.new(0, 180, -3.64)
  39. part1.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  40. part1.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  41. part1.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  42. part1.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  43. part1.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  44. part1.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  45. part1.Parent = portal_gun
  46.  
  47. part2 = Instance.new("Part")
  48. part2.Name = "part2"
  49. part2.Color = Color3.fromRGB(231, 231, 236)
  50. part2.Material = Enum.Material.Plastic
  51. part2.Size = Vector3.new(1.04, 0.3, 0.48)
  52. part2.Position = Vector3.new(-9.874, 4.855, 19.095)
  53. part2.Orientation = Vector3.new(-0.02, 90, 0)
  54. part2.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  55. part2.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  56. part2.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  57. part2.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  58. part2.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  59. part2.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  60. part2.Shape = Enum.PartType.Cylinder
  61. part2.Parent = portal_gun
  62.  
  63. part3 = Instance.new("Part")
  64. part3.Name = "part3"
  65. part3.Color = Color3.fromRGB(17, 17, 17)
  66. part3.Material = Enum.Material.Plastic
  67. part3.Size = Vector3.new(0.2, 0.47, 0.45)
  68. part3.Position = Vector3.new(-8.939, 4.948, 19.086)
  69. part3.Orientation = Vector3.new(3.47, -90, -90)
  70. part3.Shape = Enum.PartType.Cylinder
  71. part3.Parent = portal_gun
  72.  
  73. part4 = Instance.new("Part")
  74. part4.Name = "part4"
  75. part4.Color = Color3.fromRGB(231, 231, 236)
  76. part4.Material = Enum.Material.Plastic
  77. part4.Size = Vector3.new(1.04, 0.3, 0.48)
  78. part4.Position = Vector3.new(-9.874, 4.845, 19.095)
  79. part4.Orientation = Vector3.new(-0.02, 90, 0)
  80. part4.Shape = Enum.PartType.Cylinder
  81. part4.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  82. part4.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  83. part4.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  84. part4.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  85. part4.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  86. part4.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  87. part4.Parent = portal_gun
  88.  
  89. part5 = Instance.new("Part")
  90. part5.Name = "part5"
  91. part5.Color = Color3.fromRGB(17, 17, 17)
  92. part5.Material = Enum.Material.Plastic
  93. part5.Parent = portal_gun
  94. part5.Size = Vector3.new(0.2, 0.2, 0.2)
  95. part5.Position = Vector3.new(-9.894, 4.93, 19.061)
  96. part5.Orientation = Vector3.new(11.67, -90, -90)
  97.  
  98. part6 = Instance.new("Part")
  99. part6.Name = "part6"
  100. part6.Color = Color3.fromRGB(0, 255, 0)
  101. part6.Material = Enum.Material.Neon
  102. part6.Size = Vector3.new(0.2, 0.31, 0.2)
  103. part6.Position = Vector3.new(-8.715, 4.919, 19.095)
  104. part6.Orientation = Vector3.new(0, 180, -3.64)
  105. part6.Shape = Enum.PartType.Cylinder
  106. part6.Parent = portal_gun
  107.  
  108. part7 = Instance.new("Part")
  109. part7.Name = "part7"
  110. part7.Color = Color3.fromRGB(231, 231, 236)
  111. part7.Material = Enum.Material.Plastic
  112. part7.Size = Vector3.new(1.04, 0.3, 0.48)
  113. part7.Position = Vector3.new(-9.874, 4.865, 19.095)
  114. part7.Orientation = Vector3.new(-0.02, 90, 0)
  115. part7.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  116. part7.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  117. part7.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  118. part7.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  119. part7.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  120. part7.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  121. part7.Shape = Enum.PartType.Cylinder
  122. part7.Parent = portal_gun
  123.  
  124. part8 = Instance.new("Part")
  125. part8.Name = "part8"
  126. part8.Color = Color3.fromRGB(248, 248, 248)
  127. part8.Material = Enum.Material.SmoothPlastic
  128. part8.Transparency = 1
  129. part8.Size = Vector3.new(0.2, 0.2, 0.2)
  130. part8.Position = Vector3.new(-8.952, 5.2, 19.088)
  131. part8.Orientation = Vector3.new(0, 0, 3.64)
  132. part8.Parent = portal_gun
  133. part8_smoke = Instance.new("Smoke")
  134. part8_smoke.Color = Color3.fromRGB(82, 255, 82)
  135. part8_smoke.Size = 0.1
  136. part8_smoke.RiseVelocity = 8
  137. part8_smoke.Parent = part8
  138.  
  139. part9 = Instance.new("Part")
  140. part9.Name = "part9"
  141. part9.Color = Color3.new(117, 0, 0)
  142. part9.Material = Enum.Material.Plastic
  143. part9.Size = Vector3.new(0.24, 0.27, 0.54)
  144. part9.Position = Vector3.new(-9.543, 4.891, 19.086)
  145. part9.Orientation = Vector3.new(0, 180, -3.64)
  146. part9.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  147. part9.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  148. part9.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  149. part9.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  150. part9.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  151. part9.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  152. part9_surface_GUI = Instance.new("SurfaceGui")
  153. part9_surface_GUI.Face = Enum.NormalId.Top
  154. part9_surface_GUI.CanvasSize = Vector2.new(800, 600)
  155. part9_surface_GUI.Parent = part9
  156. part9_textlabel = Instance.new("TextLabel")
  157. part9_textlabel.Parent = part9_surface_GUI
  158. part9_textlabel.BackgroundTransparency = 1
  159. part9_textlabel.BorderSizePixel = 1
  160. part9_textlabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  161. part9_textlabel.Text = "C-137"
  162. part9_textlabel.TextScaled = false
  163. part9_textlabel.TextSize = 100
  164. part9_textlabel.TextStrokeTransparency = 1
  165. part9_textlabel.Size = UDim2.new(1, 0, 1, 0) -- {1, 0},{1, 0}
  166. part9.Parent = portal_gun
  167.  
  168. part10 = Instance.new("Part")
  169. part10.Name = "part10"
  170. part10.Color = Color3.fromRGB(0, 255, 0)
  171. part10.Material = Enum.Material.Neon
  172. part10.Size = Vector3.new(0.2, 0.31, 0.2)
  173. part10.Position = Vector3.new(-8.715, 4.919, 19.456)
  174. part10.Orientation = Vector3.new(0, 180, -3.64)
  175. part10.Shape = Enum.PartType.Cylinder
  176. part10.Parent = portal_gun
  177.  
  178. part11 = Instance.new("Part")
  179. part11.Name = "part11"
  180. part11.Color = Color3.fromRGB(0, 255, 0)
  181. part11.Size = Vector3.new(0.2, 0.31, 0.2)
  182. part11.Position = Vector3.new(-8.715, 4.919, 18.765)
  183. part11.Orientation = Vector3.new(0, 180, -3.64)
  184. part11.Shape = Enum.PartType.Cylinder
  185. part11.Parent = portal_gun
  186.  
  187. part12 = Instance.new("Part")
  188. part12.Name = "part12"
  189. part12.Color = Color3.fromRGB(231, 231, 236)
  190. part12.Material = Enum.Material.Plastic
  191. part12.Size = Vector3.new(1.31, 0.27, 1.03)
  192. part12.Position = Vector3.new(-9.279, 4.886, 19.101)
  193. part12.Orientation = Vector3.new(0, 180, -3.64)
  194. part12.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  195. part12.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  196. part12.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  197. part12.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  198. part12.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  199. part12.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  200. part12.Parent = portal_gun
  201.  
  202. part14 = Instance.new("Part")
  203. part14.Name = "part14"
  204. part14.Color = Color3.fromRGB(231, 231, 236)
  205. part14.Material = Enum.Material.Plastic
  206. part14.Size = Vector3.new(1.04, 0.3, 0.48)
  207. part14.Position = Vector3.new(-9.874, 4.875, 19.095)
  208. part14.Orientation = Vector3.new(-0.02, 90, 0)
  209. part14.Shape = Enum.PartType.Cylinder
  210. part14.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  211. part14.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  212. part14.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  213. part14.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  214. part14.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  215. part14.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  216. part14.Parent = portal_gun
  217.  
  218. portal_gun.GripForward = Vector3.new(0, 0, -1)
  219. portal_gun.GripPos= Vector3.new(0, -0.2, 0)
  220. portal_gun.GripRight = Vector3.new(0, 0, -1)
  221. portal_gun.GripUp = Vector3.new(1, 0.015, 0)
  222.  
  223. portal_sound = Instance.new("Sound")
  224. portal_sound.Parent = portal_gun.Handle
  225. portal_sound.SoundId = "rbxassetid://1013378689"
  226. portal_sound.Volume = 2.5
  227.  
  228. function Weld(x,y)
  229. local W = Instance.new("Weld")
  230. W.Part0 = x
  231. W.Part1 = y
  232. local CJ = CFrame.new(x.Position)
  233. local C0 = x.CFrame:inverse()*CJ
  234. local C1 = y.CFrame:inverse()*CJ
  235. W.C0 = C0
  236. W.C1 = C1
  237. W.Parent = x
  238. end
  239.  
  240. for i,v in pairs(portal_gun:GetChildren()) do
  241. if v:IsA("Part") then
  242. Weld(v, portal_gun.Handle)
  243. end
  244. end
  245.  
  246. portal_gun.Parent = game.Players.LocalPlayer.Backpack
  247.  
  248. rick_portal_GUI = Instance.new("ScreenGui")
  249. rick_portal_GUI.Name = "rick_portal_GUI"
  250. frame = Instance.new("Frame")
  251. frame.Parent = rick_portal_GUI
  252. frame.BackgroundTransparency = 0
  253. textbox = Instance.new("TextBox")
  254. textbox.BorderSizePixel = 0
  255. textbox.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  256. textbox.TextColor3 = Color3.fromRGB(255, 255, 255)
  257. textbox.Size = UDim2.new(0, 310, 0, 40) -- {0, 310},{0, 40}
  258. textbox.Position = UDim2.new(0.12, 5, 3.44, 290) -- {0.12, 5},{3.44, 290}
  259. textbox.Parent = frame
  260. textbox.BackgroundTransparency = 0.5
  261. textbox.TextScaled = true
  262. textbox.Text = "Player name (can be a small part of it)"
  263. rick_portal_GUI.Parent = game.Players.LocalPlayer.PlayerGui
  264.  
  265. function open_portal()
  266. local player_to_teleport_to_name = game.Players.LocalPlayer.PlayerGui.rick_portal_GUI.Frame.TextBox.Text
  267. local player_to_teleport_to = nil
  268. for i,v in pairs(game.Players:GetPlayers()) do
  269. if v.Name:lower():match(player_to_teleport_to_name:lower()) then
  270. player_to_teleport_to = v
  271. end
  272. end
  273. portal_sound:Play()
  274. local portal = Instance.new("Part")
  275. portal.Name = "portal"
  276. portal.Transparency = 1
  277. portal.Size = Vector3.new(6, 8, 0.001)
  278. portal.Orientation = Vector3.new(0, -90, 0)
  279. portal.Parent = workspace
  280. portal.Anchored = true
  281. portal.CanCollide = false
  282. local decal1 = Instance.new("Decal")
  283. decal1.Face = Enum.NormalId.Front
  284. decal1.Texture = "rbxassetid://7493310007"
  285. decal1.Parent = portal
  286. local decal2 = Instance.new("Decal")
  287. decal2.Face = Enum.NormalId.Back
  288. decal2.Texture = "rbxassetid://7493310007"
  289. decal2.Parent = portal
  290. local player_head_position = game.Players.LocalPlayer.Character.Head.Position
  291. portal.Position = Vector3.new(player_head_position.X+5, player_head_position.Y, player_head_position.Z)
  292. local light1 = Instance.new("PointLight")
  293. light1.Parent = portal
  294. light1.Brightness = 7.12
  295. light1.Color = Color3.fromRGB(85, 255, 0)
  296. light1.Range = 9
  297. local function teleport_to_player()
  298. game.Players.LocalPlayer.Character:moveTo(player_to_teleport_to.Character.Head.Position)
  299. local portal2 = Instance.new("Part")
  300. portal2.Name = "portal2"
  301. portal2.Transparency = 1
  302. portal2.Size = Vector3.new(6, 8, 0.001)
  303. portal2.Orientation = Vector3.new(0, -90, 0)
  304. portal2.Parent = workspace
  305. portal2.Anchored = true
  306. portal2.CanCollide = false
  307. local decal12 = Instance.new("Decal")
  308. decal12.Face = Enum.NormalId.Front
  309. decal12.Texture = "rbxassetid://7493310007"
  310. decal12.Parent = portal2
  311. local decal22 = Instance.new("Decal")
  312. decal22.Face = Enum.NormalId.Back
  313. decal22.Texture = "rbxassetid://7493310007"
  314. decal22.Parent = portal2
  315. local player_head_position = game.Players.LocalPlayer.Character.Head.Position
  316. portal2.Position = player_to_teleport_to.Character.Head.Position
  317. local light2 = Instance.new("PointLight")
  318. light2.Parent = portal2
  319. light2.Brightness = 7.12
  320. light2.Color = Color3.fromRGB(85, 255, 0)
  321. light2.Range = 9
  322. portal:Remove()
  323. wait(3)
  324. portal2:Remove()
  325. end
  326. portal.Touched:Connect(teleport_to_player)
  327. end
  328.  
  329. portal_gun.Activated:Connect(open_portal)
  330. end
  331.  
  332. make_portal_gun_and_GUI()
  333.  
  334. while true do
  335. wait(0.1)
  336. if game.Players.LocalPlayer.Character.Humanoid.Health == 0 then
  337. while game.Players.LocalPlayer.Character.Humanoid.Health == 0 do
  338. wait(0.1)
  339. end
  340. wait(2)
  341. make_portal_gun_and_GUI()
  342. end
  343. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement