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