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