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