SHOW:
|
|
- or go back to the newest paste.
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,Mouse,mouse,UserInputService,ContextActionService = owner | |
3 | do | |
4 | print("FE Compatibility code by Mokiros") | |
5 | script.Parent = Player.Character | |
6 | ||
7 | --RemoteEvent for communicating | |
8 | local Event = Instance.new("RemoteEvent") | |
9 | Event.Name = "UserInput_Event" | |
10 | ||
11 | --Fake event to make stuff like Mouse.KeyDown work | |
12 | local function fakeEvent() | |
13 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
14 | t.connect = t.Connect | |
15 | return t | |
16 | end | |
17 | ||
18 | --Creating fake input objects with fake variables | |
19 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
20 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
21 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
22 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
23 | end} | |
24 | --Merged 2 functions into one by checking amount of arguments | |
25 | CAS.UnbindAction = CAS.BindAction | |
26 | ||
27 | --This function will trigger the events that have been :Connect()'ed | |
28 | local function te(self,ev,...) | |
29 | local t = m[ev] | |
30 | if t and t._fakeEvent and t.Function then | |
31 | t.Function(...) | |
32 | end | |
33 | end | |
34 | m.TrigEvent = te | |
35 | UIS.TrigEvent = te | |
36 | ||
37 | Event.OnServerEvent:Connect(function(plr,io) | |
38 | if plr~=Player then return end | |
39 | if io.isMouse then | |
40 | m.Target = io.Target | |
41 | m.Hit = io.Hit | |
42 | else | |
43 | local b = io.UserInputState == Enum.UserInputState.Begin | |
44 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
45 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
46 | end | |
47 | for _,t in pairs(CAS.Actions) do | |
48 | for _,k in pairs(t.Keys) do | |
49 | if k==io.KeyCode then | |
50 | t.Function(t.Name,io.UserInputState,io) | |
51 | end | |
52 | end | |
53 | end | |
54 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
55 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
56 | end | |
57 | end) | |
58 | Event.Parent = NLS([==[ | |
59 | local Player = game:GetService("Players").LocalPlayer | |
60 | local Event = script:WaitForChild("UserInput_Event") | |
61 | ||
62 | local UIS = game:GetService("UserInputService") | |
63 | local input = function(io,a) | |
64 | if a then return end | |
65 | --Since InputObject is a client-side instance, we create and pass table instead | |
66 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
67 | end | |
68 | UIS.InputBegan:Connect(input) | |
69 | UIS.InputEnded:Connect(input) | |
70 | ||
71 | local Mouse = Player:GetMouse() | |
72 | local h,t | |
73 | --Give the server mouse data 30 times every second, but only if the values changed | |
74 | --If player is not moving their mouse, client won't fire events | |
75 | while wait(1/30) do | |
76 | if h~=Mouse.Hit or t~=Mouse.Target then | |
77 | h,t=Mouse.Hit,Mouse.Target | |
78 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
79 | end | |
80 | end]==],Player.Character) | |
81 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
82 | end | |
83 | -- Created by Nebula_Zorua -- | |
84 | -- Sans Curse (A Curse of Light) -- | |
85 | -- Custom Arcane Adventures Magic -- | |
86 | -- Wielder: Everybody (Released) -- | |
87 | -- Why the fuck did I make this -- | |
88 | -- I don't even LIKE undertale -- | |
89 | -- what the fuck -- | |
90 | ||
91 | -- Discord: Nebula the Zorua#6969 | |
92 | -- Youtube: https://www.youtube.com/channel/UCo9oU9dCw8jnuVLuy4_SATA | |
93 | ||
94 | -- You can change the Magic Circle n stuff down under Customization, at MagicVariant -- | |
95 | ||
96 | ||
97 | --// Shortcut Variables \\-- | |
98 | local S = setmetatable({},{__index = function(s,i) return game:service(i) end}) | |
99 | local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ} | |
100 | local C3 = {N=Color3.new,RGB=Color3.fromRGB,HSV=Color3.fromHSV,tHSV=Color3.toHSV} | |
101 | local V3 = {N=Vector3.new,FNI=Vector3.FromNormalId,A=Vector3.FromAxis} | |
102 | local M = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge,RRNG = function(min,max,div) return math.rad(math.random(min,max)/(div or 1)) end} | |
103 | local R3 = {N=Region3.new} | |
104 | local De = S.Debris | |
105 | local WS = workspace | |
106 | local Lght = S.Lighting | |
107 | local RepS = S.ReplicatedStorage | |
108 | local IN = Instance.new | |
109 | local Plrs = S.Players | |
110 | ||
111 | - | local kan = Instance.new("Sound") kan.Volume = 6 kan.SoundId = "rbxassetid://316014309" kan.Looped = true kan.Parent = owner.Character.Torso kan:Play() |
111 | + | local kan = Instance.new("Sound") kan.Volume = 6 kan.SoundId = "rbxassetid://2680005296" kan.Looped = true kan.Parent = owner.Character.Torso kan:Play() |
112 | ||
113 | local Emit = IN("ParticleEmitter").Emit; | |
114 | ||
115 | --// Initializing \\-- | |
116 | local Plr = owner | |
117 | local Char = Plr.Character | |
118 | local Hum = Char:FindFirstChildOfClass'Humanoid' | |
119 | local RArm = Char["Right Arm"] | |
120 | local LArm = Char["Left Arm"] | |
121 | local RLeg = Char["Right Leg"] | |
122 | local LLeg = Char["Left Leg"] | |
123 | local Root = Char:FindFirstChild'HumanoidRootPart' | |
124 | local Torso = Char.Torso | |
125 | local Head = Char.Head | |
126 | local NeutralAnims = true | |
127 | local Attack = false | |
128 | local Debounces = {Debounces={}} | |
129 | local Hit = {} | |
130 | local Sine = 0 | |
131 | local Change = 1 | |
132 | ||
133 | local Effects = IN("Folder",Char) | |
134 | Effects.Name = "Effects" | |
135 | ||
136 | ||
137 | --// Debounce System \\-- | |
138 | ||
139 | ||
140 | function Debounces:New(name,cooldown) | |
141 | local aaaaa = {Usable=true,Cooldown=cooldown or 2,CoolingDown=false,LastUse=0} | |
142 | setmetatable(aaaaa,{__index = Debounces}) | |
143 | Debounces.Debounces[name] = aaaaa | |
144 | return aaaaa | |
145 | end | |
146 | ||
147 | function Debounces:Use(overrideUsable) | |
148 | assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use") | |
149 | if(self.Usable or overrideUsable)then | |
150 | self.Usable = false | |
151 | self.CoolingDown = true | |
152 | local LastUse = time() | |
153 | self.LastUse = LastUse | |
154 | delay(self.Cooldown or 2,function() | |
155 | if(self.LastUse == LastUse)then | |
156 | self.CoolingDown = false | |
157 | self.Usable = true | |
158 | end | |
159 | end) | |
160 | end | |
161 | end | |
162 | ||
163 | function Debounces:Get(name) | |
164 | assert(typeof(name) == 'string',("bad argument #1 to 'get' (string expected, got %s)"):format(typeof(name) == nil and "no value" or typeof(name))) | |
165 | for i,v in next, Debounces.Debounces do | |
166 | if(i == name)then | |
167 | return v; | |
168 | end | |
169 | end | |
170 | end | |
171 | ||
172 | function Debounces:GetProgressPercentage() | |
173 | assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use") | |
174 | if(self.CoolingDown and not self.Usable)then | |
175 | return math.max( | |
176 | math.floor( | |
177 | ( | |
178 | (time()-self.LastUse)/self.Cooldown or 2 | |
179 | )*100 | |
180 | ) | |
181 | ) | |
182 | else | |
183 | return 100 | |
184 | end | |
185 | end | |
186 | ||
187 | --// Instance Creation Functions \\-- | |
188 | ||
189 | function Sound(parent,id,pitch,volume,looped,effect,autoPlay) | |
190 | local Sound = IN("Sound") | |
191 | Sound.SoundId = "rbxassetid://".. tostring(id or 0) | |
192 | Sound.Pitch = pitch or 1 | |
193 | Sound.Volume = volume or 1 | |
194 | Sound.Looped = looped or false | |
195 | if(autoPlay)then | |
196 | coroutine.wrap(function() | |
197 | repeat wait() until Sound.IsLoaded | |
198 | Sound.Playing = autoPlay or false | |
199 | end)() | |
200 | end | |
201 | if(not looped and effect)then | |
202 | Sound.Stopped:connect(function() | |
203 | Sound.Volume = 0 | |
204 | Sound:destroy() | |
205 | end) | |
206 | elseif(effect)then | |
207 | warn("Sound can't be looped and a sound effect!") | |
208 | end | |
209 | Sound.Parent =parent or Torso | |
210 | return Sound | |
211 | end | |
212 | function Part(parent,color,material,size,cframe,anchored,cancollide) | |
213 | local part = IN("Part") | |
214 | part.Parent = parent or Char | |
215 | part[typeof(color) == 'BrickColor' and 'BrickColor' or 'Color'] = color or C3.N(0,0,0) | |
216 | part.Material = material or Enum.Material.SmoothPlastic | |
217 | part.TopSurface,part.BottomSurface=10,10 | |
218 | part.Size = size or V3.N(1,1,1) | |
219 | part.CFrame = cframe or CF.N(0,0,0) | |
220 | part.CanCollide = cancollide or false | |
221 | part.Anchored = anchored or false | |
222 | return part | |
223 | end | |
224 | ||
225 | function Weld(part0,part1,c0,c1) | |
226 | local weld = IN("Weld") | |
227 | weld.Parent = part0 | |
228 | weld.Part0 = part0 | |
229 | weld.Part1 = part1 | |
230 | weld.C0 = c0 or CF.N() | |
231 | weld.C1 = c1 or CF.N() | |
232 | return weld | |
233 | end | |
234 | ||
235 | function Mesh(parent,meshtype,meshid,textid,scale,offset) | |
236 | local part = IN("SpecialMesh") | |
237 | part.MeshId = meshid or "" | |
238 | part.TextureId = textid or "" | |
239 | part.Scale = scale or V3.N(1,1,1) | |
240 | part.Offset = offset or V3.N(0,0,0) | |
241 | part.MeshType = meshtype or Enum.MeshType.Sphere | |
242 | part.Parent = parent | |
243 | return part | |
244 | end | |
245 | ||
246 | NewInstance = function(instance,parent,properties) | |
247 | local inst = Instance.new(instance) | |
248 | inst.Parent = parent | |
249 | if(properties)then | |
250 | for i,v in next, properties do | |
251 | pcall(function() inst[i] = v end) | |
252 | end | |
253 | end | |
254 | return inst; | |
255 | end | |
256 | ||
257 | function Clone(instance,parent,properties) | |
258 | local inst = instance:Clone() | |
259 | inst.Parent = parent | |
260 | if(properties)then | |
261 | for i,v in next, properties do | |
262 | pcall(function() inst[i] = v end) | |
263 | end | |
264 | end | |
265 | return inst; | |
266 | end | |
267 | ||
268 | function SoundPart(id,pitch,volume,looped,effect,autoPlay,cf) | |
269 | local soundPart = NewInstance("Part",Effects,{Transparency=1,CFrame=cf or Torso.CFrame,Anchored=true,CanCollide=false,Size=V3.N()}) | |
270 | local Sound = IN("Sound") | |
271 | Sound.SoundId = "rbxassetid://".. tostring(id or 0) | |
272 | Sound.Pitch = pitch or 1 | |
273 | Sound.Volume = volume or 1 | |
274 | Sound.Looped = looped or false | |
275 | if(autoPlay)then | |
276 | coroutine.wrap(function() | |
277 | repeat wait() until Sound.IsLoaded | |
278 | Sound.Playing = autoPlay or false | |
279 | end)() | |
280 | end | |
281 | if(not looped and effect)then | |
282 | Sound.Stopped:connect(function() | |
283 | Sound.Volume = 0 | |
284 | soundPart:destroy() | |
285 | end) | |
286 | elseif(effect)then | |
287 | warn("Sound can't be looped and a sound effect!") | |
288 | end | |
289 | Sound.Parent = soundPart | |
290 | return Sound | |
291 | end | |
292 | ||
293 | ||
294 | --// Extended ROBLOX tables \\-- | |
295 | local Instance = setmetatable({ClearChildrenOfClass = function(where,class,recursive) local children = (recursive and where:GetDescendants() or where:GetChildren()) for _,v in next, children do if(v:IsA(class))then v:destroy();end;end;end},{__index = Instance}) | |
296 | --// Require stuff \\-- | |
297 | function CamShake(who,times,intense,origin) | |
298 | coroutine.wrap(function() | |
299 | if(script:FindFirstChild'CamShake')then | |
300 | local cam = script.CamShake:Clone() | |
301 | cam:WaitForChild'intensity'.Value = intense | |
302 | cam:WaitForChild'times'.Value = times | |
303 | ||
304 | if(origin)then NewInstance((typeof(origin) == 'Instance' and "ObjectValue" or typeof(origin) == 'Vector3' and 'Vector3Value'),cam,{Name='origin',Value=origin}) end | |
305 | cam.Parent = who | |
306 | wait() | |
307 | cam.Disabled = false | |
308 | elseif(who == Plr or who == Char)then | |
309 | local intensity = intense | |
310 | local cam = workspace.CurrentCamera | |
311 | for i = 1, times do | |
312 | local camDistFromOrigin | |
313 | if(typeof(origin) == 'Instance' and origin:IsA'BasePart')then | |
314 | camDistFromOrigin = math.floor( (cam.CFrame.p-origin.Position).magnitude )/25 | |
315 | elseif(typeof(origin) == 'Vector3')then | |
316 | camDistFromOrigin = math.floor( (cam.CFrame.p-origin).magnitude )/25 | |
317 | end | |
318 | if(camDistFromOrigin)then | |
319 | intensity = math.min(intense, math.floor(intense/camDistFromOrigin)) | |
320 | end | |
321 | cam.CFrame = cam.CFrame:lerp(cam.CFrame*CFrame.new(math.random(-intensity,intensity)/100,math.random(-intensity,intensity)/100,math.random(-intensity,intensity)/100)*CFrame.Angles(math.rad(math.random(-intensity,intensity)/100),math.rad(math.random(-intensity,intensity)/100),math.rad(math.random(-intensity,intensity)/100)),.4) | |
322 | swait() | |
323 | end | |
324 | end | |
325 | end)() | |
326 | end | |
327 | ||
328 | function CamShakeAll(times,intense,origin) | |
329 | for _,v in next, Plrs:players() do | |
330 | CamShake(v:FindFirstChildOfClass'PlayerGui' or v:FindFirstChildOfClass'Backpack' or v.Character,times,intense,origin) | |
331 | end | |
332 | end | |
333 | ||
334 | function ServerScript(code) | |
335 | if(script:FindFirstChild'Loadstring')then | |
336 | local load = script.Loadstring:Clone() | |
337 | load:WaitForChild'Sauce'.Value = code | |
338 | load.Disabled = false | |
339 | load.Parent = workspace | |
340 | elseif(NS and typeof(NS) == 'function')then | |
341 | NS(code,workspace) | |
342 | else | |
343 | warn("no serverscripts lol") | |
344 | end | |
345 | end | |
346 | ||
347 | function RunLocal(where,code) | |
348 | ServerScript([[ | |
349 | wait() | |
350 | script.Parent=nil | |
351 | if(not _G.Http)then _G.Http = game:service'HttpService' end | |
352 | ||
353 | local Http = _G.Http or game:service'HttpService' | |
354 | ||
355 | local source = ]].."[["..code.."]]"..[[ | |
356 | local link = "https://api.vorth.xyz/R_API/R.UPLOAD/NEW_LOCAL.php" | |
357 | local asd = Http:PostAsync(link,source) | |
358 | repeat wait() until asd and Http:JSONDecode(asd) and Http:JSONDecode(asd).Result and Http:JSONDecode(asd).Result.Require_ID | |
359 | local ID = Http:JSONDecode(asd).Result.Require_ID | |
360 | local vs = require(ID).VORTH_SCRIPT | |
361 | vs.Parent = game.]]..where:GetFullName() | |
362 | ) | |
363 | end | |
364 | ||
365 | --// Customization \\-- | |
366 | ||
367 | local Frame_Speed = 60; | |
368 | local WalkSpeed = 16 | |
369 | local DamageColor = BrickColor.new'White' | |
370 | ||
371 | local MagicCircles = { | |
372 | Default = {Color=C3.N(1,1,1),Texture1=0,Texture2=0}, | |
373 | OrangeWarPheonix = {EffectColor=BrickColor.new'Deep orange'.Color,Color=C3.N(.9,.9,.9),Texture1=623153986,Texture2=623153990}, | |
374 | BlueWarPheonix = {EffectColor=BrickColor.new'Teal'.Color,Color=C3.N(.9,.9,.9),Texture1=462499935,Texture2=462499970}, | |
375 | Plasma = {Color=C3.N(0.70588235294118,0,0.8),Texture1=415906687,Texture2=415906702}, | |
376 | Water = {Color=C3.RGB(33, 84, 185),Texture1=408441330,Texture2=408441353}, | |
377 | Earth = {Color=C3.RGB(86, 36, 36),Texture1=394253616,Texture2=394253651}, | |
378 | Wind = {Color=C3.N(.8,.8,.8),Texture1=376006317,Texture2=376006346}, | |
379 | Poseidon = {Color=C3.RGB(71, 99, 130),Texture1=346727970,Texture2=346727994}, | |
380 | AetherLightning = {Color=C3.RGB(23, 255, 197),Texture1=348320016,Texture2=348320030}, | |
381 | Light = {Color=C3.N(1,1,0),Texture1=343192085,Texture2=343192112}, | |
382 | Fire = {Color=C3.N(1,0,0),EffectColor=BrickColor.new'Bright red'.Color,Texture1=313945544,Texture2=313945673}, | |
383 | Lightning = {Color=C3.N(0,1,1),Texture1=314842290,Texture2=314842440}, | |
384 | GasterBlaster = {Color=C3.N(1,1,1),Texture1=331948662,Texture2=331948662} | |
385 | } | |
386 | ||
387 | local MagicVariant = MagicCircles.GasterBlaster --[[ You can change this for a different element | |
388 | Example: | |
389 | ||
390 | Changing MagicCircles.GasterBlaster to MagicCircles.Light | |
391 | ||
392 | would make it a Light Element | |
393 | ]] | |
394 | ||
395 | --// Stop animations \\-- | |
396 | for _,v in next, Hum:GetPlayingAnimationTracks() do | |
397 | v:Stop(); | |
398 | end | |
399 | ||
400 | pcall(game.Destroy,Char:FindFirstChild'Animate') | |
401 | pcall(game.Destroy,Hum:FindFirstChild'Animator') | |
402 | ||
403 | --// Joints \\-- | |
404 | ||
405 | local LS = NewInstance('Motor',Char,{Part0=Torso,Part1=LArm,C0 = CF.N(-1.5,0.5,0),C1 = CF.N(0,.5,0)}) | |
406 | local RS = NewInstance('Motor',Char,{Part0=Torso,Part1=RArm,C0 = CF.N(1.5,0.5,0),C1 = CF.N(0,.5,0)}) | |
407 | local NK = NewInstance('Motor',Char,{Part0=Torso,Part1=Head,C0 = CF.N(0,1.5,0)}) | |
408 | local LH = NewInstance('Motor',Char,{Part0=Torso,Part1=LLeg,C0 = CF.N(-.5,-1,0),C1 = CF.N(0,1,0)}) | |
409 | local RH = NewInstance('Motor',Char,{Part0=Torso,Part1=RLeg,C0 = CF.N(.5,-1,0),C1 = CF.N(0,1,0)}) | |
410 | local RJ = NewInstance('Motor',Char,{Part0=Root,Part1=Torso}) | |
411 | ||
412 | local LSC0 = LS.C0 | |
413 | local RSC0 = RS.C0 | |
414 | local NKC0 = NK.C0 | |
415 | local LHC0 = LH.C0 | |
416 | local RHC0 = RH.C0 | |
417 | local RJC0 = RJ.C0 | |
418 | ||
419 | --// Artificial HB \\-- | |
420 | ||
421 | local ArtificialHB = IN("BindableEvent", script) | |
422 | ArtificialHB.Name = "Heartbeat" | |
423 | ||
424 | script:WaitForChild("Heartbeat") | |
425 | ||
426 | local tf = 0 | |
427 | local allowframeloss = false | |
428 | local tossremainder = false | |
429 | local lastframe = tick() | |
430 | local frame = 1/Frame_Speed | |
431 | ArtificialHB:Fire() | |
432 | ||
433 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
434 | tf = tf + s | |
435 | if tf >= frame then | |
436 | if allowframeloss then | |
437 | script.Heartbeat:Fire() | |
438 | lastframe = tick() | |
439 | else | |
440 | for i = 1, math.floor(tf / frame) do | |
441 | ArtificialHB:Fire() | |
442 | end | |
443 | lastframe = tick() | |
444 | end | |
445 | if tossremainder then | |
446 | tf = 0 | |
447 | else | |
448 | tf = tf - frame * math.floor(tf / frame) | |
449 | end | |
450 | end | |
451 | end) | |
452 | ||
453 | function swait(num) | |
454 | if num == 0 or num == nil then | |
455 | ArtificialHB.Event:wait() | |
456 | else | |
457 | for i = 0, num do | |
458 | ArtificialHB.Event:wait() | |
459 | end | |
460 | end | |
461 | end | |
462 | ||
463 | ||
464 | --// Effect Function(s) \\-- | |
465 | ||
466 | function NumSeq(...) | |
467 | local tab = {...} | |
468 | local Sequence = {} | |
469 | for _,v in next, tab do | |
470 | table.insert(Sequence,NumberSequenceKeypoint.new(unpack(v))) | |
471 | end | |
472 | if(tab[#tab][1] ~= 1)then | |
473 | local final = tab[#tab] | |
474 | table.insert(Sequence,NumberSequenceKeypoint.new(1,final[2],final[3])) | |
475 | end | |
476 | return NumberSequence.new(Sequence) | |
477 | end | |
478 | ||
479 | local DefaultRingParticle = IN("ParticleEmitter") | |
480 | DefaultRingParticle.Name = 'RingEmit' | |
481 | DefaultRingParticle.LightEmission = 1 | |
482 | DefaultRingParticle.Size = NumSeq({0,0},{.7,6.28},{.8,5.03},{1,2.9}) | |
483 | DefaultRingParticle.Texture = "rbxassetid://313951123" | |
484 | DefaultRingParticle.Transparency = NumberSequence.new(0,1) | |
485 | DefaultRingParticle.ZOffset = 1 | |
486 | DefaultRingParticle.Drag = 0 | |
487 | DefaultRingParticle.Acceleration = V3.N() | |
488 | DefaultRingParticle.LockedToPart = true | |
489 | DefaultRingParticle.Enabled = false | |
490 | DefaultRingParticle.Lifetime = NumberRange.new(.6,.6) | |
491 | DefaultRingParticle.Rate = 5 | |
492 | DefaultRingParticle.Rotation = NumberRange.new(0,0) | |
493 | DefaultRingParticle.RotSpeed = NumberRange.new(0,0) | |
494 | DefaultRingParticle.Speed = NumberRange.new(0,0) | |
495 | DefaultRingParticle.SpreadAngle = Vector2.new(0,0) | |
496 | ||
497 | function MagicCircle(Data) | |
498 | local Variant = Data.Variant or MagicCircles.Default; | |
499 | ||
500 | local Size = Data.Size or 10; | |
501 | local Pos = Data.Pos*CF.A(M.R(-90),M.R(-90),0) or Torso.CFrame*CF.A(M.R(-90),M.R(-90),0); | |
502 | local GrowTime = Data.Time or 1; | |
503 | ||
504 | local WeldData = Data.Weld or false; | |
505 | ||
506 | ||
507 | local Color = Variant.Color or C3.N(.9,.9,.0) | |
508 | ||
509 | local CreationParticle = Data.CreationParticle or DefaultRingParticle; | |
510 | ||
511 | ||
512 | local Circle = Part(Effects,BrickColor.new'Maroon',Enum.Material.SmoothPlastic,V3.N(.05,.05,.05),Pos,true,false) | |
513 | local CircleM = NewInstance("BlockMesh",Circle,{Scale=V3.N()}) | |
514 | ||
515 | ||
516 | local Emitter = DefaultRingParticle:Clone(); | |
517 | Emitter.Parent = Circle | |
518 | Emitter.Color = ColorSequence.new(Variant.Color) | |
519 | ||
520 | local Top = IN("Decal",Circle) | |
521 | Top.Texture = "rbxassetid://"..Variant.Texture1 | |
522 | Top.Face = Enum.NormalId.Top | |
523 | ||
524 | local Btm = IN("Decal",Circle) | |
525 | Btm.Texture = "rbxassetid://"..Variant.Texture2 | |
526 | Btm.Face = Enum.NormalId.Bottom | |
527 | ||
528 | if(WeldData)then | |
529 | Circle.Anchored = false | |
530 | Weld(WeldData,Circle,Pos,CF.N()) | |
531 | end | |
532 | local GrowFrames = GrowTime * Frame_Speed | |
533 | print(GrowFrames) | |
534 | --Size*20,0,Size*20 | |
535 | Circle.Transparency = 1 | |
536 | local GrownEvent = Instance.new("BindableEvent",Circle) | |
537 | coroutine.wrap(function() | |
538 | ||
539 | Emit(Emitter,5) | |
540 | local End = Size*20 | |
541 | local grow = End/GrowFrames | |
542 | for i = 1, GrowFrames+1 do | |
543 | local aa = math.min(CircleM.Scale.x + grow,End) | |
544 | if(aa >= End)then break end | |
545 | CircleM.Scale = V3.N(aa,0,aa) | |
546 | swait() | |
547 | end | |
548 | CircleM.Scale = V3.N(End,0,End) | |
549 | GrownEvent:Fire() | |
550 | ||
551 | end)() | |
552 | ||
553 | local Table = { | |
554 | Circle = Circle, | |
555 | Mesh = CircleM, | |
556 | Grow = function(size) | |
557 | CircleM.Scale = CircleM.Scale + V3.N(size*20,0,size*20) | |
558 | end, | |
559 | Destroy = function(timer) | |
560 | coroutine.wrap(function() | |
561 | if(not timer)then timer = 1 end | |
562 | Tween(CircleM,{Scale=V3.N(0,0,0)},timer,Enum.EasingStyle.Quad,Enum.EasingDirection.Out) | |
563 | Tween(Top,{Transparency=1},timer,Enum.EasingStyle.Quad,Enum.EasingDirection.Out) | |
564 | Tween(Btm,{Transparency=1},timer,Enum.EasingStyle.Quad,Enum.EasingDirection.Out) | |
565 | S.Debris:AddItem(Circle,timer+1) | |
566 | end)() | |
567 | end, | |
568 | Grown = GrownEvent.Event | |
569 | } | |
570 | ||
571 | return Table; | |
572 | end | |
573 | ||
574 | function Bezier(startpos, pos2, pos3, endpos, t) | |
575 | local A = startpos:lerp(pos2, t) | |
576 | local B = pos2:lerp(pos3, t) | |
577 | local C = pos3:lerp(endpos, t) | |
578 | local lerp1 = A:lerp(B, t) | |
579 | local lerp2 = B:lerp(C, t) | |
580 | local cubic = lerp1:lerp(lerp2, t) | |
581 | return cubic | |
582 | end | |
583 | ||
584 | function SphereFX(duration,color,scale,pos,endScale,increment) | |
585 | return Effect{ | |
586 | Frames=duration, | |
587 | Effect='ResizeAndFade', | |
588 | Color=color, | |
589 | Size=scale, | |
590 | Mesh={MeshType=Enum.MeshType.Sphere}, | |
591 | CFrame=pos, | |
592 | FXSettings={ | |
593 | EndSize=endScale, | |
594 | EndIsIncrement=increment | |
595 | } | |
596 | } | |
597 | end | |
598 | ||
599 | function BlastFX(duration,color,scale,pos,endScale,increment) | |
600 | return Effect{ | |
601 | Frames=duration, | |
602 | Effect='ResizeAndFade', | |
603 | Color=color, | |
604 | Size=scale, | |
605 | Mesh={MeshType=Enum.MeshType.FileMesh,MeshId='rbxassetid://20329976'}, | |
606 | CFrame=pos, | |
607 | FXSettings={ | |
608 | EndSize=endScale, | |
609 | EndIsIncrement=increment | |
610 | } | |
611 | } | |
612 | end | |
613 | ||
614 | function BlockFX(duration,color,scale,pos,endScale,increment) | |
615 | return Effect{ | |
616 | Frames=duration, | |
617 | Effect='ResizeAndFade', | |
618 | Color=color, | |
619 | Size=scale, | |
620 | CFrame=pos, | |
621 | FXSettings={ | |
622 | EndSize=endScale, | |
623 | EndIsIncrement=increment | |
624 | } | |
625 | } | |
626 | end | |
627 | ||
628 | function ShootBullet(data) | |
629 | --ShootBullet{Size=V3.N(3,3,3),Shape='Ball',Frames=160,Origin=data.Circle.CFrame,Speed=10} | |
630 | local Size = data.Size or V3.N(2,2,2) | |
631 | local Color = data.Color or MagicVariant.EffectColor or MagicVariant.Color | |
632 | local StudsPerFrame = data.Speed or 10 | |
633 | local Shape = data.Shape or 'Ball' | |
634 | local Frames = data.Frames or 160 | |
635 | local Pos = data.Origin or Torso.CFrame | |
636 | local Direction = data.Direction or Mouse.Hit | |
637 | local Material = data.Material or Enum.Material.Neon | |
638 | local OnHit = data.HitFunction or function(hit,pos) | |
639 | Effect{ | |
640 | Effect='ResizeAndFade', | |
641 | Color=Color, | |
642 | Size=V3.N(10,10,10), | |
643 | Mesh={MeshType=Enum.MeshType.Sphere}, | |
644 | CFrame=CF.N(pos), | |
645 | FXSettings={ | |
646 | EndSize=V3.N(.05,.05,.05), | |
647 | EndIsIncrement=true | |
648 | } | |
649 | } | |
650 | for i = 1, 5 do | |
651 | local angles = CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)) | |
652 | Effect{ | |
653 | Effect='Fade', | |
654 | Frames=65, | |
655 | Size=V3.N(5,5,10), | |
656 | CFrame=CF.N(CF.N(pos)*angles*CF.N(0,0,-10).p,pos), | |
657 | Mesh = {MeshType=Enum.MeshType.Sphere}, | |
658 | Material=Enum.Material.Neon, | |
659 | Color=Color, | |
660 | MoveDirection=CF.N(CF.N(pos)*angles*CF.N(0,0,-50).p,pos).p, | |
661 | } | |
662 | end | |
663 | AOEDamage(pos,10,15,30,0,'Normal',10,4) | |
664 | end | |
665 | ||
666 | local Bullet = Part(Effects,Color,Material,Size,Pos,true,false) | |
667 | local BMesh = Mesh(Bullet,Enum.MeshType.Brick,"","",V3.N(1,1,1),V3.N()) | |
668 | if(Shape == 'Ball')then | |
669 | BMesh.MeshType = Enum.MeshType.Sphere | |
670 | elseif(Shape == 'Head')then | |
671 | BMesh.MeshType = Enum.MeshType.Head | |
672 | elseif(Shape == 'Cylinder')then | |
673 | BMesh.MeshType = Enum.MeshType.Cylinder | |
674 | end | |
675 | ||
676 | coroutine.wrap(function() | |
677 | for i = 1, Frames+1 do | |
678 | local hit,pos,norm,dist = CastRay(Bullet.CFrame.p,CF.N(Bullet.CFrame.p,Direction.p)*CF.N(0,0,-StudsPerFrame).p,StudsPerFrame) | |
679 | if(hit)then | |
680 | OnHit(hit,pos,norm,dist) | |
681 | break; | |
682 | else | |
683 | Bullet.CFrame = CF.N(Bullet.CFrame.p,Direction.p)*CF.N(0,0,-StudsPerFrame) | |
684 | end | |
685 | swait() | |
686 | end | |
687 | Bullet:destroy() | |
688 | end)() | |
689 | ||
690 | end | |
691 | ||
692 | function Zap(data) | |
693 | local sCF,eCF = data.StartCFrame,data.EndCFrame | |
694 | assert(sCF,"You need a start CFrame!") | |
695 | assert(eCF,"You need an end CFrame!") | |
696 | local parts = data.PartCount or 15 | |
697 | local zapRot = data.ZapRotation or {-5,5} | |
698 | local startThick = data.StartSize or 3; | |
699 | local endThick = data.EndSize or startThick/2; | |
700 | local color = data.Color or BrickColor.new'Electric blue' | |
701 | local delay = data.Delay or 35 | |
702 | local delayInc = data.DelayInc or 0 | |
703 | local lastLightning; | |
704 | local MagZ = (sCF.p - eCF.p).magnitude | |
705 | local thick = startThick | |
706 | local inc = (startThick/parts)-(endThick/parts) | |
707 | ||
708 | for i = 1, parts do | |
709 | local pos = sCF.p | |
710 | if(lastLightning)then | |
711 | pos = lastLightning.CFrame*CF.N(0,0,MagZ/parts/2).p | |
712 | end | |
713 | delay = delay + delayInc | |
714 | local zapPart = Part(Effects,color,Enum.Material.Neon,V3.N(thick,thick,MagZ/parts),CF.N(pos),true,false) | |
715 | local posie = CF.N(pos,eCF.p)*CF.N(0,0,MagZ/parts).p+V3.N(M.RNG(unpack(zapRot)),M.RNG(unpack(zapRot)),M.RNG(unpack(zapRot))) | |
716 | if(parts == i)then | |
717 | local MagZ = (pos-eCF.p).magnitude | |
718 | zapPart.Size = V3.N(endThick,endThick,MagZ) | |
719 | zapPart.CFrame = CF.N(pos, eCF.p)*CF.N(0,0,-MagZ/2) | |
720 | Effect{Effect='ResizeAndFade',Size=V3.N(thick,thick,thick),CFrame=eCF*CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)),Color=color,Frames=delay*2,FXSettings={EndSize=V3.N(thick*8,thick*8,thick*8)}} | |
721 | else | |
722 | zapPart.CFrame = CF.N(pos,posie)*CF.N(0,0,MagZ/parts/2) | |
723 | end | |
724 | ||
725 | lastLightning = zapPart | |
726 | Effect{Effect='Fade',Manual=zapPart,Frames=delay} | |
727 | ||
728 | thick=thick-inc | |
729 | ||
730 | end | |
731 | end | |
732 | ||
733 | function Zap2(data) | |
734 | local Color = data.Color or BrickColor.new'Electric blue' | |
735 | local StartPos = data.Start or Torso.Position | |
736 | local EndPos = data.End or Mouse.Hit.p | |
737 | local SegLength = data.SegL or 2 | |
738 | local Thicc = data.Thickness or 0.5 | |
739 | local Fades = data.Fade or 45 | |
740 | local Parent = data.Parent or Effects | |
741 | local MaxD = data.MaxDist or 200 | |
742 | local Branch = data.Branches or false | |
743 | local Material = data.Material or Enum.Material.Neon | |
744 | local Raycasts = data.Raycasts or false | |
745 | local Offset = data.Offset or {0,360} | |
746 | local AddMesh = (data.Mesh == nil and true or data.Mesh) | |
747 | if((StartPos-EndPos).magnitude > MaxD)then | |
748 | EndPos = CF.N(StartPos,EndPos)*CF.N(0,0,-MaxD).p | |
749 | end | |
750 | local hit,pos,norm,dist=nil,EndPos,nil,(StartPos-EndPos).magnitude | |
751 | if(Raycasts)then | |
752 | hit,pos,norm,dist = CastRay(StartPos,EndPos,MaxD) | |
753 | end | |
754 | local segments = dist/SegLength | |
755 | local model = IN("Model",Parent) | |
756 | model.Name = 'Lightning' | |
757 | local Last; | |
758 | for i = 1, segments do | |
759 | local size = (segments-i)/25 | |
760 | local prt = Part(model,Color,Material,V3.N(Thicc+size,SegLength,Thicc+size),CF.N(),true,false) | |
761 | if(AddMesh)then IN("CylinderMesh",prt) end | |
762 | if(Last and math.floor(segments) == i)then | |
763 | local MagZ = (Last.CFrame*CF.N(0,-SegLength/2,0).p-EndPos).magnitude | |
764 | prt.Size = V3.N(Thicc+size,MagZ,Thicc+size) | |
765 | prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,EndPos)*CF.A(M.R(90),0,0)*CF.N(0,-MagZ/2,0) | |
766 | elseif(not Last)then | |
767 | prt.CFrame = CF.N(StartPos,pos)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
768 | else | |
769 | prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,CF.N(pos)*CF.A(M.R(M.RNG(0,360)),M.R(M.RNG(0,360)),M.R(M.RNG(0,360)))*CF.N(0,0,SegLength/3+(segments-i)).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
770 | end | |
771 | Last = prt | |
772 | if(Branch)then | |
773 | local choice = M.RNG(1,7+((segments-i)*2)) | |
774 | if(choice == 1)then | |
775 | local LastB; | |
776 | for i2 = 1,M.RNG(2,5) do | |
777 | local size2 = ((segments-i)/35)/i2 | |
778 | local prt = Part(model,Color,Material,V3.N(Thicc+size2,SegLength,Thicc+size2),CF.N(),true,false) | |
779 | if(AddMesh)then IN("CylinderMesh",prt) end | |
780 | if(not LastB)then | |
781 | prt.CFrame = CF.N(Last.CFrame*CF.N(0,-SegLength/2,0).p,Last.CFrame*CF.N(0,-SegLength/2,0)*CF.A(0,0,M.RRNG(0,360))*CF.N(0,Thicc*7,0)*CF.N(0,0,-1).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
782 | else | |
783 | prt.CFrame = CF.N(LastB.CFrame*CF.N(0,-SegLength/2,0).p,LastB.CFrame*CF.N(0,-SegLength/2,0)*CF.A(0,0,M.RRNG(0,360))*CF.N(0,Thicc*7,0)*CF.N(0,0,-1).p)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
784 | end | |
785 | LastB = prt | |
786 | end | |
787 | end | |
788 | end | |
789 | end | |
790 | if(Fades > 0)then | |
791 | coroutine.wrap(function() | |
792 | for i = 1, Fades do | |
793 | for _,v in next, model:children() do | |
794 | if(v:IsA'BasePart')then | |
795 | v.Transparency = (i/Fades) | |
796 | end | |
797 | end | |
798 | swait() | |
799 | end | |
800 | model:destroy() | |
801 | end)() | |
802 | else | |
803 | S.Debris:AddItem(model,.01) | |
804 | end | |
805 | return {End=(Last and Last.CFrame*CF.N(0,-Last.Size.Y/2,0).p),Last=Last,Model=model} | |
806 | end | |
807 | ||
808 | function Tween(obj,props,time,easing,direction,repeats,backwards) | |
809 | local info = TweenInfo.new(time or .5, easing or Enum.EasingStyle.Quad, direction or Enum.EasingDirection.Out, repeats or 0, backwards or false) | |
810 | local tween = S.TweenService:Create(obj, info, props) | |
811 | ||
812 | tween:Play() | |
813 | end | |
814 | ||
815 | function Effect(data) | |
816 | local FX = data.Effect or 'ResizeAndFade' | |
817 | local Parent = data.Parent or Effects | |
818 | local Color = data.Color or C3.N(0,0,0) | |
819 | local Size = data.Size or V3.N(1,1,1) | |
820 | local MoveDir = data.MoveDirection or nil | |
821 | local MeshData = data.Mesh or nil | |
822 | local SndData = data.Sound or nil | |
823 | local Frames = data.Frames or 45 | |
824 | local Manual = data.Manual or nil | |
825 | local Material = data.Material or Enum.Material.Neon | |
826 | local CFra = data.CFrame or Torso.CFrame | |
827 | local Settings = data.FXSettings or {} | |
828 | local Shape = data.Shape or Enum.PartType.Block | |
829 | local Snd,Prt,Msh; | |
830 | coroutine.wrap(function() | |
831 | if(Manual and typeof(Manual) == 'Instance' and Manual:IsA'BasePart')then | |
832 | Prt = Manual | |
833 | else | |
834 | Prt = Part(Parent,Color,Material,Size,CFra,true,false) | |
835 | Prt.Shape = Shape | |
836 | end | |
837 | if(typeof(MeshData) == 'table')then | |
838 | Msh = Mesh(Prt,MeshData.MeshType,MeshData.MeshId,MeshData.TextureId,MeshData.Scale,MeshData.Offset) | |
839 | elseif(typeof(MeshData) == 'Instance')then | |
840 | Msh = MeshData:Clone() | |
841 | Msh.Parent = Prt | |
842 | elseif(Shape == Enum.PartType.Block)then | |
843 | Msh = Mesh(Prt,Enum.MeshType.Brick) | |
844 | end | |
845 | if(typeof(SndData) == 'table')then | |
846 | Snd = Sound(Prt,SndData.SoundId,SndData.Pitch,SndData.Volume,false,false,true) | |
847 | elseif(typeof(SndData) == 'Instance')then | |
848 | Snd = SndData | |
849 | end | |
850 | if(Snd)then | |
851 | repeat swait() until Snd.Playing and Snd.IsLoaded and Snd.TimeLength > 0 | |
852 | Frames = Snd.TimeLength * Frame_Speed/Snd.Pitch | |
853 | end | |
854 | Size = (Msh and Msh.Scale or Size) | |
855 | local grow = Size-(Settings.EndSize or (Msh and Msh.Scale or Size)/2) | |
856 | ||
857 | local MoveSpeed = nil; | |
858 | if(MoveDir)then | |
859 | MoveSpeed = (CFra.p - MoveDir).magnitude/Frames | |
860 | end | |
861 | if(FX ~= 'Arc')then | |
862 | for Frame = 1, Frames do | |
863 | if(FX == "Fade")then | |
864 | Prt.Transparency = (Frame/Frames) | |
865 | elseif(FX == "Resize")then | |
866 | if(not Settings.EndSize)then | |
867 | Settings.EndSize = V3.N(0,0,0) | |
868 | end | |
869 | if(Settings.EndIsIncrement)then | |
870 | if(Msh)then | |
871 | Msh.Scale = Msh.Scale + Settings.EndSize | |
872 | else | |
873 | Prt.Size = Prt.Size + Settings.EndSize | |
874 | end | |
875 | else | |
876 | if(Msh)then | |
877 | Msh.Scale = Msh.Scale - grow/Frames | |
878 | else | |
879 | Prt.Size = Prt.Size - grow/Frames | |
880 | end | |
881 | end | |
882 | elseif(FX == "ResizeAndFade")then | |
883 | if(not Settings.EndSize)then | |
884 | Settings.EndSize = V3.N(0,0,0) | |
885 | end | |
886 | if(Settings.EndIsIncrement)then | |
887 | if(Msh)then | |
888 | Msh.Scale = Msh.Scale + Settings.EndSize | |
889 | else | |
890 | Prt.Size = Prt.Size + Settings.EndSize | |
891 | end | |
892 | else | |
893 | if(Msh)then | |
894 | Msh.Scale = Msh.Scale - grow/Frames | |
895 | else | |
896 | Prt.Size = Prt.Size - grow/Frames | |
897 | end | |
898 | end | |
899 | Prt.Transparency = (Frame/Frames) | |
900 | end | |
901 | if(Settings.RandomizeCFrame)then | |
902 | Prt.CFrame = Prt.CFrame * CF.A(M.RRNG(-360,360),M.RRNG(-360,360),M.RRNG(-360,360)) | |
903 | end | |
904 | if(MoveDir and MoveSpeed)then | |
905 | local Orientation = Prt.Orientation | |
906 | Prt.CFrame = CF.N(Prt.Position,MoveDir)*CF.N(0,0,-MoveSpeed) | |
907 | Prt.Orientation = Orientation | |
908 | end | |
909 | swait() | |
910 | end | |
911 | Prt:destroy() | |
912 | else | |
913 | local start,third,fourth,endP = Settings.Start,Settings.Third,Settings.Fourth,Settings.End | |
914 | if(not Settings.End and Settings.Home)then endP = Settings.Home.CFrame end | |
915 | if(start and endP)then | |
916 | local quarter = third or start:lerp(endP, 0.25) * CF.N(M.RNG(-25,25),M.RNG(0,25),M.RNG(-25,25)) | |
917 | local threequarter = fourth or start:lerp(endP, 0.75) * CF.N(M.RNG(-25,25),M.RNG(0,25),M.RNG(-25,25)) | |
918 | for Frame = 0, 1, (Settings.Speed or 0.01) do | |
919 | if(Settings.Home)then | |
920 | endP = Settings.Home.CFrame | |
921 | end | |
922 | Prt.CFrame = Bezier(start, quarter, threequarter, endP, Frame) | |
923 | end | |
924 | if(Settings.RemoveOnGoal)then | |
925 | Prt:destroy() | |
926 | end | |
927 | else | |
928 | Prt:destroy() | |
929 | assert(start,"You need a start position!") | |
930 | assert(endP,"You need a start position!") | |
931 | end | |
932 | end | |
933 | end)() | |
934 | return Prt,Msh,Snd | |
935 | end | |
936 | function SoulSteal(whom) | |
937 | local torso = (whom:FindFirstChild'Head' or whom:FindFirstChild'Torso' or whom:FindFirstChild'UpperTorso' or whom:FindFirstChild'LowerTorso' or whom:FindFirstChild'HumanoidRootPart') | |
938 | print(torso) | |
939 | if(torso and torso:IsA'BasePart')then | |
940 | local Model = Instance.new("Model",Effects) | |
941 | Model.Name = whom.Name.."'s Soul" | |
942 | whom:BreakJoints() | |
943 | local Soul = Part(Model,BrickColor.new'Really red','Glass',V3.N(.5,.5,.5),torso.CFrame,true,false) | |
944 | Soul.Name = 'Head' | |
945 | NewInstance("Humanoid",Model,{Health=0,MaxHealth=0}) | |
946 | Effect{ | |
947 | Effect="Arc", | |
948 | Manual = Soul, | |
949 | FXSettings={ | |
950 | Start=torso.CFrame, | |
951 | Home = Torso, | |
952 | RemoveOnGoal = true, | |
953 | } | |
954 | } | |
955 | local lastPoint = Soul.CFrame.p | |
956 | ||
957 | for i = 0, 1, 0.01 do | |
958 | local point = CFrame.new(lastPoint, Soul.Position) * CFrame.Angles(-math.pi/2, 0, 0) | |
959 | local mag = (lastPoint - Soul.Position).magnitude | |
960 | Effect{ | |
961 | Effect = "Fade", | |
962 | CFrame = point * CF.N(0, mag/2, 0), | |
963 | Size = V3.N(.5,mag+.5,.5), | |
964 | Color = Soul.BrickColor | |
965 | } | |
966 | lastPoint = Soul.CFrame.p | |
967 | swait() | |
968 | end | |
969 | for i = 1, 5 do | |
970 | Effect{ | |
971 | Effect="Fade", | |
972 | Color = BrickColor.new'Really red', | |
973 | MoveDirection = (Torso.CFrame*CFrame.new(M.RNG(-40,40),M.RNG(-40,40),M.RNG(-40,40))).p | |
974 | } | |
975 | end | |
976 | end | |
977 | end | |
978 | ||
979 | --// Other Functions \\ -- | |
980 | ||
981 | function CastRay(startPos,endPos,range,ignoreList) | |
982 | local ray = Ray.new(startPos,(endPos-startPos).unit*range) | |
983 | local part,pos,norm = workspace:FindPartOnRayWithIgnoreList(ray,ignoreList or {Char},false,true) | |
984 | return part,pos,norm,(pos and (startPos-pos).magnitude) | |
985 | end | |
986 | ||
987 | function CastRayInDirection(startPos,direction,range,ignoreList) | |
988 | local ray = Ray.new(startPos,direction*range) | |
989 | local part,pos,norm = workspace:FindPartOnRayWithIgnoreList(ray,ignoreList or {Char},false,true) | |
990 | return part,pos,norm,(pos and (startPos-pos).magnitude) | |
991 | end | |
992 | ||
993 | function getRegion(point,range,ignore) | |
994 | return workspace:FindPartsInRegion3WithIgnoreList(R3.N(point-V3.N(1,1,1)*range/2,point+V3.N(1,1,1)*range/2),ignore,100) | |
995 | end | |
996 | ||
997 | function clerp(startCF,endCF,alpha) | |
998 | return startCF:lerp(endCF, alpha) | |
999 | end | |
1000 | ||
1001 | function GetTorso(char) | |
1002 | return char:FindFirstChild'Torso' or char:FindFirstChild'UpperTorso' or char:FindFirstChild'LowerTorso' or char:FindFirstChild'HumanoidRootPart' | |
1003 | end | |
1004 | ||
1005 | function ShowDamage(Pos, Text, Time, Color) | |
1006 | coroutine.wrap(function() | |
1007 | local Rate = (1 / Frame_Speed) | |
1008 | local Pos = (Pos or Vector3.new(0, 0, 0)) | |
1009 | local Text = (Text or "") | |
1010 | local Time = (Time or 2) | |
1011 | local Color = (Color or Color3.new(1, 0, 1)) | |
1012 | local EffectPart = NewInstance("Part",Effects,{ | |
1013 | Material=Enum.Material.SmoothPlastic, | |
1014 | Reflectance = 0, | |
1015 | Transparency = 1, | |
1016 | BrickColor = BrickColor.new(Color), | |
1017 | Name = "Effect", | |
1018 | Size = Vector3.new(0,0,0), | |
1019 | Anchored = true, | |
1020 | CFrame = CF.N(Pos) | |
1021 | }) | |
1022 | local BillboardGui = NewInstance("BillboardGui",EffectPart,{ | |
1023 | Size = UDim2.new(1.25, 0, 1.25, 0), | |
1024 | Adornee = EffectPart, | |
1025 | }) | |
1026 | local TextLabel = NewInstance("TextLabel",BillboardGui,{ | |
1027 | BackgroundTransparency = 1, | |
1028 | Size = UDim2.new(1, 0, 1, 0), | |
1029 | Text = Text, | |
1030 | Font = "Bodoni", | |
1031 | TextColor3 = Color, | |
1032 | TextStrokeColor3 = Color3.new(0,0,0), | |
1033 | TextStrokeTransparency=0, | |
1034 | TextScaled = true, | |
1035 | }) | |
1036 | S.Debris:AddItem(EffectPart, (Time)) | |
1037 | EffectPart.Parent = workspace | |
1038 | delay(0, function() | |
1039 | Tween(EffectPart,{CFrame=CF.N(Pos)*CF.N(0,3,0)},Time,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out) | |
1040 | local Frames = (Time / Rate) | |
1041 | for Frame = 1, Frames do | |
1042 | swait() | |
1043 | local Percent = (Frame / Frames) | |
1044 | TextLabel.TextTransparency = Percent | |
1045 | TextLabel.TextStrokeTransparency = Percent | |
1046 | end | |
1047 | if EffectPart and EffectPart.Parent then | |
1048 | EffectPart:Destroy() | |
1049 | end | |
1050 | end) end)() | |
1051 | end | |
1052 | ||
1053 | ||
1054 | function DealDamage(who,minDam,maxDam,Knock,Type,critChance,critMult) | |
1055 | if(who)then | |
1056 | local hum = who:FindFirstChildOfClass'Humanoid' | |
1057 | local Damage = M.RNG(minDam,maxDam) | |
1058 | local canHit = true | |
1059 | if(hum)then | |
1060 | for _, p in pairs(Hit) do | |
1061 | if p[1] == hum then | |
1062 | if(time() - p[2] < 0.01) then | |
1063 | canHit = false | |
1064 | else | |
1065 | Hit[_] = nil | |
1066 | end | |
1067 | end | |
1068 | end | |
1069 | if(canHit)then | |
1070 | table.insert(Hit,{hum,time()}) | |
1071 | if(hum.Health >= math.huge)then | |
1072 | who:BreakJoints() | |
1073 | if(who:FindFirstChild'Head' and hum.Health > 0)then | |
1074 | ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), "INSTANT", 1.5, C3.N(1,0,0)) | |
1075 | end | |
1076 | else | |
1077 | local player = S.Players:GetPlayerFromCharacter(who) | |
1078 | if(Type == "Fire")then | |
1079 | --idk.. | |
1080 | else | |
1081 | local c = Instance.new("ObjectValue",hum) | |
1082 | c.Name = "creator" | |
1083 | c.Value = Plr | |
1084 | game:service'Debris':AddItem(c,0.35) | |
1085 | if(M.RNG(1,100) <= (critChance or 0) and critMult > 1)then | |
1086 | if(who:FindFirstChild'Head' and hum.Health > 0)then | |
1087 | ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), "[CRIT] "..Damage*(critMult or 2), 1.5, BrickColor.new'New Yeller'.Color) | |
1088 | end | |
1089 | hum.Health = hum.Health - Damage*(critMult or 2) | |
1090 | else | |
1091 | if(who:FindFirstChild'Head' and hum.Health > 0)then | |
1092 | ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), Damage, 1.5, DamageColor.Color) | |
1093 | end | |
1094 | hum.Health = hum.Health - Damage | |
1095 | end | |
1096 | if(Type == 'Knockback' and GetTorso(who))then | |
1097 | local angle = GetTorso(who).Position - Root.Position + Vector3.new(0, 0, 0).unit | |
1098 | local body = NewInstance('BodyVelocity',GetTorso(who),{ | |
1099 | P = 500, | |
1100 | maxForce = V3.N(math.huge,0,math.huge), | |
1101 | velocity = Root.CFrame.lookVector * Knock + Root.Velocity / 1.05 | |
1102 | }) | |
1103 | game:service'Debris':AddItem(body,.5) | |
1104 | elseif(Type == "Electric")then | |
1105 | if(M.RNG(1,100) >= critChance)then | |
1106 | if(who:FindFirstChild'Head' and hum.Health > 0)then | |
1107 | ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), "[PARALYZED]", 1.5, BrickColor.new"New Yeller".Color) | |
1108 | end | |
1109 | local asd = hum.WalkSpeed/2 | |
1110 | hum.WalkSpeed = asd | |
1111 | local paralyzed = true | |
1112 | coroutine.wrap(function() | |
1113 | while paralyzed do | |
1114 | swait(25) | |
1115 | if(M.RNG(1,25) == 1)then | |
1116 | if(who:FindFirstChild'Head' and hum.Health > 0)then | |
1117 | ShowDamage((who.Head.CFrame * CF.N(0, 0, (who.Head.Size.Z / 2)).p+V3.N(0,1.5,0)+V3.N(M.RNG(-2,2),0,M.RNG(-2,2))), "[STATIC]", 1.5, BrickColor.new"New Yeller".Color) | |
1118 | end | |
1119 | hum.PlatformStand = true | |
1120 | end | |
1121 | end | |
1122 | end)() | |
1123 | delay(4, function() | |
1124 | paralyzed = false | |
1125 | hum.WalkSpeed = hum.WalkSpeed + asd | |
1126 | end) | |
1127 | end | |
1128 | ||
1129 | elseif(Type == 'Knockdown' and GetTorso(who))then | |
1130 | local rek = GetTorso(who) | |
1131 | hum.PlatformStand = true | |
1132 | delay(1,function() | |
1133 | hum.PlatformStand = false | |
1134 | end) | |
1135 | local angle = (GetTorso(who).Position - (Root.Position + Vector3.new(0, 0, 0))).unit | |
1136 | local bodvol = NewInstance("BodyVelocity",rek,{ | |
1137 | velocity = angle * Knock, | |
1138 | P = 5000, | |
1139 | maxForce = Vector3.new(8e+003, 8e+003, 8e+003), | |
1140 | }) | |
1141 | local rl = NewInstance("BodyAngularVelocity",rek,{ | |
1142 | P = 3000, | |
1143 | maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000, | |
1144 | angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)), | |
1145 | }) | |
1146 | game:GetService("Debris"):AddItem(bodvol, .5) | |
1147 | game:GetService("Debris"):AddItem(rl, .5) | |
1148 | end | |
1149 | end | |
1150 | end | |
1151 | end | |
1152 | end | |
1153 | end | |
1154 | end | |
1155 | ||
1156 | function AOEDamage(where,range,minDam,maxDam,Knock,Type,critChance,critMult) | |
1157 | for _,v in next, getRegion(where,range,{Char}) do | |
1158 | if(v.Parent and v.Parent:FindFirstChildOfClass'Humanoid')then | |
1159 | coroutine.wrap(function() for i = 1, M.RNG(minDam,maxDam) do swait() DealDamage(v.Parent,1,1,Knock,Type,0,1) end end)() | |
1160 | end | |
1161 | end | |
1162 | end | |
1163 | ||
1164 | function AOEHeal(where,range,amount) | |
1165 | local healed = {} | |
1166 | for _,v in next, getRegion(where,range,{Char}) do | |
1167 | local hum = (v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' or nil) | |
1168 | if(hum and not healed[hum])then | |
1169 | hum.Health = hum.Health + amount | |
1170 | if(v.Parent:FindFirstChild'Head' and hum.Health > 0)then | |
1171 | ShowDamage((v.Parent.Head.CFrame * CF.N(0, 0, (v.Parent.Head.Size.Z / 2)).p+V3.N(0,1.5,0)), "+"..amount, 1.5, BrickColor.new'Lime green'.Color) | |
1172 | end | |
1173 | end | |
1174 | end | |
1175 | end | |
1176 | ||
1177 | function CamShake(who,times,intense,origin) | |
1178 | coroutine.wrap(function() | |
1179 | if(script:FindFirstChild'CamShake')then | |
1180 | local cam = script.CamShake:Clone() | |
1181 | cam:WaitForChild'intensity'.Value = intense | |
1182 | cam:WaitForChild'times'.Value = times | |
1183 | ||
1184 | if(origin)then NewInstance((typeof(origin) == 'Instance' and "ObjectValue" or typeof(origin) == 'Vector3' and 'Vector3Value'),cam,{Name='origin',Value=origin}) end | |
1185 | cam.Parent = who | |
1186 | wait() | |
1187 | cam.Disabled = false | |
1188 | elseif(who == Plr or who == Char)then | |
1189 | local intensity = intense | |
1190 | local cam = workspace.CurrentCamera | |
1191 | for i = 1, times do | |
1192 | local camDistFromOrigin | |
1193 | if(typeof(origin) == 'Instance' and origin:IsA'BasePart')then | |
1194 | camDistFromOrigin = math.floor( (cam.CFrame.p-origin.Position).magnitude )/25 | |
1195 | elseif(typeof(origin) == 'Vector3')then | |
1196 | camDistFromOrigin = math.floor( (cam.CFrame.p-origin).magnitude )/25 | |
1197 | end | |
1198 | if(camDistFromOrigin)then | |
1199 | intensity = math.min(intense, math.floor(intense/camDistFromOrigin)) | |
1200 | end | |
1201 | cam.CFrame = cam.CFrame:lerp(cam.CFrame*CFrame.new(math.random(-intensity,intensity)/100,math.random(-intensity,intensity)/100,math.random(-intensity,intensity)/100)*CFrame.Angles(math.rad(math.random(-intensity,intensity)/100),math.rad(math.random(-intensity,intensity)/100),math.rad(math.random(-intensity,intensity)/100)),.4) | |
1202 | swait() | |
1203 | end | |
1204 | end | |
1205 | end)() | |
1206 | end | |
1207 | ||
1208 | function CamShakeAll(times,intense,origin) | |
1209 | for _,v in next, Plrs:players() do | |
1210 | CamShake(v:FindFirstChildOfClass'PlayerGui' or v:FindFirstChildOfClass'Backpack' or v.Character,times,intense,origin) | |
1211 | end | |
1212 | end | |
1213 | ||
1214 | function ServerScript(code) | |
1215 | if(script:FindFirstChild'Loadstring')then | |
1216 | local load = script.Loadstring:Clone() | |
1217 | load:WaitForChild'Sauce'.Value = code | |
1218 | load.Disabled = false | |
1219 | load.Parent = workspace | |
1220 | elseif(NS and typeof(NS) == 'function')then | |
1221 | NS(code,workspace) | |
1222 | else | |
1223 | warn("no serverscripts lol") | |
1224 | end | |
1225 | end | |
1226 | ||
1227 | function LocalOnPlayer(who,code) | |
1228 | ServerScript([[ | |
1229 | wait() | |
1230 | script.Parent=nil | |
1231 | if(not _G.Http)then _G.Http = game:service'HttpService' end | |
1232 | ||
1233 | local Http = _G.Http or game:service'HttpService' | |
1234 | ||
1235 | local source = ]].."[["..code.."]]"..[[ | |
1236 | local link = "https://api.vorth.xyz/R_API/R.UPLOAD/NEW_LOCAL.php" | |
1237 | local asd = Http:PostAsync(link,source) | |
1238 | repeat wait() until asd and Http:JSONDecode(asd) and Http:JSONDecode(asd).Result and Http:JSONDecode(asd).Result.Require_ID | |
1239 | local ID = Http:JSONDecode(asd).Result.Require_ID | |
1240 | local vs = require(ID).VORTH_SCRIPT | |
1241 | vs.Parent = game:service'Players'.]]..who.Name..[[.Character | |
1242 | ]]) | |
1243 | end | |
1244 | ||
1245 | ||
1246 | --// Attack Functions \\-- | |
1247 | function Laser(key) | |
1248 | NeutralAnims = false | |
1249 | Attack = true | |
1250 | Root.Anchored = true | |
1251 | local data = MagicCircle{Weld=Torso,Pos=CF.N(0,0,-4),Size=5,Variant=MagicVariant,Time=.5} | |
1252 | local IsGrown = false | |
1253 | data.Grown:connect(function() IsGrown = true end) | |
1254 | repeat swait() | |
1255 | local Alpha = .1 | |
1256 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(125),0,0),Alpha) | |
1257 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(125),0,0),Alpha) | |
1258 | RJ.C0 = RJ.C0:lerp(RJC0,Alpha) | |
1259 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1260 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1261 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1262 | local LookVector = Mouse.Hit.p | |
1263 | Torso.CFrame = CF.N(Root.Position,LookVector) | |
1264 | until IsGrown | |
1265 | if(S.UserInputService:IsKeyDown(key))then | |
1266 | local grown = 0 | |
1267 | repeat | |
1268 | local Alpha = .1 | |
1269 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(125),0,0),Alpha) | |
1270 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(125),0,0),Alpha) | |
1271 | RJ.C0 = RJ.C0:lerp(RJC0,Alpha) | |
1272 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1273 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1274 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1275 | local LookVector = Mouse.Hit.p | |
1276 | Root.CFrame = CF.N(Root.Position,LookVector) | |
1277 | if(grown < 250)then | |
1278 | data.Grow(.05) | |
1279 | grown = grown + 1 | |
1280 | end | |
1281 | swait() | |
1282 | until not S.UserInputService:IsKeyDown(key) | |
1283 | end | |
1284 | Sound(data.Circle,340722848,1,1,false,true,true) | |
1285 | local hit,pos,norm,dist = CastRay(data.Circle.CFrame.p,Mouse.Hit.p,1024) | |
1286 | local part = Part(Effects,MagicVariant.EffectColor or MagicVariant.Color,Enum.Material.Neon,V3.N(dist,data.Mesh.Scale.x/40,data.Mesh.Scale.x/40),CF.N(data.Circle.CFrame.p,pos)*CF.N(0,0,-dist/2)*CF.A(0,M.P/2,0),true,false) | |
1287 | Mesh(part,Enum.MeshType.Cylinder) | |
1288 | Tween(part,{Color=C3.N(1,1,1)},1,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false) | |
1289 | Effect{ | |
1290 | Effect='ResizeAndFade', | |
1291 | Color=MagicVariant.Color, | |
1292 | Size=V3.N(data.Mesh.Scale.X/20,data.Mesh.Scale.X/20,data.Mesh.Scale.X/20), | |
1293 | Mesh={MeshType=Enum.MeshType.Sphere}, | |
1294 | CFrame=CF.N(pos), | |
1295 | FXSettings={ | |
1296 | EndSize=V3.N(.05,.05,.05), | |
1297 | EndIsIncrement=true | |
1298 | } | |
1299 | } | |
1300 | for i = 1, 5 do | |
1301 | local angles = CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)) | |
1302 | Effect{ | |
1303 | Effect='Fade', | |
1304 | Frames=65, | |
1305 | Size=V3.N((data.Mesh.Scale.X/20)/2,(data.Mesh.Scale.X/20)/2,data.Mesh.Scale.X/20), | |
1306 | CFrame=CF.N(CF.N(pos)*angles*CF.N(0,0,-(data.Mesh.Scale.X/20)).p,pos), | |
1307 | Mesh = {MeshType=Enum.MeshType.Sphere}, | |
1308 | Material=Enum.Material.Neon, | |
1309 | Color=MagicVariant.Color, | |
1310 | MoveDirection=CF.N(CF.N(pos)*angles*CF.N(0,0,-50).p,pos).p, | |
1311 | } | |
1312 | end | |
1313 | AOEDamage(pos,data.Mesh.Scale.X/20,15,45,0,'Normal',10,4) | |
1314 | coroutine.wrap(function() | |
1315 | local frame = (1/30) | |
1316 | for i = 1, 30 do | |
1317 | part.Transparency = (i/30) | |
1318 | swait() | |
1319 | end | |
1320 | part:destroy() | |
1321 | end)() | |
1322 | Attack = false | |
1323 | NeutralAnims = true | |
1324 | Root.Anchored = false | |
1325 | data.Destroy() | |
1326 | end | |
1327 | ||
1328 | function Balls(key) | |
1329 | NeutralAnims = false | |
1330 | Attack = true | |
1331 | Root.Anchored = true | |
1332 | local data = MagicCircle{Weld=Torso,Pos=CF.N(0,0,-1),Size=5,Variant=MagicVariant,Time=.5} | |
1333 | local IsGrown = false | |
1334 | data.Grown:connect(function() IsGrown = true end) | |
1335 | repeat swait() | |
1336 | local Alpha = .1 | |
1337 | local idk = M.R(25) | |
1338 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha) | |
1339 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha) | |
1340 | RJ.C0 = RJ.C0:lerp(RJC0,Alpha) | |
1341 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1342 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1343 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1344 | local LookVector = Mouse.Hit.p | |
1345 | Torso.CFrame = CF.N(Root.Position,LookVector) | |
1346 | until IsGrown | |
1347 | local projectiles = 5 | |
1348 | if(S.UserInputService:IsKeyDown(key))then | |
1349 | local grown = 0 | |
1350 | repeat | |
1351 | local Alpha = .1 | |
1352 | local idk = M.R(25) | |
1353 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha) | |
1354 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha) | |
1355 | RJ.C0 = RJ.C0:lerp(RJC0,Alpha) | |
1356 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1357 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1358 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1359 | local LookVector = Mouse.Hit.p | |
1360 | Root.CFrame = CF.N(Root.Position,LookVector) | |
1361 | if(grown < 250)then | |
1362 | data.Grow(.05) | |
1363 | grown = grown + 1 | |
1364 | projectiles = projectiles + .05 | |
1365 | end | |
1366 | swait() | |
1367 | until not S.UserInputService:IsKeyDown(key) | |
1368 | end | |
1369 | for i = 1, math.floor(projectiles) do | |
1370 | data.Grow(-math.floor(projectiles)/20) | |
1371 | local LookVector = Mouse.Hit.p | |
1372 | Root.CFrame = CF.N(Root.Position,LookVector) | |
1373 | ShootBullet{Shape='Ball',Frames=160,Origin=data.Circle.CFrame,Speed=10} | |
1374 | swait(1) | |
1375 | end | |
1376 | ||
1377 | Attack = false | |
1378 | NeutralAnims = true | |
1379 | Root.Anchored = false | |
1380 | data.Destroy() | |
1381 | end | |
1382 | ||
1383 | function DLaser(key) | |
1384 | NeutralAnims = false | |
1385 | Attack = true | |
1386 | Root.Anchored = true | |
1387 | local data1 = MagicCircle{Weld=Torso,Pos=CF.N(-4,0,-4),Size=5,Variant=MagicVariant,Time=.5} | |
1388 | local data2 = MagicCircle{Weld=Torso,Pos=CF.N(4,0,-4),Size=5,Variant=MagicVariant,Time=.5} | |
1389 | local IsGrown = false | |
1390 | data1.Grown:connect(function() IsGrown = true end) | |
1391 | repeat swait() | |
1392 | local Alpha = .1 | |
1393 | local idk = M.R(25) | |
1394 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha) | |
1395 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha) | |
1396 | RJ.C0 = RJ.C0:lerp(RJC0,Alpha) | |
1397 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1398 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1399 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1400 | local LookVector = Mouse.Hit.p | |
1401 | Torso.CFrame = CF.N(Root.Position,LookVector) | |
1402 | until IsGrown | |
1403 | if(S.UserInputService:IsKeyDown(key))then | |
1404 | local grown = 0 | |
1405 | repeat | |
1406 | local Alpha = .1 | |
1407 | local idk = M.R(25) | |
1408 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha) | |
1409 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha) | |
1410 | RJ.C0 = RJ.C0:lerp(RJC0,Alpha) | |
1411 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1412 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1413 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1414 | local LookVector = Mouse.Hit.p | |
1415 | Root.CFrame = CF.N(Root.Position,LookVector) | |
1416 | if(grown < 250)then | |
1417 | data1.Grow(.05) | |
1418 | data2.Grow(.05) | |
1419 | grown = grown + 1 | |
1420 | end | |
1421 | swait() | |
1422 | until not S.UserInputService:IsKeyDown(key) | |
1423 | end | |
1424 | Sound(data1.Circle,340722848,1,1,false,true,true) | |
1425 | Sound(data2.Circle,340722848,1,1,false,true,true) | |
1426 | local hit,pos,norm,dist = CastRay(data1.Circle.CFrame.p,Mouse.Hit.p,1024) | |
1427 | local part1 = Part(Effects,MagicVariant.EffectColor or MagicVariant.Color,Enum.Material.Neon,V3.N(dist,data1.Mesh.Scale.x/40,data1.Mesh.Scale.x/40),CF.N(data1.Circle.CFrame.p,pos)*CF.N(0,0,-dist/2)*CF.A(0,M.P/2,0),true,false) | |
1428 | Mesh(part1,Enum.MeshType.Cylinder) | |
1429 | ||
1430 | ||
1431 | local part2 = Part(Effects,MagicVariant.EffectColor or MagicVariant.Color,Enum.Material.Neon,V3.N(dist,data2.Mesh.Scale.x/40,data2.Mesh.Scale.x/40),CF.N(data2.Circle.CFrame.p,pos)*CF.N(0,0,-dist/2)*CF.A(0,M.P/2,0),true,false) | |
1432 | Mesh(part2,Enum.MeshType.Cylinder) | |
1433 | Tween(part1,{Color=C3.N(1,1,1)},1,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false) | |
1434 | Tween(part2,{Color=C3.N(1,1,1)},1,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false) | |
1435 | Effect{ | |
1436 | Effect='ResizeAndFade', | |
1437 | Color=MagicVariant.Color, | |
1438 | Size=V3.N(data1.Mesh.Scale.X/20,data1.Mesh.Scale.X/20,data1.Mesh.Scale.X/20), | |
1439 | Mesh={MeshType=Enum.MeshType.Sphere}, | |
1440 | CFrame=CF.N(pos), | |
1441 | FXSettings={ | |
1442 | EndSize=V3.N(.05,.05,.05), | |
1443 | EndIsIncrement=true | |
1444 | } | |
1445 | } | |
1446 | for i = 1, 5 do | |
1447 | local angles = CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)) | |
1448 | Effect{ | |
1449 | Effect='Fade', | |
1450 | Frames=65, | |
1451 | Size=V3.N((data1.Mesh.Scale.X/20)/2,(data1.Mesh.Scale.X/20)/2,data1.Mesh.Scale.X/20), | |
1452 | CFrame=CF.N(CF.N(pos)*angles*CF.N(0,0,-(data1.Mesh.Scale.X/20)).p,pos), | |
1453 | Mesh = {MeshType=Enum.MeshType.Sphere}, | |
1454 | Material=Enum.Material.Neon, | |
1455 | Color=MagicVariant.Color, | |
1456 | MoveDirection=CF.N(CF.N(pos)*angles*CF.N(0,0,-50).p,pos).p, | |
1457 | } | |
1458 | end | |
1459 | AOEDamage(pos,data1.Mesh.Scale.X/20,15,45,0,'Normal',10,4) | |
1460 | AOEDamage(pos,data2.Mesh.Scale.X/20,15,45,0,'Normal',10,4) | |
1461 | coroutine.wrap(function() | |
1462 | local frame = (1/30) | |
1463 | for i = 1, 30 do | |
1464 | part1.Transparency = (i/30) | |
1465 | part2.Transparency = (i/30) | |
1466 | swait() | |
1467 | end | |
1468 | part1:destroy() | |
1469 | part2:destroy() | |
1470 | end)() | |
1471 | Attack = false | |
1472 | NeutralAnims = true | |
1473 | Root.Anchored = false | |
1474 | data1.Destroy() | |
1475 | data2.Destroy() | |
1476 | end | |
1477 | ||
1478 | ||
1479 | function BLaser(key) | |
1480 | NeutralAnims = false | |
1481 | Attack = true | |
1482 | Root.Anchored = true | |
1483 | local data = MagicCircle{Weld=Torso,Pos=CF.N(0,0,-1),Size=15,Variant=MagicVariant,Time=.75} | |
1484 | local IsGrown = false | |
1485 | data.Grown:connect(function() IsGrown = true end) | |
1486 | repeat swait() | |
1487 | local Alpha = .1 | |
1488 | local idk = M.R(25) | |
1489 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha) | |
1490 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha) | |
1491 | RJ.C0 = RJ.C0:lerp(RJC0,Alpha) | |
1492 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1493 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1494 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1495 | local LookVector = Mouse.Hit.p | |
1496 | Torso.CFrame = CF.N(Root.Position,LookVector) | |
1497 | until IsGrown | |
1498 | if(S.UserInputService:IsKeyDown(key))then | |
1499 | local grown = 0 | |
1500 | repeat | |
1501 | local Alpha = .1 | |
1502 | local idk = M.R(25) | |
1503 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha) | |
1504 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha) | |
1505 | RJ.C0 = RJ.C0:lerp(RJC0,Alpha) | |
1506 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1507 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1508 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1509 | local LookVector = Mouse.Hit.p | |
1510 | Root.CFrame = CF.N(Root.Position,LookVector) | |
1511 | swait() | |
1512 | until not S.UserInputService:IsKeyDown(key) | |
1513 | end | |
1514 | ||
1515 | local hit,pos,norm,dist = CastRay(data.Circle.CFrame.p,Mouse.Hit.p,1024) | |
1516 | local part = Part(Effects,MagicVariant.EffectColor or MagicVariant.Color,Enum.Material.Neon,V3.N(dist,data.Mesh.Scale.x/40,data.Mesh.Scale.x/40),CF.N(data.Circle.CFrame.p,pos)*CF.N(0,0,-dist/2)*CF.A(0,M.P/2,0),true,false) | |
1517 | Mesh(part,Enum.MeshType.Cylinder) | |
1518 | Tween(part,{Color=C3.N(1,1,1)},1,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false) | |
1519 | local aa = data.Circle:Clone(); | |
1520 | aa.Parent = Effects | |
1521 | aa.Anchored = true | |
1522 | local blast = Sound(aa,334702766,1,5,false,true,true) | |
1523 | data.Circle:destroy() | |
1524 | if(not blast.IsLoaded)then repeat swait() until blast.IsLoaded end | |
1525 | Effect{ | |
1526 | Effect='ResizeAndFade', | |
1527 | Color=MagicVariant.Color, | |
1528 | Size=V3.N(data.Mesh.Scale.X/20,data.Mesh.Scale.X/20,data.Mesh.Scale.X/20), | |
1529 | Mesh={MeshType=Enum.MeshType.Sphere}, | |
1530 | CFrame=CF.N(pos), | |
1531 | Sound=blast, | |
1532 | FXSettings={ | |
1533 | EndSize=V3.N(.05,.05,.05), | |
1534 | EndIsIncrement=true | |
1535 | } | |
1536 | } | |
1537 | for i = 1, 5 do | |
1538 | local angles = CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)) | |
1539 | Effect{ | |
1540 | Effect='Fade', | |
1541 | Frames=65, | |
1542 | Sound=blast, | |
1543 | Size=V3.N((data.Mesh.Scale.X/20)/2,(data.Mesh.Scale.X/20)/2,data.Mesh.Scale.X/20), | |
1544 | CFrame=CF.N(CF.N(pos)*angles*CF.N(0,0,-(data.Mesh.Scale.X/20)).p,pos), | |
1545 | Mesh = {MeshType=Enum.MeshType.Sphere}, | |
1546 | Material=Enum.Material.Neon, | |
1547 | Color=MagicVariant.Color, | |
1548 | MoveDirection=CF.N(CF.N(pos)*angles*CF.N(0,0,-50).p,pos).p, | |
1549 | } | |
1550 | end | |
1551 | AOEDamage(pos,data.Mesh.Scale.X/20,45,75,0,'Normal',10,4) | |
1552 | coroutine.wrap(function() | |
1553 | for i = 1, (blast.TimeLength*Frame_Speed) do | |
1554 | part.Transparency = (i/(blast.TimeLength*Frame_Speed)) | |
1555 | for _,v in next, aa:children() do if v:IsA'Decal' then v.Transparency = (i/(blast.TimeLength*Frame_Speed)) end end | |
1556 | swait() | |
1557 | end | |
1558 | aa:destroy() | |
1559 | part:destroy() | |
1560 | end)() | |
1561 | ||
1562 | Attack = false | |
1563 | NeutralAnims = true | |
1564 | Root.Anchored = false | |
1565 | Root.Velocity = Mouse.Hit.lookVector*-125 | |
1566 | end | |
1567 | ||
1568 | function Skill1() | |
1569 | Laser(Enum.KeyCode.Q) | |
1570 | end | |
1571 | ||
1572 | function Skill2() | |
1573 | DLaser(Enum.KeyCode.Z) | |
1574 | end | |
1575 | ||
1576 | function Skill3() | |
1577 | BLaser(Enum.KeyCode.X) | |
1578 | end | |
1579 | ||
1580 | --// Wrap it all up \\-- | |
1581 | ||
1582 | Mouse.KeyDown:connect(function(k) | |
1583 | if(Attack)then return end | |
1584 | if(k == 'q')then Skill1() end | |
1585 | if(k == 'z')then Skill2() end | |
1586 | if(k == 'x')then Skill3() end | |
1587 | end) | |
1588 | ||
1589 | Plr.Chatted:connect(function(m) | |
1590 | ||
1591 | if(m:sub(1,3) == '/e ')then | |
1592 | local msg = m:sub(4) | |
1593 | --emote commands (gotta do) | |
1594 | end | |
1595 | end) | |
1596 | while true do | |
1597 | swait() | |
1598 | Sine = Sine + Change | |
1599 | ||
1600 | local hitfloor,posfloor = workspace:FindPartOnRay(Ray.new(Root.CFrame.p,((CFrame.new(Root.Position,Root.Position - Vector3.new(0,1,0))).lookVector).unit * (4)), Char) | |
1601 | ||
1602 | local Walking = (math.abs(Root.Velocity.x) > 1 or math.abs(Root.Velocity.z) > 1) | |
1603 | local State = (Hum.PlatformStand and 'Paralyzed' or Hum.Sit and 'Sit' or not hitfloor and Root.Velocity.y < -1 and "Fall" or not hitfloor and Root.Velocity.y > 1 and "Jump" or hitfloor and Walking and (Hum.WalkSpeed > 24 and "Run" or "Walk") or hitfloor and "Idle") | |
1604 | if(not Effects or not Effects.Parent)then | |
1605 | Effects = IN("Model",Char) | |
1606 | Effects.Name = "Effects" | |
1607 | end | |
1608 | if(State == 'Run')then | |
1609 | local wsVal = 20 / (Hum.WalkSpeed/16) | |
1610 | local Alpha = math.min(.2 * (Hum.WalkSpeed/16),1) | |
1611 | Change = 3 | |
1612 | RH.C1 = RH.C1:lerp(CF.N(0,1,0)*CF.N(0,0-.2*M.C(Sine/wsVal),0+.4*M.C(Sine/wsVal))*CF.A(M.R(15+25*M.C(Sine/wsVal))+-M.S(Sine/wsVal),0,0),Alpha) | |
1613 | LH.C1 = LH.C1:lerp(CF.N(0,1,0)*CF.N(0,0+.2*M.C(Sine/wsVal),0-.4*M.C(Sine/wsVal))*CF.A(M.R(15-25*M.C(Sine/wsVal))+M.S(Sine/wsVal),0,0),Alpha) | |
1614 | elseif(State == 'Walk')then | |
1615 | local wsVal = 20 / (Hum.WalkSpeed/16) | |
1616 | local Alpha = math.min(.3 * (Hum.WalkSpeed/8),1) | |
1617 | Change = 3 | |
1618 | RH.C1 = RH.C1:lerp(CF.N(0,1,0)*CF.N(0,0-.5*M.C(Sine/wsVal)/2,0+.6*M.C(Sine/wsVal)/2)*CF.A(M.R(15-2*M.C(Sine/wsVal))+-M.S(Sine/wsVal)/2.5,0,0),Alpha) | |
1619 | LH.C1 = LH.C1:lerp(CF.N(0,1,0)*CF.N(0,0+.5*M.C(Sine/wsVal)/2,0-.6*M.C(Sine/wsVal)/2)*CF.A(M.R(15+2*M.C(Sine/wsVal))+M.S(Sine/wsVal)/2.5,0,0),Alpha) | |
1620 | else | |
1621 | RH.C1 = RH.C1:lerp(CF.N(0,1,0),.2) | |
1622 | LH.C1 = LH.C1:lerp(CF.N(0,1,0),.2) | |
1623 | end | |
1624 | ||
1625 | Hum.WalkSpeed = WalkSpeed | |
1626 | ||
1627 | if(NeutralAnims)then | |
1628 | if(State == 'Idle')then | |
1629 | local Alpha = .1 | |
1630 | Change = .75 | |
1631 | RJ.C0 = RJ.C0:lerp(RJC0*CF.N(0+.2*M.C(Sine/12),.2*M.C(Sine/6),0)*CF.A(M.R(-5+5*M.C(Sine/12)),0,0),Alpha) | |
1632 | NK.C0 = NK.C0:lerp(NKC0*CF.A(M.R(-5+5*M.C(Sine/12)),0,0),Alpha) | |
1633 | LS.C0 = LS.C0:lerp(LSC0*CF.N(.25,0,0)*CF.A(M.R(-45),0,M.R(45+5*M.C(Sine/12))),Alpha) | |
1634 | RS.C0 = RS.C0:lerp(RSC0*CF.N(-.25,0,0)*CF.A(M.R(-45),0,M.R(-45-5*M.C(Sine/12))),Alpha) | |
1635 | LH.C0 = LH.C0:lerp(LHC0*CF.N(0-.2*M.C(Sine/12),-.2*M.C(Sine/6),0)*CF.A(M.R(5-5*M.C(Sine/12)),M.R(10),0),Alpha) | |
1636 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0-.2*M.C(Sine/12),-.2*M.C(Sine/6),0)*CF.A(M.R(5-5*M.C(Sine/12)),M.R(-10),0),Alpha) | |
1637 | -- idle | |
1638 | elseif(State == 'Run')then | |
1639 | local wsVal = 20 / (Hum.WalkSpeed/16) | |
1640 | local Alpha = math.min(.2 * (Hum.WalkSpeed/16),1) | |
1641 | RJ.C0 = RJ.C0:lerp(CF.N(0,0-.1*M.C(Sine/(wsVal/2)),0)*CF.A(M.R(-15+2.5*M.C(Sine/(wsVal/2))),M.R(8*M.C(Sine/wsVal)),0),Alpha) | |
1642 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1643 | LS.C0 = LS.C0:lerp(LSC0*CF.N(0,0,0-.3*M.S(Sine/wsVal))*CF.A(M.R(0+45*M.S(Sine/wsVal)),0,M.R(-5)),Alpha) | |
1644 | RS.C0 = RS.C0:lerp(RSC0*CF.N(0,0,0+.3*M.S(Sine/wsVal))*CF.A(M.R(0-45*M.S(Sine/wsVal)),0,M.R(5)),Alpha) | |
1645 | LH.C0 = LH.C0:lerp(LHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha) | |
1646 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha) | |
1647 | elseif(State == 'Walk')then | |
1648 | local wsVal = 20 / (Hum.WalkSpeed/16) | |
1649 | local Alpha = math.min(.3 * (Hum.WalkSpeed/16),1) | |
1650 | RJ.C0 = RJ.C0:lerp(CF.N(0,0-.1*M.C(Sine/(wsVal/2)),0)*CF.A(M.R(-5-2.5*M.C(Sine/(wsVal/2))),M.R(8*M.C(Sine/wsVal)),0),Alpha) | |
1651 | NK.C0 = NK.C0:lerp(NKC0,Alpha) | |
1652 | LS.C0 = LS.C0:lerp(LSC0*CF.N(0,0,-.22*M.C(Sine/wsVal))*CF.A(M.R(37*M.C(Sine/wsVal)),0,M.R(-5)),Alpha) | |
1653 | RS.C0 = RS.C0:lerp(RSC0*CF.N(0,0,.22*M.C(Sine/wsVal))*CF.A(M.R(-37*M.C(Sine/wsVal)),0,M.R(5)),Alpha) | |
1654 | LH.C0 = LH.C0:lerp(LHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha) | |
1655 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha) | |
1656 | elseif(State == 'Jump')then | |
1657 | local Alpha = .1 | |
1658 | local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90)) | |
1659 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)),Alpha) | |
1660 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)),Alpha) | |
1661 | RJ.C0 = RJ.C0:lerp(RJC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha) | |
1662 | NK.C0 = NK.C0:lerp(NKC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha) | |
1663 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1664 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1665 | elseif(State == 'Fall')then | |
1666 | local Alpha = .1 | |
1667 | local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90)) | |
1668 | LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha) | |
1669 | RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha) | |
1670 | RJ.C0 = RJ.C0:lerp(RJC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha) | |
1671 | NK.C0 = NK.C0:lerp(NKC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha) | |
1672 | LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha) | |
1673 | RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha) | |
1674 | elseif(State == 'Paralyzed')then | |
1675 | -- paralyzed | |
1676 | elseif(State == 'Sit')then | |
1677 | -- sit | |
1678 | end | |
1679 | end | |
1680 | ||
1681 | end |