Advertisement
Rawscript

Untitled

Aug 24th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.69 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return self[s]
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126. self._btrs[name] = self.Heartbeat:Connect(fun)
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144. -- Had to use Inferno as a base though, bit lazy to start from complete scratch --
  145. -- [ Rick & Morty!] --
  146. wait()
  147. LoudVolume = false
  148. Submerged = false
  149. Music = true
  150. script.Name = "Rick" -- or Morty.
  151. Player = game.Players.LocalPlayer
  152. c = game.Players.LocalPlayer.Character
  153. Head = c.Head
  154. anim = c.Humanoid.Animator
  155. Humanoid = c:findFirstChild("Humanoid")Humanoid.Name = "InfiniteBeing"
  156. b23 = Instance.new("BoolValue",c)b23.Name = "InfiniteHuman"
  157. rage = false
  158. p = game.Players.LocalPlayer
  159. s = Instance.new("Sound",c.Head)
  160. s.Name = "Rick&MortyMusic"
  161. s.SoundId = "rbxassetid://888185977"
  162. s.Pitch = 1
  163. if LoudVolume == true then s.Volume = 6 else s.Volume = 1 end
  164. s.Looped = true
  165. wait(0.1)
  166. s:play()
  167. Music = false
  168.  
  169. local Effects = {}
  170. attack = false
  171. local attacking = false
  172. vt = Vector3.new
  173. bc = BrickColor.new
  174. br = BrickColor.random
  175. it = Instance.new
  176. cf = CFrame.new
  177. euler = CFrame.fromEulerAnglesXYZ
  178. angles = CFrame.Angles
  179. matr = math.random
  180. mouse = Player:GetMouse()
  181.  
  182. RSC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  183. RSC1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  184. LSC0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  185. LSC1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  186. RHC0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  187. RHC1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  188. LHC0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  189. LHC1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  190. NC0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  191. NC1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  192. RJC0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  193. RJC1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  194. RS = c.Torso:FindFirstChild("Right Shoulder")
  195. LS = c.Torso:FindFirstChild("Left Shoulder")
  196. RH = c.Torso:FindFirstChild("Right Hip")
  197. LH = c.Torso:FindFirstChild("Left Hip")
  198. RJ = c.HumanoidRootPart:FindFirstChild("RootJoint")
  199. N = c.Torso:FindFirstChild("Neck")
  200. cf = CFrame.new
  201. ang = CFrame.Angles
  202. rd = math.rad
  203. rd2 = math.random
  204.  
  205.  
  206. function swait(num)
  207. if num==0 or num==nil then
  208. game:service'RunService'.Heartbeat:wait(0)
  209. else
  210. for i=0,num do
  211. game:service'RunService'.Heartbeat:wait(0)
  212. end
  213. end
  214. end
  215.  
  216. function lerpz(joint, prop, cfrmz, alp)
  217. joint[prop] = joint[prop]:lerp(cfrmz, alp)
  218. end
  219. function resetlerp()
  220. RJ.C0 = RJC0
  221. RJ.C1 = RJC1
  222. N.C0 = NC0
  223. N.C1 = NC1
  224. RS.C0 = RSC0
  225. RS.C1 = RSC1
  226. LS.C0 = LSC0
  227. LS.C1 = LSC1
  228. RH.C0 = RHC0
  229. RH.C1 = RHC1
  230. LH.C0 = LHC0
  231. LH.C1 = LHC1
  232. end
  233.  
  234. New = function(Object, Parent, Name, Data)
  235. local Object = Instance.new(Object)
  236. for Index, Value in pairs(Data or {}) do
  237. Object[Index] = Value
  238. end
  239. Object.Parent = Parent
  240. Object.Name = Name
  241. return Object
  242. end
  243. -- Les Build a Portal gun shall we?"
  244. function CreatePortalGun()
  245. if c:findFirstChild("PortalGun") == nil then
  246. local m = Instance.new("Model",c)m.Name = "PortalGun"
  247. local P = Instance.new("Part",m)P.Size = Vector3.new(0.6,1,0.4)P.CanCollide = false P.Material = "SmoothPlastic" P.Name = "Base"
  248. local W = Instance.new("Weld",P)W.Part0 = P W.Part1 = c["Right Arm"] W.C0 = CFrame.new(0,1.6,0.6)W.Name = "GunWeld"
  249. local P2 = Instance.new("Part",m)P2.Size = Vector3.new(0.2,0.8,0.2)P2.Material = "SmoothPlastic" P2.Name = "Handle" P2.CanCollide = false
  250. local W2 = Instance.new("Weld",P2)W2.Part0 = P2 W2.Part1 = P W2.C0 = CFrame.new(0,-0.5,0.15)*CFrame.Angles(math.rad(-30),0,0)
  251. local P3 = Instance.new("Part",m)P3.Size = Vector3.new(0.55,0.4,0.2)P3.CanCollide = false P3.Material = "Neon" P3.Name = "FrontLight"
  252. local W3 = Instance.new("Weld",P3)W3.Part0 = P3 W3.Part1 = P W3.C0 = CFrame.new(0,0.31,0)P3.BrickColor = BrickColor.new("Bright green")
  253. local P4 = Instance.new("Part",m)P4.Size = Vector3.new(0.2,0.2,0.4)P4.CanCollide = false P4.Material = "Neon" P4.Name = "TopLight" P4.Transparency = 0.5
  254. local W4 = Instance.new("Weld",P4)W4.Part0 = P4 W4.Part1 = P W4.C0 = CFrame.new(0,0,0.35)P4.BrickColor = BrickColor.new("Bright green")
  255. local P5 = Instance.new("Part",m)P5.Size = Vector3.new(0.25,0.25,0.45)P5.CanCollide = false P5.Material = "Neon" P5.Name = "TopLight" P5.Transparency = 0.5
  256. local W5 = Instance.new("Weld",P5)W5.Part0 = P5 W5.Part1 = P4 P5.BrickColor = BrickColor.new("Bright green")
  257. local P5 = Instance.new("Part",m)P5.Size = Vector3.new(0.3,0.3,0.2)P5.CanCollide = false P5.Material = "SmoothPlastic" P5.Name = "LowerLight"
  258. local W5 = Instance.new("Weld",P5)W5.Part0 = P5 W5.Part1 = P4 W5.C0 = CFrame.new(0,0,-0.15)
  259. local P5 = Instance.new("Part",m)P5.Size = Vector3.new(0.3,0.2,0.2)P5.CanCollide = false P5.Material = "SmoothPlastic" P5.Name = "Button"
  260. local W5 = Instance.new("Weld",P5)W5.Part0 = P5 W5.Part1 = P4 W5.C0 = CFrame.new(0,-0.3,-0.2) P5.BrickColor = BrickColor.new("Bright red")
  261. local B = Instance.new("BlockMesh",P5)B.Scale = Vector3.new(1,0.75,0.75)
  262. for i,v in pairs (m:children()) do
  263. if v.ClassName == "Part" then
  264. v.TopSurface = "SmoothNoOutlines"
  265. v.BottomSurface = "SmoothNoOutlines"
  266. v.BackSurface = "SmoothNoOutlines"
  267. v.Front = "SmoothNoOutlines"
  268. v.LeftSurface = "SmoothNoOutlines"
  269. v.RightSurface = "SmoothNoOutlines"
  270. end
  271. end
  272. end
  273. end
  274. function ThrowGun()
  275. if c:findFirstChild("PortalGun")~=nil then
  276. anim.Parent = nil
  277. local gun = c:findFirstChild("PortalGun") gun.Parent = game.Workspace
  278. for i = 1,14 do
  279. swait()
  280. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(65)), 0.25)
  281. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(-65)), 0.25)
  282. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(65), rd(90)), 0.25)
  283. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  284. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  285. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  286. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  287. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  288. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  289. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  290. end
  291. gun.Base.GunWeld:remove()
  292. local BV = Instance.new("BodyVelocity",gun.Base)BV.Velocity = c.HumanoidRootPart.CFrame.lookVector*50 game.Debris:AddItem(BV,0.1)
  293. for i = 1,14 do
  294. swait()
  295. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(-65)), 0.25)
  296. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(65)), 0.25)
  297. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(-65), rd(90)), 0.25)
  298. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  299. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  300. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  301. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  302. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  303. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  304. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  305. end
  306. for i = 1,14 do
  307. swait()
  308. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  309. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  310. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  311. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  312. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  313. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  314. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  315. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  316. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  317. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  318. end
  319. resetlerp()
  320. anim.Parent = Humanoid
  321. end
  322. end
  323. -- ;-; --
  324. function PortalRipple(Portalz, Colorz)
  325. if Portalz == nil then return end
  326. local Portal = Instance.new("Part",game.Workspace)Portal.Transparency = 1 Portal.Anchored = true Portal.CanCollide = false Portal.BrickColor = Colorz Portal.Name = "PortalEnergy"
  327. Portal.CFrame = Portalz.CFrame Portal.Size = Vector3.new(0.25,0.45,0.55) Portal.Material = "Neon" local M = Instance.new("SpecialMesh",Portal)M.MeshType = "Sphere"
  328. Spawn(function()
  329. Portal.Transparency = 0.5
  330. for i = 1,20 do
  331. Portal.Transparency = Portal.Transparency + 0.025
  332. Portal.Size = Portal.Size + Vector3.new(0.39,0.54,-0.01)
  333. Portal.CFrame = Portalz.CFrame
  334. swait()
  335. end
  336. Portal:remove()
  337. end)
  338. end
  339. function CreatePortal1()
  340. Spawn(function()
  341. local Portal = Instance.new("Part",game.Workspace)Portal.Transparency = 1 Portal.Anchored = true Portal.CanCollide = false Portal.BrickColor = BrickColor.new("Lime green")
  342. Portal.CFrame = c.HumanoidRootPart.CFrame*CFrame.new(0,0,-10)Portal.Size = Vector3.new(0.2,0.4,0.2) Portal.Material = "Neon"
  343. local S = Instance.new("Sound", Portal)S.SoundId = "rbxassetid://181004957" S:Play()
  344. if LoudVolume == true then S.Volume = 10 else S.Volume = 2 end
  345. local M = Instance.new("SpecialMesh",Portal)M.MeshType = "Sphere" Portal.Name = "PortalEnergy"
  346. local Portal2 = Instance.new("Part",game.Workspace)Portal2.Transparency = 1 Portal2.Anchored = true Portal2.CanCollide = false Portal2.BrickColor = BrickColor.new("Parsley green")
  347. Portal2.CFrame = c.HumanoidRootPart.CFrame*CFrame.new(0,0,-10)Portal2.Size = Vector3.new(0.2,0.4,0.2) Portal2.Material = "Neon"
  348. local PosP = Portal.CFrame
  349. local M = Instance.new("SpecialMesh",Portal2)M.MeshType = "Sphere" Portal2.Name = "PortalEnergy"
  350. for i = 1,10 do
  351. Portal.Transparency = Portal.Transparency - 0.25
  352. Portal.Size = Portal.Size + Vector3.new(0.65,0.95,0)
  353. Portal.CFrame = PosP
  354. Portal2.Transparency = Portal2.Transparency - 0.25
  355. Portal2.Size = Portal2.Size + Vector3.new(0.63,0.93,0.005)
  356. Portal2.CFrame = PosP
  357. swait()
  358. end
  359. Portal.Touched:connect(function(PartH)
  360. if PartH.Parent ~= c and PartH.Parent.Parent ~= c and PartH.Size.Z <= 200 and PartH.Name ~= "PortalEnergy" then
  361. PartH:remove()
  362. end
  363. end)
  364. local R = 1
  365. for i = 1,100 do
  366. wait(0.1)
  367. if R == 1 then R = 2
  368. PortalRipple(Portal2,BrickColor.new("Earth green"))
  369. elseif R == 2 then R = 1
  370. PortalRipple(Portal2,BrickColor.new("Lime green"))
  371. elseif R == 3 then R = 4
  372. PortalRipple(Portal2,BrickColor.new("Earth green"))
  373. elseif R == 4 then R = 1
  374. PortalRipple(Portal2,BrickColor.new("Lime green"))
  375. end
  376. end
  377. for i = 1,10 do
  378. Portal.Transparency = Portal.Transparency + 0.25
  379. Portal.Size = Portal.Size - Vector3.new(0.65,0.95,0)
  380. Portal.CFrame = PosP
  381. Portal2.Transparency = Portal2.Transparency + 0.25
  382. Portal2.Size = Portal2.Size - Vector3.new(0.63,0.93,0.005)
  383. Portal2.CFrame = PosP
  384. swait()
  385. end
  386. end)
  387. end
  388.  
  389. function CreatePortal2()
  390. Spawn(function()
  391. local Portal = Instance.new("Part",game.Workspace)Portal.Transparency = 1 Portal.Anchored = true Portal.CanCollide = false Portal.BrickColor = BrickColor.new("Lime green")
  392. Portal.CFrame = c.HumanoidRootPart.CFrame*CFrame.new(0,-3,0)*CFrame.Angles(math.rad(-90),0,0)Portal.Size = Vector3.new(0.2,0.4,0.2) Portal.Material = "Neon"
  393. local M = Instance.new("SpecialMesh",Portal)M.MeshType = "Sphere" Portal.Name = "PortalEnergy"
  394. local S = Instance.new("Sound", Portal)S.SoundId = "rbxassetid://477163697" S:Play()
  395. if LoudVolume == true then S.Volume = 10 else S.Volume = 2 end
  396. local Portal2 = Instance.new("Part",game.Workspace)Portal2.Transparency = 1 Portal2.Anchored = true Portal2.CanCollide = false Portal2.BrickColor = BrickColor.new("Parsley green")
  397. Portal2.CFrame = c.HumanoidRootPart.CFrame*CFrame.new(0,-3,0)*CFrame.Angles(math.rad(-90),0,0)Portal2.Size = Vector3.new(0.2,0.4,0.2) Portal2.Material = "Neon"
  398. local PosP = Portal.CFrame
  399. local M = Instance.new("SpecialMesh",Portal2)M.MeshType = "Sphere" Portal2.Name = "PortalEnergy"
  400. for i = 1,10 do
  401. Portal.Transparency = Portal.Transparency - 0.25
  402. Portal.Size = Portal.Size + Vector3.new(0.65,0.95,0)
  403. Portal.CFrame = PosP
  404. Portal2.Transparency = Portal2.Transparency - 0.25
  405. Portal2.Size = Portal2.Size + Vector3.new(0.63,0.93,0.005)
  406. Portal2.CFrame = PosP
  407. swait()
  408. end
  409. for i = 1,10 do
  410. Portal.Transparency = Portal.Transparency + 0.25
  411. Portal.Size = Portal.Size - Vector3.new(0.65,0.95,0)
  412. Portal.CFrame = PosP
  413. Portal2.Transparency = Portal2.Transparency + 0.25
  414. Portal2.Size = Portal2.Size - Vector3.new(0.63,0.93,0.005)
  415. Portal2.CFrame = PosP
  416. swait()
  417. end
  418. end)
  419. end
  420.  
  421. function CreatePortal3()
  422. Spawn(function()
  423. local Portal = Instance.new("Part",game.Workspace)Portal.Transparency = 1 Portal.Anchored = true Portal.CanCollide = false Portal.BrickColor = BrickColor.new("Lime green")
  424. Portal.CFrame = c.HumanoidRootPart.CFrame*CFrame.new(0,10,0)*CFrame.Angles(math.rad(-90),0,0)Portal.Size = Vector3.new(0.2,0.4,0.2) Portal.Material = "Neon"
  425. local M = Instance.new("SpecialMesh",Portal)M.MeshType = "Sphere" Portal.Name = "PortalEnergy"
  426. local Portal2 = Instance.new("Part",game.Workspace)Portal2.Transparency = 1 Portal2.Anchored = true Portal2.CanCollide = false Portal2.BrickColor = BrickColor.new("Parsley green")
  427. Portal2.CFrame = c.HumanoidRootPart.CFrame*CFrame.new(0,10,0)*CFrame.Angles(math.rad(-90),0,0)Portal2.Size = Vector3.new(0.2,0.4,0.2) Portal2.Material = "Neon"
  428. local PosP = Portal.CFrame
  429. local M = Instance.new("SpecialMesh",Portal2)M.MeshType = "Sphere" Portal2.Name = "PortalEnergy"
  430. local S = Instance.new("Sound", Portal)S.SoundId = "rbxassetid://181004957" S:Play()
  431. if LoudVolume == true then S.Volume = 10 else S.Volume = 2 end
  432. for i = 1,10 do
  433. Portal.Transparency = Portal.Transparency - 0.25
  434. Portal.Size = Portal.Size + Vector3.new(0.65,0.95,0)
  435. Portal.CFrame = PosP
  436. Portal2.Transparency = Portal2.Transparency - 0.25
  437. Portal2.Size = Portal2.Size + Vector3.new(0.63,0.93,0.005)
  438. Portal2.CFrame = PosP
  439. swait()
  440. end
  441. for i = 1,10 do
  442. Portal.Transparency = Portal.Transparency + 0.25
  443. Portal.Size = Portal.Size - Vector3.new(0.65,0.95,0)
  444. Portal.CFrame = PosP
  445. Portal2.Transparency = Portal2.Transparency + 0.25
  446. Portal2.Size = Portal2.Size - Vector3.new(0.63,0.93,0.005)
  447. Portal2.CFrame = PosP
  448. swait()
  449. end
  450. end)
  451. end
  452.  
  453. function DestructionPortal()
  454. attack = true
  455. anim.Parent = nil
  456. for i = 1,14 do
  457. swait()
  458. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(65)), 0.25)
  459. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(-65)), 0.25)
  460. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(-65), rd(90)), 0.25)
  461. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  462. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  463. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  464. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  465. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  466. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  467. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  468. end
  469. for i = 1,6 do
  470. swait()
  471. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(65)), 0.35)
  472. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(-65)), 0.35)
  473. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(-65), rd(125)), 0.35)
  474. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.35)
  475. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.35)
  476. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.35)
  477. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.35)
  478. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.35)
  479. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.35)
  480. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.35)
  481. end
  482. CreatePortal1()
  483. for i = 1,10 do
  484. swait()
  485. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(65)), 0.25)
  486. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(-65)), 0.25)
  487. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(-65), rd(90)), 0.25)
  488. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  489. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  490. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  491. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  492. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  493. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  494. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  495. end
  496. for i = 1,10 do
  497. swait()
  498. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  499. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  500. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  501. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  502. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  503. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  504. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  505. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  506. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  507. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  508. end
  509. resetlerp()
  510. attack = false
  511. anim.Parent = Humanoid
  512. end
  513. Disappeared = false
  514. function DisappearPortal()
  515. if Disappeared == false then
  516. attack = true Humanoid.WalkSpeed = 150 Humanoid.JumpPower = 250
  517. Disappeared = true
  518. anim.Parent = nil
  519. for i = 1,14 do
  520. swait()
  521. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  522. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(45), rd(0), rd(0)), 0.25)
  523. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(15), rd(0), rd(15)), 0.25)
  524. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  525. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  526. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  527. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  528. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  529. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  530. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  531. end
  532. for i = 1,8 do
  533. swait()
  534. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  535. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(45), rd(0), rd(0)), 0.5)
  536. lerpz(RS, "C0", RSC0 * cf(0, 0.5, 0) * ang(rd(15), rd(0), rd(15)), 0.5)
  537. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  538. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  539. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  540. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  541. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  542. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  543. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  544. end
  545. CreatePortal2()
  546. for i = 1,14 do
  547. swait()
  548. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  549. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(45), rd(0), rd(0)), 0.25)
  550. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(15), rd(0), rd(15)), 0.25)
  551. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  552. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  553. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  554. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  555. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  556. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  557. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  558. end
  559. lerpz(RJ, "C0", RJC0 * cf(0, 0, 1000000) * ang(rd(0), rd(0), rd(0)), 1)
  560. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(45), rd(0), rd(0)), 1)
  561. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(15), rd(0), rd(15)), 1)
  562. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  563. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  564. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  565. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  566. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  567. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  568. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  569. attack = false
  570. anim.Parent = Humanoid
  571. else Disappeared = false
  572. resetlerp() Humanoid.WalkSpeed = 16 Humanoid.JumpPower = 50
  573. CreatePortal3() wait()
  574. c.HumanoidRootPart.CFrame = c.HumanoidRootPart.CFrame*CFrame.new(0,10,0)
  575. end
  576. end
  577.  
  578. function EpicLaugh()
  579. for i = 1,5 do
  580. local S = Instance.new("Sound",c.Head)S.SoundId = "rbxassetid://207358216" S.Volume = 10 S:Play()
  581. end
  582. for i = 1,35 do
  583. swait()
  584. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(-15), rd(0), rd(0)), 0.25)
  585. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(-15), rd(0), rd(0)), 0.25)
  586. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(-35), rd(0), rd(180)), 0.25)
  587. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  588. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(-35), rd(0), rd(-180)), 0.25)
  589. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  590. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(-15), rd(0), rd(-25)), 0.25)
  591. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  592. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(-15), rd(0), rd(25)), 0.25)
  593. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.25)
  594. end
  595. for i = 1,100 do
  596. swait()
  597. lerpz(RJ, "C0", RJC0 * cf(0, 0, -2) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  598. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  599. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  600. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  601. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  602. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  603. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  604. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  605. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  606. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(math.random(-360,360)), rd(math.random(-360,360)), rd(math.random(-360,360))), 1)
  607. end
  608. resetlerp()
  609. end
  610.  
  611. function MuteMusic()
  612. if s.Volume > 0 then
  613. s.Volume = 0
  614. else
  615. if LoudVolume == true then
  616. s.Volume = 6
  617. else
  618. s.Volume = 1
  619. end
  620. end
  621. end
  622.  
  623. mouse.KeyDown:connect(function(key)
  624. if attack == true then return end
  625. if c:findFirstChild("PortalGun")~=nil then
  626. if Disappeared == false then
  627. if key == "z" then
  628. DestructionPortal()
  629. end
  630. end
  631. if key == "x" then
  632. DisappearPortal()
  633. end
  634. end
  635. if Disappeared == false then
  636. if key == "q" then
  637. CreatePortalGun()
  638. end
  639. if key == "e" then
  640. ThrowGun()
  641. end
  642. end
  643. if key == "l" then
  644. MuteMusic()
  645. end
  646. if key == "m" then
  647. EpicLaugh()
  648. end
  649. end)
  650.  
  651. game:GetService("RunService").RenderStepped:connect(function()
  652. Humanoid.MaxHealth = Humanoid.MaxHealth*2
  653. Humanoid.Health = Humanoid.MaxHealth*2
  654. for i,v in pairs (c:children()) do
  655. if v.ClassName == "Accessory" then
  656. for i,v2 in pairs (v:children()) do
  657. if v2.ClassName == "Part" then
  658. v2.Anchored = false
  659. end
  660. end
  661. end
  662. end
  663. for i,v in pairs (c:children()) do
  664. if v.ClassName == "Part" then
  665. v.Anchored = false
  666. end
  667. end
  668. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement