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