SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | ||
3 | ||
4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
6 | do | |
7 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") | |
8 | script.Parent = Player.Character | |
9 | ||
10 | --RemoteEvent for communicating | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | ||
14 | --Fake event to make stuff like Mouse.KeyDown work | |
15 | local function fakeEvent() | |
16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | ||
21 | --Creating fake input objects with fake variables | |
22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
24 | - | local Plr = Plrs.LocalPlayer |
24 | + | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) |
25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
26 | end} | |
27 | --Merged 2 functions into one by checking amount of arguments | |
28 | CAS.UnbindAction = CAS.BindAction | |
29 | ||
30 | --This function will trigger the events that have been :Connect()'ed | |
31 | local function te(self,ev,...) | |
32 | local t = m[ev] | |
33 | if t and t._fakeEvent and t.Function then | |
34 | t.Function(...) | |
35 | end | |
36 | end | |
37 | - | local Mouse = Plr:GetMouse() |
37 | + | m.TrigEvent = te |
38 | UIS.TrigEvent = te | |
39 | ||
40 | Event.OnServerEvent:Connect(function(plr,io) | |
41 | if plr~=Player then return end | |
42 | if io.isMouse then | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | else | |
46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
49 | end | |
50 | for _,t in pairs(CAS.Actions) do | |
51 | for _,k in pairs(t.Keys) do | |
52 | if k==io.KeyCode then | |
53 | t.Function(t.Name,io.UserInputState,io) | |
54 | end | |
55 | end | |
56 | end | |
57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
59 | end | |
60 | end) | |
61 | Event.Parent = NLS([==[ | |
62 | local Player = game:GetService("Players").LocalPlayer | |
63 | local Event = script:WaitForChild("UserInput_Event") | |
64 | ||
65 | local UIS = game:GetService("UserInputService") | |
66 | local input = function(io,a) | |
67 | if a then return end | |
68 | --Since InputObject is a client-side instance, we create and pass table instead | |
69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
70 | end | |
71 | UIS.InputBegan:Connect(input) | |
72 | UIS.InputEnded:Connect(input) | |
73 | ||
74 | local Mouse = Player:GetMouse() | |
75 | local h,t | |
76 | --Give the server mouse data 30 times every second, but only if the values changed | |
77 | --If player is not moving their mouse, client won't fire events | |
78 | while wait(1/30) do | |
79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
80 | h,t=Mouse.Hit,Mouse.Target | |
81 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
82 | end | |
83 | end]==],Player.Character) | |
84 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
85 | end | |
86 | ||
87 | -- Created by Nebula_Zorua -- | |
88 | -- Boreldi -- | |
89 | -- I was bored -- | |
90 | -- Discord: Nebula the Zorua#6969 | |
91 | -- Youtube: https://www.youtube.com/channel/UCo9oU9dCw8jnuVLuy4_SATA | |
92 | ||
93 | wait(1/60) | |
94 | ||
95 | --// Shortcut Variables \\-- | |
96 | local S = setmetatable({},{__index = function(s,i) return game:service(i) end}) | |
97 | local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ} | |
98 | local C3 = {N=Color3.new,RGB=Color3.fromRGB,HSV=Color3.fromHSV,tHSV=Color3.toHSV} | |
99 | local V3 = {N=Vector3.new,FNI=Vector3.FromNormalId,A=Vector3.FromAxis} | |
100 | 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} | |
101 | local R3 = {N=Region3.new} | |
102 | local De = S.Debris | |
103 | local WS = workspace | |
104 | local Lght = S.Lighting | |
105 | local RepS = S.ReplicatedStorage | |
106 | local IN = Instance.new | |
107 | local Plrs = S.Players | |
108 | ||
109 | --// Initializing \\-- | |
110 | local Plr = Plrs.wrrrryyyyyyyyyyyyyyy | |
111 | local Char = Plr.Character | |
112 | local Hum = Char:FindFirstChildOfClass'Humanoid' | |
113 | local RArm = Char["Right Arm"] | |
114 | local LArm = Char["Left Arm"] | |
115 | local RLeg = Char["Right Leg"] | |
116 | local LLeg = Char["Left Leg"] | |
117 | local Root = Char:FindFirstChild'HumanoidRootPart' | |
118 | local Torso = Char.Torso | |
119 | local Head = Char.Head | |
120 | local NeutralAnims = true | |
121 | local Attack = false | |
122 | local Debounces = {Debounces={}} | |
123 | local Hit = {} | |
124 | local Sine = 0 | |
125 | local Change = 1 | |
126 | local BloodPuddles = {} | |
127 | ||
128 | local Effects = IN("Folder",Char) | |
129 | Effects.Name = "Effects" | |
130 | ||
131 | ||
132 | --// Debounce System \\-- | |
133 | ||
134 | ||
135 | function Debounces:New(name,cooldown) | |
136 | local aaaaa = {Usable=true,Cooldown=cooldown or 2,CoolingDown=false,LastUse=0} | |
137 | setmetatable(aaaaa,{__index = Debounces}) | |
138 | Debounces.Debounces[name] = aaaaa | |
139 | return aaaaa | |
140 | end | |
141 | ||
142 | function Debounces:Use(overrideUsable) | |
143 | assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use") | |
144 | if(self.Usable or overrideUsable)then | |
145 | self.Usable = false | |
146 | self.CoolingDown = true | |
147 | local LastUse = time() | |
148 | self.LastUse = LastUse | |
149 | delay(self.Cooldown or 2,function() | |
150 | if(self.LastUse == LastUse)then | |
151 | self.CoolingDown = false | |
152 | self.Usable = true | |
153 | end | |
154 | end) | |
155 | end | |
156 | end | |
157 | ||
158 | function Debounces:Get(name) | |
159 | assert(typeof(name) == 'string',("bad argument #1 to 'get' (string expected, got %s)"):format(typeof(name) == nil and "no value" or typeof(name))) | |
160 | for i,v in next, Debounces.Debounces do | |
161 | if(i == name)then | |
162 | return v; | |
163 | end | |
164 | end | |
165 | end | |
166 | ||
167 | function Debounces:GetProgressPercentage() | |
168 | assert(self.Usable ~= nil and self.LastUse ~= nil and self.CoolingDown ~= nil,"Expected ':' not '.' calling member function Use") | |
169 | if(self.CoolingDown and not self.Usable)then | |
170 | return math.max( | |
171 | math.floor( | |
172 | ( | |
173 | (time()-self.LastUse)/self.Cooldown or 2 | |
174 | )*100 | |
175 | ) | |
176 | ) | |
177 | else | |
178 | return 100 | |
179 | end | |
180 | end | |
181 | ||
182 | --// Instance Creation Functions \\-- | |
183 | local baseSound = IN("Sound") | |
184 | function Sound(parent,id,pitch,volume,looped,effect,autoPlay) | |
185 | local Sound = baseSound:Clone() | |
186 | Sound.SoundId = "rbxassetid://".. tostring(id or 0) | |
187 | Sound.Pitch = pitch or 1 | |
188 | Sound.Volume = volume or 1 | |
189 | Sound.Looped = looped or false | |
190 | if(autoPlay)then | |
191 | coroutine.wrap(function() | |
192 | repeat wait() until Sound.IsLoaded | |
193 | Sound.Playing = autoPlay or false | |
194 | end)() | |
195 | end | |
196 | if(not looped and effect)then | |
197 | Sound.Stopped:connect(function() | |
198 | Sound.Volume = 0 | |
199 | Sound:destroy() | |
200 | end) | |
201 | elseif(effect)then | |
202 | warn("Sound can't be looped and a sound effect!") | |
203 | end | |
204 | Sound.Parent =parent or Torso | |
205 | return Sound | |
206 | end | |
207 | function Part(parent,color,material,size,cframe,anchored,cancollide) | |
208 | local part = IN("Part") | |
209 | part.Parent = parent or Char | |
210 | part[typeof(color) == 'BrickColor' and 'BrickColor' or 'Color'] = color or C3.N(0,0,0) | |
211 | part.Material = material or Enum.Material.SmoothPlastic | |
212 | part.TopSurface,part.BottomSurface=10,10 | |
213 | part.Size = size or V3.N(1,1,1) | |
214 | part.CFrame = cframe or CF.N(0,0,0) | |
215 | part.CanCollide = cancollide or false | |
216 | part.Anchored = anchored or false | |
217 | return part | |
218 | end | |
219 | ||
220 | function Weld(part0,part1,c0,c1) | |
221 | local weld = IN("Weld") | |
222 | weld.Parent = part0 | |
223 | weld.Part0 = part0 | |
224 | weld.Part1 = part1 | |
225 | weld.C0 = c0 or CF.N() | |
226 | weld.C1 = c1 or CF.N() | |
227 | return weld | |
228 | end | |
229 | ||
230 | function Mesh(parent,meshtype,meshid,textid,scale,offset) | |
231 | local part = IN("SpecialMesh") | |
232 | part.MeshId = meshid or "" | |
233 | part.TextureId = textid or "" | |
234 | part.Scale = scale or V3.N(1,1,1) | |
235 | part.Offset = offset or V3.N(0,0,0) | |
236 | part.MeshType = meshtype or Enum.MeshType.Sphere | |
237 | part.Parent = parent | |
238 | return part | |
239 | end | |
240 | ||
241 | NewInstance = function(instance,parent,properties) | |
242 | local inst = Instance.new(instance) | |
243 | inst.Parent = parent | |
244 | if(properties)then | |
245 | for i,v in next, properties do | |
246 | pcall(function() inst[i] = v end) | |
247 | end | |
248 | end | |
249 | return inst; | |
250 | end | |
251 | ||
252 | function Clone(instance,parent,properties) | |
253 | local inst = instance:Clone() | |
254 | inst.Parent = parent | |
255 | if(properties)then | |
256 | for i,v in next, properties do | |
257 | pcall(function() inst[i] = v end) | |
258 | end | |
259 | end | |
260 | return inst; | |
261 | end | |
262 | ||
263 | function SoundPart(id,pitch,volume,looped,effect,autoPlay,cf) | |
264 | local soundPart = NewInstance("Part",Effects,{Transparency=1,CFrame=cf or Torso.CFrame,Anchored=true,CanCollide=false,Size=V3.N()}) | |
265 | local Sound = IN("Sound") | |
266 | Sound.SoundId = "rbxassetid://".. tostring(id or 0) | |
267 | Sound.Pitch = pitch or 1 | |
268 | Sound.Volume = volume or 1 | |
269 | Sound.Looped = looped or false | |
270 | if(autoPlay)then | |
271 | coroutine.wrap(function() | |
272 | repeat wait() until Sound.IsLoaded | |
273 | Sound.Playing = autoPlay or false | |
274 | end)() | |
275 | end | |
276 | if(not looped and effect)then | |
277 | Sound.Stopped:connect(function() | |
278 | Sound.Volume = 0 | |
279 | soundPart:destroy() | |
280 | end) | |
281 | elseif(effect)then | |
282 | warn("Sound can't be looped and a sound effect!") | |
283 | end | |
284 | Sound.Parent = soundPart | |
285 | return Sound | |
286 | end | |
287 | ||
288 | ||
289 | --// Extended ROBLOX tables \\-- | |
290 | 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}) | |
291 | --// Require stuff \\-- | |
292 | function CamShake(who,times,intense,origin) | |
293 | coroutine.wrap(function() | |
294 | if(script:FindFirstChild'CamShake')then | |
295 | local cam = script.CamShake:Clone() | |
296 | cam:WaitForChild'intensity'.Value = intense | |
297 | cam:WaitForChild'times'.Value = times | |
298 | ||
299 | if(origin)then NewInstance((typeof(origin) == 'Instance' and "ObjectValue" or typeof(origin) == 'Vector3' and 'Vector3Value'),cam,{Name='origin',Value=origin}) end | |
300 | cam.Parent = who | |
301 | wait() | |
302 | cam.Disabled = false | |
303 | elseif(who == Plr or who == Char or who:IsDescendantOf(Plr))then | |
304 | local intensity = intense | |
305 | if(Hum and not Hum:FindFirstChild'CamShaking')then | |
306 | local cam = workspace.CurrentCamera | |
307 | local oCO = Hum.CameraOffset | |
308 | local cs = Instance.new("BoolValue",Hum) | |
309 | cs.Name = "CamShaking" | |
310 | for i = 1, times do | |
311 | local camDistFromOrigin | |
312 | if(typeof(origin) == 'Instance' and origin:IsA'BasePart')then | |
313 | camDistFromOrigin = math.floor( (cam.CoordinateFrame.p-origin.Position).magnitude )/25 | |
314 | elseif(typeof(origin) == 'Vector3')then | |
315 | camDistFromOrigin = math.floor( (cam.CoordinateFrame.p-origin).magnitude )/25 | |
316 | end | |
317 | if(camDistFromOrigin)then | |
318 | intensity = math.min(intense, math.floor(intense/camDistFromOrigin)) | |
319 | end | |
320 | --cam.CoordinateFrame = cam.CoordinateFrame*CFrame.fromEulerAnglesXYZ(math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200) | |
321 | if(Hum)then | |
322 | Hum.CameraOffset = Vector3.new(math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200) | |
323 | end | |
324 | swait() | |
325 | end | |
326 | if(Hum)then | |
327 | Hum.CameraOffset = oCO | |
328 | end | |
329 | cs:destroy() | |
330 | end | |
331 | end | |
332 | end)() | |
333 | end | |
334 | ||
335 | ||
336 | function CamShakeAll(times,intense,origin) | |
337 | for _,v in next, Plrs:players() do | |
338 | CamShake(v:FindFirstChildOfClass'PlayerGui' or v:FindFirstChildOfClass'Backpack' or v.Character,times,intense,origin) | |
339 | end | |
340 | end | |
341 | ||
342 | function ServerScript(code) | |
343 | if(script:FindFirstChild'Loadstring')then | |
344 | local load = script.Loadstring:Clone() | |
345 | load:WaitForChild'Sauce'.Value = code | |
346 | load.Disabled = false | |
347 | load.Parent = workspace | |
348 | elseif(NS and typeof(NS) == 'function')then | |
349 | NS(code,workspace) | |
350 | else | |
351 | warn("no serverscripts lol") | |
352 | end | |
353 | end | |
354 | ||
355 | function LocalOnPlayer(who,code) | |
356 | ServerScript([[ | |
357 | wait() | |
358 | script.Parent=nil | |
359 | if(not _G.Http)then _G.Http = game:service'HttpService' end | |
360 | ||
361 | local Http = _G.Http or game:service'HttpService' | |
362 | ||
363 | local source = ]].."[["..code.."]]"..[[ | |
364 | local link = "https://api.vorth.xyz/R_API/R.UPLOAD/NEW_LOCAL.php" | |
365 | local asd = Http:PostAsync(link,source) | |
366 | repeat wait() until asd and Http:JSONDecode(asd) and Http:JSONDecode(asd).Result and Http:JSONDecode(asd).Result.Require_ID | |
367 | local ID = Http:JSONDecode(asd).Result.Require_ID | |
368 | local vs = require(ID).VORTH_SCRIPT | |
369 | vs.Parent = game:service'Players'.]]..who.Name..[[.Character | |
370 | ]]) | |
371 | end | |
372 | ||
373 | ||
374 | --// Customization \\-- | |
375 | ||
376 | local Frame_Speed = 60 -- The frame speed for swait. 1 is automatically divided by this | |
377 | local Remove_Hats = true | |
378 | local Remove_Clothing = true | |
379 | local PlayerSize = 1 | |
380 | local DamageColor = BrickColor.new'Really red' | |
381 | local MusicID = 1718183351 | |
382 | local God = false | |
383 | local Muted = false | |
384 | local angerCounter = 1; -- lower = faster | |
385 | local angry = false | |
386 | ||
387 | local WalkSpeed = 16 | |
388 | ||
389 | --// Weapon and GUI creation, and Character Customization \\-- | |
390 | ||
391 | if(Remove_Hats)then Instance.ClearChildrenOfClass(Char,"Accessory",true) end | |
392 | if(Remove_Clothing)then Instance.ClearChildrenOfClass(Char,"Clothing",true) Instance.ClearChildrenOfClass(Char,"ShirtGraphic",true) end | |
393 | ||
394 | local rule = Part(Char,BrickColor.new'Linen',Enum.Material.Wood,V3.N(.2,.5,4),CF.N(),false,false) | |
395 | local rd = NewInstance("Decal",rule,{Texture='rbxassetid://109519158',Face='Right'}) | |
396 | local ld = NewInstance("Decal",rule,{Texture='rbxassetid://109519158',Face='Left'}) | |
397 | ||
398 | if(PlayerSize ~= 1)then | |
399 | for _,v in next, Char:GetDescendants() do | |
400 | if(v:IsA'BasePart')then | |
401 | v.Size = v.Size * PlayerSize | |
402 | end | |
403 | end | |
404 | end | |
405 | ||
406 | ||
407 | local Music = Sound(Char,MusicID,1,3,true,false,true) | |
408 | Music.Name = 'Music' | |
409 | ||
410 | --// Stop animations \\-- | |
411 | for _,v in next, Hum:GetPlayingAnimationTracks() do | |
412 | v:Stop(); | |
413 | end | |
414 | ||
415 | pcall(game.Destroy,Char:FindFirstChild'Animate') | |
416 | pcall(game.Destroy,Hum:FindFirstChild'Animator') | |
417 | ||
418 | --// Joints \\-- | |
419 | ||
420 | local LS = NewInstance('Motor',Char,{Part0=Torso,Part1=LArm,C0 = CF.N(-1.5 * PlayerSize,0.5 * PlayerSize,0),C1 = CF.N(0,.5 * PlayerSize,0)}) | |
421 | local RS = NewInstance('Motor',Char,{Part0=Torso,Part1=RArm,C0 = CF.N(1.5 * PlayerSize,0.5 * PlayerSize,0),C1 = CF.N(0,.5 * PlayerSize,0)}) | |
422 | local NK = NewInstance('Motor',Char,{Part0=Torso,Part1=Head,C0 = CF.N(0,1.5 * PlayerSize,0)}) | |
423 | local LH = NewInstance('Motor',Char,{Part0=Torso,Part1=LLeg,C0 = CF.N(-.5 * PlayerSize,-1 * PlayerSize,0),C1 = CF.N(0,1 * PlayerSize,0)}) | |
424 | local RH = NewInstance('Motor',Char,{Part0=Torso,Part1=RLeg,C0 = CF.N(.5 * PlayerSize,-1 * PlayerSize,0),C1 = CF.N(0,1 * PlayerSize,0)}) | |
425 | local RJ = NewInstance('Motor',Char,{Part0=Root,Part1=Torso}) | |
426 | local HW = NewInstance('Motor',Char,{Part0=RArm,Part1=rule,C0=CF.N(0,-1,-1)}) | |
427 | ||
428 | local LSC0 = LS.C0 | |
429 | local RSC0 = RS.C0 | |
430 | local NKC0 = NK.C0 | |
431 | local LHC0 = LH.C0 | |
432 | local RHC0 = RH.C0 | |
433 | local RJC0 = RJ.C0 | |
434 | ||
435 | --// Artificial HB \\-- | |
436 | ||
437 | local ArtificialHB = IN("BindableEvent", script) | |
438 | ArtificialHB.Name = "Heartbeat" | |
439 | ||
440 | script:WaitForChild("Heartbeat") | |
441 | ||
442 | local tf = 0 | |
443 | local allowframeloss = false | |
444 | local tossremainder = false | |
445 | local lastframe = tick() | |
446 | local frame = 1/Frame_Speed | |
447 | ArtificialHB:Fire() | |
448 | ||
449 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
450 | tf = tf + s | |
451 | if tf >= frame then | |
452 | if allowframeloss then | |
453 | script.Heartbeat:Fire() | |
454 | lastframe = tick() | |
455 | else | |
456 | for i = 1, math.floor(tf / frame) do | |
457 | ArtificialHB:Fire() | |
458 | end | |
459 | lastframe = tick() | |
460 | end | |
461 | if tossremainder then | |
462 | tf = 0 | |
463 | else | |
464 | tf = tf - frame * math.floor(tf / frame) | |
465 | end | |
466 | end | |
467 | end) | |
468 | ||
469 | function swait(num) | |
470 | if num == 0 or num == nil then | |
471 | ArtificialHB.Event:wait() | |
472 | else | |
473 | for i = 0, num do | |
474 | ArtificialHB.Event:wait() | |
475 | end | |
476 | end | |
477 | end | |
478 | ||
479 | ||
480 | --// Effect Function(s) \\-- | |
481 | ||
482 | function NoobySphere(Lifetime,Speed,Type,Pos,StartSize,Inc,Color,Range,MeshId,Axis) | |
483 | local fxP = Part(Effects,Color,Enum.Material.Neon,V3.N(1,1,1),Pos+Pos.lookVector*Range,true,false) | |
484 | local fxM = Mesh(fxP,(MeshId and Enum.MeshType.FileMesh or Enum.MeshType.Sphere),(MeshId and "rbxassetid://"..MeshId or ""),"",StartSize,V3.N()) | |
485 | local Scale = 1 | |
486 | local speeder = Speed | |
487 | if(Type == "Multiply")then | |
488 | Scale = 1*Inc | |
489 | elseif(Type == "Divide")then | |
490 | Scale = 1/Inc | |
491 | end | |
492 | coroutine.wrap(function() | |
493 | for i = 0,10/Lifetime,.1 do | |
494 | ||
495 | if(Type == "Multiply")then | |
496 | Scale = Scale - 0.01*Inc/Lifetime | |
497 | elseif(Type == "Divide")then | |
498 | Scale = Scale - 0.01/Inc*Lifetime | |
499 | end | |
500 | speeder = speeder - 0.01*Speed*Lifetime | |
501 | fxP.CFrame = fxP.CFrame + fxP.CFrame.lookVector*speeder*Lifetime | |
502 | fxP.Transparency = fxP.Transparency + 0.01*Lifetime | |
503 | if(Axis == 'x')then | |
504 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime, 0, 0) | |
505 | elseif(Axis == 'y')then | |
506 | fxM.Scale = fxM.Scale + Vector3.new(0, Scale*Lifetime, 0) | |
507 | elseif(Axis == 'z')then | |
508 | fxM.Scale = fxM.Scale + Vector3.new(0, 0, Scale*Lifetime) | |
509 | elseif(Axis == 'xyz')then | |
510 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime,Scale*Lifetime,Scale*Lifetime) | |
511 | elseif(Axis == 'yz')then | |
512 | fxM.Scale = fxM.Scale + Vector3.new(0,Scale*Lifetime,Scale*Lifetime) | |
513 | elseif(Axis == 'xz')then | |
514 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime,0,Scale*Lifetime) | |
515 | else | |
516 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime, Scale*Lifetime, 0) | |
517 | end | |
518 | if(fxP.Transparency >= 1)then break end | |
519 | swait() | |
520 | end | |
521 | fxP:destroy() | |
522 | end)() | |
523 | return fxP | |
524 | end | |
525 | ||
526 | function NoobySphere2(Lifetime,Type,Pos,StartSize,Inc,Color,MeshId) | |
527 | local fxP = Part(Effects,Color,Enum.Material.Neon,V3.N(1,1,1),Pos,true,false) | |
528 | local fxM = Mesh(fxP,(MeshId and Enum.MeshType.FileMesh or Enum.MeshType.Sphere),(MeshId and "rbxassetid://"..MeshId or ""),"",StartSize,V3.N()) | |
529 | ||
530 | local Scale = 1 | |
531 | if(Type == "Multiply")then | |
532 | Scale = 1*Inc | |
533 | elseif(Type == "Divide")then | |
534 | Scale = 1/Inc | |
535 | end | |
536 | coroutine.wrap(function() | |
537 | for i = 0,10/Lifetime,.1 do | |
538 | ||
539 | if(Type == "Multiply")then | |
540 | Scale = Scale - 0.01*Inc/Lifetime | |
541 | elseif(Type == "Divide")then | |
542 | Scale = Scale - 0.01/Inc*Lifetime | |
543 | end | |
544 | fxP.Transparency = fxP.Transparency + 0.01*Lifetime | |
545 | fxM.Scale = fxM.Scale + Vector3.new(Scale*Lifetime, Scale*Lifetime, Scale*Lifetime) | |
546 | swait() | |
547 | end | |
548 | fxP:destroy() | |
549 | end)() | |
550 | end | |
551 | ||
552 | function NoobyBlock(Lifetime,Speed,Type,Pos,StartSize,Inc,Color,Range,Fade,MeshId) | |
553 | local fxP = Part(Effects,Color,Enum.Material.Neon,V3.N(1,1,1),Pos+Pos.lookVector*Range,true,false) | |
554 | local fxM = Mesh(fxP,(MeshId and Enum.MeshType.FileMesh or Enum.MeshType.Brick),(MeshId and "rbxassetid://"..MeshId or ""),"",StartSize,V3.N()) | |
555 | local Scale = 1 | |
556 | local speeder = Speed | |
557 | if(Type == "Multiply")then | |
558 | Scale = 1*Inc | |
559 | elseif(Type == "Divide")then | |
560 | Scale = 1/Inc | |
561 | end | |
562 | coroutine.wrap(function() | |
563 | for i = 0,10/Lifetime,.1 do | |
564 | if(Type == "Multiply")then | |
565 | Scale = Scale - 0.01*Inc/Lifetime | |
566 | elseif(Type == "Divide")then | |
567 | Scale = Scale - 0.01/Inc*Lifetime | |
568 | end | |
569 | if(Fade)then | |
570 | fxP.Transparency = i/(10/Lifetime) | |
571 | end | |
572 | speeder = speeder - 0.01*Speed*Lifetime/10 | |
573 | fxP.CFrame = fxP.CFrame + fxP.CFrame.lookVector*speeder*Lifetime | |
574 | fxM.Scale = fxM.Scale - Vector3.new(Scale*Lifetime, Scale*Lifetime, Scale*Lifetime) | |
575 | swait() | |
576 | end | |
577 | fxP:destroy() | |
578 | end)() | |
579 | end | |
580 | ||
581 | function Bezier(startpos, pos2, pos3, endpos, t) | |
582 | local A = startpos:lerp(pos2, t) | |
583 | local B = pos2:lerp(pos3, t) | |
584 | local C = pos3:lerp(endpos, t) | |
585 | local lerp1 = A:lerp(B, t) | |
586 | local lerp2 = B:lerp(C, t) | |
587 | local cubic = lerp1:lerp(lerp2, t) | |
588 | return cubic | |
589 | end | |
590 | function Puddle(hit,pos,norm,data) | |
591 | local material = data.Material or Enum.Material.SmoothPlastic | |
592 | local color = data.Color or BrickColor.new'Crimson' | |
593 | local size = data.Size or 1 | |
594 | ||
595 | if(hit.Name ~= 'BloodPuddle')then | |
596 | local Puddle = NewInstance('Part',workspace,{Material=material,BrickColor=color,Size=V3.N(size,.1,size),CFrame=CF.N(pos,pos+norm)*CF.A(90*M.P/180,0,0),Anchored=true,CanCollide=false,Archivable=false,Locked=true,Name='BloodPuddle'}) | |
597 | local Cyl = NewInstance('CylinderMesh',Puddle,{Name='CylinderMesh'}) | |
598 | BloodPuddles[Puddle] = 0 | |
599 | else | |
600 | local cyl = hit:FindFirstChild'CylinderMesh' | |
601 | if(cyl)then | |
602 | BloodPuddles[hit] = 0 | |
603 | cyl.Scale = cyl.Scale + V3.N(size,0,size) | |
604 | hit.Transparency = 0 | |
605 | end | |
606 | end | |
607 | end | |
608 | ||
609 | function Droplet(data) | |
610 | --ShootBullet{Size=V3.N(3,3,3),Shape='Ball',Frames=160,Origin=data.Circle.CFrame,Speed=10} | |
611 | local Size = data.Size or 1 | |
612 | local Color = data.Color or BrickColor.new'Crimson' | |
613 | local StudsPerFrame = data.Speed or 1 | |
614 | local Shape = data.Shape or 'Ball' | |
615 | local Frames = (data.Frames or 160)+1 | |
616 | local Pos = data.Origin or Root.CFrame | |
617 | local Direction = data.Direction or Root.CFrame.lookVector*100000 | |
618 | local Material = data.Material or Enum.Material.SmoothPlastic | |
619 | local Drop = data.Drop or .05 | |
620 | local Ignorelist = data.Ignorelist or nil | |
621 | ||
622 | local Bullet = Part(Effects,Color,Material,V3.N(Size,Size,Size),Pos,true,false) | |
623 | local BMesh = Mesh(Bullet,Enum.MeshType.Brick,"","",V3.N(1,1,1),V3.N()) | |
624 | if(Shape == 'Ball')then | |
625 | BMesh.MeshType = Enum.MeshType.Sphere | |
626 | elseif(Shape == 'Head')then | |
627 | BMesh.MeshType = Enum.MeshType.Head | |
628 | elseif(Shape == 'Cylinder')then | |
629 | BMesh.MeshType = Enum.MeshType.Cylinder | |
630 | end | |
631 | ||
632 | coroutine.wrap(function() | |
633 | for i = 1, Frames do | |
634 | Pos = Pos * CF.N(0,-(Drop*i),0) | |
635 | local hit,pos,norm,dist = CastRay(Bullet.CFrame.p,CF.N(Pos.p,Direction)*CF.N(0,0,-(StudsPerFrame*i)).p,StudsPerFrame) | |
636 | if(hit and (not hit.Parent or not hit.Parent:FindFirstChildOfClass'Humanoid' and not hit.Parent:IsA'Accessory'))then | |
637 | Puddle(hit,pos,norm,data) | |
638 | break; | |
639 | else | |
640 | Bullet.CFrame = CF.N(Pos.p,Direction)*CF.N(0,0,-(StudsPerFrame*i)) | |
641 | end | |
642 | swait() | |
643 | end | |
644 | Bullet:destroy() | |
645 | end)() | |
646 | end | |
647 | ||
648 | function SphereFX(duration,color,scale,pos,endScale,increment) | |
649 | return Effect{ | |
650 | Effect='ResizeAndFade', | |
651 | Color=color, | |
652 | Size=scale, | |
653 | Mesh={MeshType=Enum.MeshType.Sphere}, | |
654 | CFrame=pos, | |
655 | FXSettings={ | |
656 | EndSize=endScale, | |
657 | EndIsIncrement=increment | |
658 | } | |
659 | } | |
660 | end | |
661 | ||
662 | function BlastFX(duration,color,scale,pos,endScale,increment) | |
663 | return Effect{ | |
664 | Effect='ResizeAndFade', | |
665 | Color=color, | |
666 | Size=scale, | |
667 | Mesh={MeshType=Enum.MeshType.FileMesh,MeshId='rbxassetid://20329976'}, | |
668 | CFrame=pos, | |
669 | FXSettings={ | |
670 | EndSize=endScale, | |
671 | EndIsIncrement=increment | |
672 | } | |
673 | } | |
674 | end | |
675 | ||
676 | function BlockFX(duration,color,scale,pos,endScale,increment) | |
677 | return Effect{ | |
678 | Effect='ResizeAndFade', | |
679 | Color=color, | |
680 | Size=scale, | |
681 | CFrame=pos, | |
682 | FXSettings={ | |
683 | EndSize=endScale, | |
684 | EndIsIncrement=increment | |
685 | } | |
686 | } | |
687 | end | |
688 | ||
689 | function ShootBullet(data) | |
690 | --ShootBullet{Size=V3.N(3,3,3),Shape='Ball',Frames=160,Origin=data.Circle.CFrame,Speed=10} | |
691 | local Size = data.Size or V3.N(2,2,2) | |
692 | local Color = data.Color or BrickColor.new'Crimson' | |
693 | local StudsPerFrame = data.Speed or 10 | |
694 | local Shape = data.Shape or 'Ball' | |
695 | local Frames = data.Frames or 160 | |
696 | local Pos = data.Origin or Torso.CFrame | |
697 | local Direction = data.Direction or Mouse.Hit | |
698 | local Material = data.Material or Enum.Material.Neon | |
699 | local OnHit = data.HitFunction or function(hit,pos) | |
700 | Effect{ | |
701 | Effect='ResizeAndFade', | |
702 | Color=Color, | |
703 | Size=V3.N(10,10,10), | |
704 | Mesh={MeshType=Enum.MeshType.Sphere}, | |
705 | CFrame=CF.N(pos), | |
706 | FXSettings={ | |
707 | EndSize=V3.N(.05,.05,.05), | |
708 | EndIsIncrement=true | |
709 | } | |
710 | } | |
711 | for i = 1, 5 do | |
712 | local angles = CF.A(M.RRNG(-180,180),M.RRNG(-180,180),M.RRNG(-180,180)) | |
713 | Effect{ | |
714 | Effect='Fade', | |
715 | Frames=65, | |
716 | Size=V3.N(5,5,10), | |
717 | CFrame=CF.N(CF.N(pos)*angles*CF.N(0,0,-10).p,pos), | |
718 | Mesh = {MeshType=Enum.MeshType.Sphere}, | |
719 | Material=Enum.Material.Neon, | |
720 | Color=Color, | |
721 | MoveDirection=CF.N(CF.N(pos)*angles*CF.N(0,0,-50).p,pos).p, | |
722 | } | |
723 | end | |
724 | end | |
725 | ||
726 | local Bullet = Part(Effects,Color,Material,Size,Pos,true,false) | |
727 | local BMesh = Mesh(Bullet,Enum.MeshType.Brick,"","",V3.N(1,1,1),V3.N()) | |
728 | if(Shape == 'Ball')then | |
729 | BMesh.MeshType = Enum.MeshType.Sphere | |
730 | elseif(Shape == 'Head')then | |
731 | BMesh.MeshType = Enum.MeshType.Head | |
732 | elseif(Shape == 'Cylinder')then | |
733 | BMesh.MeshType = Enum.MeshType.Cylinder | |
734 | end | |
735 | ||
736 | coroutine.wrap(function() | |
737 | for i = 1, Frames+1 do | |
738 | local hit,pos,norm,dist = CastRay(Bullet.CFrame.p,CF.N(Bullet.CFrame.p,Direction.p)*CF.N(0,0,-StudsPerFrame).p,StudsPerFrame) | |
739 | if(hit)then | |
740 | OnHit(hit,pos,norm,dist) | |
741 | break; | |
742 | else | |
743 | Bullet.CFrame = CF.N(Bullet.CFrame.p,Direction.p)*CF.N(0,0,-StudsPerFrame) | |
744 | end | |
745 | swait() | |
746 | end | |
747 | Bullet:destroy() | |
748 | end)() | |
749 | ||
750 | end | |
751 | ||
752 | ||
753 | function Zap(data) | |
754 | local sCF,eCF = data.StartCFrame,data.EndCFrame | |
755 | assert(sCF,"You need a start CFrame!") | |
756 | assert(eCF,"You need an end CFrame!") | |
757 | local parts = data.PartCount or 15 | |
758 | local zapRot = data.ZapRotation or {-5,5} | |
759 | local startThick = data.StartSize or 3; | |
760 | local endThick = data.EndSize or startThick/2; | |
761 | local color = data.Color or BrickColor.new'Electric blue' | |
762 | local delay = data.Delay or 35 | |
763 | local delayInc = data.DelayInc or 0 | |
764 | local lastLightning; | |
765 | local MagZ = (sCF.p - eCF.p).magnitude | |
766 | local thick = startThick | |
767 | local inc = (startThick/parts)-(endThick/parts) | |
768 | ||
769 | for i = 1, parts do | |
770 | local pos = sCF.p | |
771 | if(lastLightning)then | |
772 | pos = lastLightning.CFrame*CF.N(0,0,MagZ/parts/2).p | |
773 | end | |
774 | delay = delay + delayInc | |
775 | local zapPart = Part(Effects,color,Enum.Material.Neon,V3.N(thick,thick,MagZ/parts),CF.N(pos),true,false) | |
776 | 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))) | |
777 | if(parts == i)then | |
778 | local MagZ = (pos-eCF.p).magnitude | |
779 | zapPart.Size = V3.N(endThick,endThick,MagZ) | |
780 | zapPart.CFrame = CF.N(pos, eCF.p)*CF.N(0,0,-MagZ/2) | |
781 | 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)}} | |
782 | else | |
783 | zapPart.CFrame = CF.N(pos,posie)*CF.N(0,0,MagZ/parts/2) | |
784 | end | |
785 | ||
786 | lastLightning = zapPart | |
787 | Effect{Effect='Fade',Manual=zapPart,Frames=delay} | |
788 | ||
789 | thick=thick-inc | |
790 | ||
791 | end | |
792 | end | |
793 | ||
794 | function Zap2(data) | |
795 | local Color = data.Color or BrickColor.new'Electric blue' | |
796 | local StartPos = data.Start or Torso.Position | |
797 | local EndPos = data.End or Mouse.Hit.p | |
798 | local SegLength = data.SegL or 2 | |
799 | local Thicc = data.Thickness or 0.5 | |
800 | local Fades = data.Fade or 45 | |
801 | local Parent = data.Parent or Effects | |
802 | local MaxD = data.MaxDist or 200 | |
803 | local Branch = data.Branches or false | |
804 | local Material = data.Material or Enum.Material.Neon | |
805 | local Raycasts = data.Raycasts or false | |
806 | local Offset = data.Offset or {0,360} | |
807 | local AddMesh = (data.Mesh == nil and true or data.Mesh) | |
808 | if((StartPos-EndPos).magnitude > MaxD)then | |
809 | EndPos = CF.N(StartPos,EndPos)*CF.N(0,0,-MaxD).p | |
810 | end | |
811 | local hit,pos,norm,dist=nil,EndPos,nil,(StartPos-EndPos).magnitude | |
812 | if(Raycasts)then | |
813 | hit,pos,norm,dist = CastRay(StartPos,EndPos,MaxD) | |
814 | end | |
815 | local segments = dist/SegLength | |
816 | local model = IN("Model",Parent) | |
817 | model.Name = 'Lightning' | |
818 | local Last; | |
819 | for i = 1, segments do | |
820 | local size = (segments-i)/25 | |
821 | local prt = Part(model,Color,Material,V3.N(Thicc+size,SegLength,Thicc+size),CF.N(),true,false) | |
822 | if(AddMesh)then IN("CylinderMesh",prt) end | |
823 | if(Last and math.floor(segments) == i)then | |
824 | local MagZ = (Last.CFrame*CF.N(0,-SegLength/2,0).p-EndPos).magnitude | |
825 | prt.Size = V3.N(Thicc+size,MagZ,Thicc+size) | |
826 | 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) | |
827 | elseif(not Last)then | |
828 | prt.CFrame = CF.N(StartPos,pos)*CF.A(M.R(90),0,0)*CF.N(0,-SegLength/2,0) | |
829 | else | |
830 | 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) | |
831 | end | |
832 | Last = prt | |
833 | if(Branch)then | |
834 | local choice = M.RNG(1,7+((segments-i)*2)) | |
835 | if(choice == 1)then | |
836 | local LastB; | |
837 | for i2 = 1,M.RNG(2,5) do | |
838 | local size2 = ((segments-i)/35)/i2 | |
839 | local prt = Part(model,Color,Material,V3.N(Thicc+size2,SegLength,Thicc+size2),CF.N(),true,false) | |
840 | if(AddMesh)then IN("CylinderMesh",prt) end | |
841 | if(not LastB)then | |
842 | 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) | |
843 | else | |
844 | 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) | |
845 | end | |
846 | LastB = prt | |
847 | end | |
848 | end | |
849 | end | |
850 | end | |
851 | if(Fades > 0)then | |
852 | coroutine.wrap(function() | |
853 | for i = 1, Fades do | |
854 | for _,v in next, model:children() do | |
855 | if(v:IsA'BasePart')then | |
856 | v.Transparency = (i/Fades) | |
857 | end | |
858 | end | |
859 | swait() | |
860 | end | |
861 | model:destroy() | |
862 | end)() | |
863 | else | |
864 | S.Debris:AddItem(model,.01) | |
865 | end | |
866 | return {End=(Last and Last.CFrame*CF.N(0,-Last.Size.Y/2,0).p),Last=Last,Model=model} | |
867 | end | |
868 | ||
869 | function Tween(obj,props,time,easing,direction,repeats,backwards) | |
870 | local info = TweenInfo.new(time or .5, easing or Enum.EasingStyle.Quad, direction or Enum.EasingDirection.Out, repeats or 0, backwards or false) | |
871 | local tween = S.TweenService:Create(obj, info, props) | |
872 | ||
873 | tween:Play() | |
874 | end | |
875 | ||
876 | function Effect(data) | |
877 | local FX = data.Effect or 'ResizeAndFade' | |
878 | local Parent = data.Parent or Effects | |
879 | local Color = data.Color or C3.N(0,0,0) | |
880 | local Size = data.Size or V3.N(1,1,1) | |
881 | local MoveDir = data.MoveDirection or nil | |
882 | local MeshData = data.Mesh or nil | |
883 | local SndData = data.Sound or nil | |
884 | local Frames = data.Frames or 45 | |
885 | local Manual = data.Manual or nil | |
886 | local Material = data.Material or nil | |
887 | local CFra = data.CFrame or Torso.CFrame | |
888 | local Settings = data.FXSettings or {} | |
889 | local Shape = data.Shape or Enum.PartType.Block | |
890 | local Snd,Prt,Msh; | |
891 | local RotInc = data.RotInc or {0,0,0} | |
892 | if(typeof(RotInc) == 'number')then | |
893 | RotInc = {RotInc,RotInc,RotInc} | |
894 | end | |
895 | coroutine.wrap(function() | |
896 | if(Manual and typeof(Manual) == 'Instance' and Manual:IsA'BasePart')then | |
897 | Prt = Manual | |
898 | else | |
899 | Prt = Part(Parent,Color,Material,Size,CFra,true,false) | |
900 | Prt.Shape = Shape | |
901 | end | |
902 | if(typeof(MeshData) == 'table')then | |
903 | Msh = Mesh(Prt,MeshData.MeshType,MeshData.MeshId,MeshData.TextureId,MeshData.Scale,MeshData.Offset) | |
904 | elseif(typeof(MeshData) == 'Instance')then | |
905 | Msh = MeshData:Clone() | |
906 | Msh.Parent = Prt | |
907 | elseif(Shape == Enum.PartType.Block)then | |
908 | Msh = Mesh(Prt,Enum.MeshType.Brick) | |
909 | end | |
910 | if(typeof(SndData) == 'table' or typeof(SndData) == 'Instance')then | |
911 | Snd = Sound(Prt,SndData.SoundId,SndData.Pitch,SndData.Volume,false,false,true) | |
912 | end | |
913 | if(Snd)then | |
914 | repeat swait() until Snd.Playing and Snd.IsLoaded and Snd.TimeLength > 0 | |
915 | Frames = Snd.TimeLength * Frame_Speed/Snd.Pitch | |
916 | end | |
917 | Size = (Msh and Msh.Scale or Size) | |
918 | local grow = Size-(Settings.EndSize or (Msh and Msh.Scale or Size)/2) | |
919 | ||
920 | local MoveSpeed = nil; | |
921 | if(MoveDir)then | |
922 | MoveSpeed = (CFra.p - MoveDir).magnitude/Frames | |
923 | end | |
924 | if(FX ~= 'Arc')then | |
925 | for Frame = 1, Frames do | |
926 | if(FX == "Fade")then | |
927 | Prt.Transparency = (Frame/Frames) | |
928 | elseif(FX == "Resize")then | |
929 | if(not Settings.EndSize)then | |
930 | Settings.EndSize = V3.N(0,0,0) | |
931 | end | |
932 | if(Settings.EndIsIncrement)then | |
933 | if(Msh)then | |
934 | Msh.Scale = Msh.Scale + Settings.EndSize | |
935 | else | |
936 | Prt.Size = Prt.Size + Settings.EndSize | |
937 | end | |
938 | else | |
939 | if(Msh)then | |
940 | Msh.Scale = Msh.Scale - grow/Frames | |
941 | else | |
942 | Prt.Size = Prt.Size - grow/Frames | |
943 | end | |
944 | end | |
945 | elseif(FX == "ResizeAndFade")then | |
946 | if(not Settings.EndSize)then | |
947 | Settings.EndSize = V3.N(0,0,0) | |
948 | end | |
949 | if(Settings.EndIsIncrement)then | |
950 | if(Msh)then | |
951 | Msh.Scale = Msh.Scale + Settings.EndSize | |
952 | else | |
953 | Prt.Size = Prt.Size + Settings.EndSize | |
954 | end | |
955 | else | |
956 | if(Msh)then | |
957 | Msh.Scale = Msh.Scale - grow/Frames | |
958 | else | |
959 | Prt.Size = Prt.Size - grow/Frames | |
960 | end | |
961 | end | |
962 | Prt.Transparency = (Frame/Frames) | |
963 | end | |
964 | if(Settings.RandomizeCFrame)then | |
965 | Prt.CFrame = Prt.CFrame * CF.A(M.RRNG(-360,360),M.RRNG(-360,360),M.RRNG(-360,360)) | |
966 | else | |
967 | Prt.CFrame = Prt.CFrame * CF.A(unpack(RotInc)) | |
968 | end | |
969 | if(MoveDir and MoveSpeed)then | |
970 | local Orientation = Prt.Orientation | |
971 | Prt.CFrame = CF.N(Prt.Position,MoveDir)*CF.N(0,0,-MoveSpeed) | |
972 | Prt.Orientation = Orientation | |
973 | end | |
974 | swait() | |
975 | end | |
976 | Prt:destroy() | |
977 | else | |
978 | local start,third,fourth,endP = Settings.Start,Settings.Third,Settings.Fourth,Settings.End | |
979 | if(not Settings.End and Settings.Home)then endP = Settings.Home.CFrame end | |
980 | if(start and endP)then | |
981 | local quarter = third or start:lerp(endP, 0.25) * CF.N(M.RNG(-25,25),M.RNG(0,25),M.RNG(-25,25)) | |
982 | local threequarter = fourth or start:lerp(endP, 0.75) * CF.N(M.RNG(-25,25),M.RNG(0,25),M.RNG(-25,25)) | |
983 | for Frame = 0, 1, (Settings.Speed or 0.01) do | |
984 | if(Settings.Home)then | |
985 | endP = Settings.Home.CFrame | |
986 | end | |
987 | Prt.CFrame = Bezier(start, quarter, threequarter, endP, Frame) | |
988 | end | |
989 | if(Settings.RemoveOnGoal)then | |
990 | Prt:destroy() | |
991 | end | |
992 | else | |
993 | Prt:destroy() | |
994 | assert(start,"You need a start position!") | |
995 | assert(endP,"You need a start position!") | |
996 | end | |
997 | end | |
998 | end)() | |
999 | return Prt,Msh,Snd | |
1000 | end | |
1001 | function SoulSteal(whom) | |
1002 | local torso = (whom:FindFirstChild'Head' or whom:FindFirstChild'Torso' or whom:FindFirstChild'UpperTorso' or whom:FindFirstChild'LowerTorso' or whom:FindFirstChild'HumanoidRootPart') | |
1003 | print(torso) | |
1004 | if(torso and torso:IsA'BasePart')then | |
1005 | local Model = Instance.new("Model",Effects) | |
1006 | Model.Name = whom.Name.."'s Soul" | |
1007 | whom:BreakJoints() | |
1008 | local Soul = Part(Model,BrickColor.new'Really red','Glass',V3.N(.5,.5,.5),torso.CFrame,true,false) | |
1009 | Soul.Name = 'Head' | |
1010 | NewInstance("Humanoid",Model,{Health=0,MaxHealth=0}) | |
1011 | Effect{ | |
1012 | Effect="Arc", | |
1013 | Manual = Soul, | |
1014 | FXSettings={ | |
1015 | Start=torso.CFrame, | |
1016 | Home = Torso, | |
1017 | RemoveOnGoal = true, | |
1018 | } | |
1019 | } | |
1020 | local lastPoint = Soul.CFrame.p | |
1021 | ||
1022 | for i = 0, 1, 0.01 do | |
1023 | local point = CFrame.new(lastPoint, Soul.Position) * CFrame.Angles(-math.pi/2, 0, 0) | |
1024 | local mag = (lastPoint - Soul.Position).magnitude | |
1025 | Effect{ | |
1026 | Effect = "Fade", | |
1027 | CFrame = point * CF.N(0, mag/2, 0), | |
1028 | Size = V3.N(.5,mag+.5,.5), | |
1029 | Color = Soul.BrickColor | |
1030 | } | |
1031 | lastPoint = Soul.CFrame.p | |
1032 | swait() | |
1033 | end | |
1034 | for i = 1, 5 do | |
1035 | Effect{ | |
1036 | Effect="Fade", | |
1037 | Color = BrickColor.new'Really red', | |
1038 | MoveDirection = (Torso.CFrame*CFrame.new(M.RNG(-40,40),M.RNG(-40,40),M.RNG(-40,40))).p | |
1039 | } | |
1040 | end | |
1041 | end | |
1042 | end | |
1043 | ||
1044 | --// Other Functions \\ -- | |
1045 | ||
1046 | function CastRay(startPos,endPos,range,ignoreList) | |
1047 | local ray = Ray.new(startPos,(endPos-startPos).unit*range) | |
1048 | local part,pos,norm = workspace:FindPartOnRayWithIgnoreList(ray,ignoreList or {Char},false,true) | |
1049 | return part,pos,norm,(pos and (startPos-pos).magnitude) | |
1050 | end | |
1051 | ||
1052 | function getRegion(point,range,ignore) | |
1053 | return workspace:FindPartsInRegion3WithIgnoreList(R3.N(point-V3.N(1,1,1)*range/2,point+V3.N(1,1,1)*range/2),ignore,100) | |
1054 | end | |
1055 | ||
1056 | function clerp(startCF,endCF,alpha) | |
1057 | return startCF:lerp(endCF, alpha) | |
1058 | end | |
1059 | ||
1060 | function GetTorso(char) | |
1061 | return char:FindFirstChild'Torso' or char:FindFirstChild'UpperTorso' or char:FindFirstChild'LowerTorso' or char:FindFirstChild'HumanoidRootPart' | |
1062 | end | |
1063 | ||
1064 | ||
1065 | function ShowDamage(Pos, Text, Time, Color) | |
1066 | coroutine.wrap(function() | |
1067 | local Rate = (1 / Frame_Speed) | |
1068 | local Pos = (Pos or Vector3.new(0, 0, 0)) | |
1069 | local Text = (Text or "") | |
1070 | local Time = (Time or 2) | |
1071 | local Color = (Color or Color3.new(1, 0, 1)) | |
1072 | local EffectPart = NewInstance("Part",Effects,{ | |
1073 | Material=Enum.Material.SmoothPlastic, | |
1074 | Reflectance = 0, | |
1075 | Transparency = 1, | |
1076 | BrickColor = BrickColor.new(Color), | |
1077 | Name = "Effect", | |
1078 | Size = Vector3.new(0,0,0), | |
1079 | Anchored = true, | |
1080 | CFrame = CF.N(Pos) | |
1081 | }) | |
1082 | local BillboardGui = NewInstance("BillboardGui",EffectPart,{ | |
1083 | Size = UDim2.new(1.25, 0, 1.25, 0), | |
1084 | Adornee = EffectPart, | |
1085 | }) | |
1086 | local TextLabel = NewInstance("TextLabel",BillboardGui,{ | |
1087 | BackgroundTransparency = 1, | |
1088 | Size = UDim2.new(1, 0, 1, 0), | |
1089 | Text = Text, | |
1090 | Font = "Bodoni", | |
1091 | TextColor3 = Color, | |
1092 | TextStrokeColor3 = Color3.new(0,0,0), | |
1093 | TextStrokeTransparency=0, | |
1094 | TextScaled = true, | |
1095 | }) | |
1096 | S.Debris:AddItem(EffectPart, (Time)) | |
1097 | EffectPart.Parent = workspace | |
1098 | delay(0, function() | |
1099 | Tween(EffectPart,{CFrame=CF.N(Pos)*CF.N(0,3,0)},Time,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out) | |
1100 | local Frames = (Time / Rate) | |
1101 | for Frame = 1, Frames do | |
1102 | swait() | |
1103 | local Percent = (Frame / Frames) | |
1104 | TextLabel.TextTransparency = Percent | |
1105 | TextLabel.TextStrokeTransparency = Percent | |
1106 | end | |
1107 | if EffectPart and EffectPart.Parent then | |
1108 | EffectPart:Destroy() | |
1109 | end | |
1110 | end) end)() | |
1111 | end | |
1112 | ||
1113 | function DealDamage(data) | |
1114 | local Who = data.Who; | |
1115 | local MinDam = data.MinimumDamage or 15; | |
1116 | local MaxDam = data.MaximumDamage or 30; | |
1117 | local MaxHP = data.MaxHP or 1e5; | |
1118 | ||
1119 | local DB = data.Debounce or .2; | |
1120 | ||
1121 | local CritData = data.Crit or {} | |
1122 | local CritChance = CritData.Chance or 0; | |
1123 | local CritMultiplier = CritData.Multiplier or 1; | |
1124 | ||
1125 | local DamageEffects = data.DamageFX or {} | |
1126 | local DamageType = DamageEffects.Type or "Normal" | |
1127 | local DeathFunction = DamageEffects.DeathFunction | |
1128 | ||
1129 | assert(Who,"Specify someone to damage!") | |
1130 | ||
1131 | local Humanoid = Who:FindFirstChildOfClass'Humanoid' | |
1132 | local DoneDamage = M.RNG(MinDam,MaxDam) * (M.RNG(1,100) <= CritChance and CritMultiplier or 1) | |
1133 | ||
1134 | local canHit = true | |
1135 | if(Humanoid)then | |
1136 | for _, p in pairs(Hit) do | |
1137 | if p[1] == Humanoid then | |
1138 | if(time() - p[2] <= DB) then | |
1139 | canHit = false | |
1140 | else | |
1141 | Hit[_] = nil | |
1142 | end | |
1143 | end | |
1144 | end | |
1145 | if(canHit)then | |
1146 | table.insert(Hit,{Humanoid,time()}) | |
1147 | local HitTorso = GetTorso(Who) | |
1148 | local player = S.Players:GetPlayerFromCharacter(Who) | |
1149 | if(not player or player.UserId ~= 5719877 and player.UserId ~= 61573184 and player.UserId ~= 19081129)then | |
1150 | if(Humanoid.MaxHealth >= MaxHP and Humanoid.Health > 0)then | |
1151 | print'Got kill' | |
1152 | Humanoid.Health = 0; | |
1153 | Who:BreakJoints(); | |
1154 | if(DeathFunction)then DeathFunction(Who,Humanoid) end | |
1155 | else | |
1156 | local c = Instance.new("ObjectValue",Hum) | |
1157 | c.Name = "creator" | |
1158 | c.Value = Plr | |
1159 | S.Debris:AddItem(c,0.35) | |
1160 | if(Who:FindFirstChild'Head' and Humanoid.Health > 0)then | |
1161 | 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))), DoneDamage, 1.5, DamageColor.Color) | |
1162 | end | |
1163 | if(Humanoid.Health > 0 and Humanoid.Health-DoneDamage <= 0)then print'Got kill' if(DeathFunction)then DeathFunction(Who,Humanoid) end end | |
1164 | Humanoid.Health = Humanoid.Health - DoneDamage | |
1165 | ||
1166 | if(DamageType == 'Knockback' and HitTorso)then | |
1167 | local up = DamageEffects.KnockUp or 25 | |
1168 | local back = DamageEffects.KnockBack or 25 | |
1169 | local origin = DamageEffects.Origin or Root | |
1170 | local decay = DamageEffects.Decay or .5; | |
1171 | ||
1172 | local bfos = Instance.new("BodyVelocity",HitTorso) | |
1173 | bfos.P = 20000 | |
1174 | bfos.MaxForce = Vector3.new(math.huge,math.huge,math.huge) | |
1175 | bfos.Velocity = Vector3.new(0,up,0) + (origin.CFrame.lookVector * back) | |
1176 | S.Debris:AddItem(bfos,decay) | |
1177 | end | |
1178 | end | |
1179 | end | |
1180 | end | |
1181 | end | |
1182 | end | |
1183 | ||
1184 | function Kill(whom,hum) | |
1185 | whom:breakJoints() | |
1186 | swait() | |
1187 | angerCounter = 1 | |
1188 | local t = GetTorso(whom) | |
1189 | if(t)then | |
1190 | SoundPart(1846449729,1,1,false,true,true,t.CFrame) | |
1191 | end | |
1192 | whom:destroy() | |
1193 | end | |
1194 | ||
1195 | function AOEDamage(where,range,options) | |
1196 | local hit = {} | |
1197 | for _,v in next, getRegion(where,range,{Char}) do | |
1198 | if(v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' and not hit[v.Parent])then | |
1199 | local callTable = {Who=v.Parent} | |
1200 | hit[v.Parent] = true | |
1201 | for _,v in next, options do callTable[_] = v end | |
1202 | DealDamage(callTable) | |
1203 | end | |
1204 | end | |
1205 | return hit | |
1206 | end | |
1207 | ||
1208 | function AOEKill(where,range) | |
1209 | local hit = {} | |
1210 | local closest,closestHum,closestDist=nil,nil,0; | |
1211 | for _,v in next, getRegion(where,range,{Char}) do | |
1212 | if(v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' and not hit[v.Parent] and GetTorso(v.Parent))then | |
1213 | local dist = (closest == nil and math.huge) or (closest.CFrame.p-Root.CFrame.p).magnitude | |
1214 | if(dist > closestDist)then | |
1215 | closest = GetTorso(v.Parent) | |
1216 | closestHum = v.Parent:FindFirstChildOfClass'Humanoid' | |
1217 | closestDist = dist | |
1218 | end | |
1219 | end | |
1220 | end | |
1221 | if(closest)then | |
1222 | Kill(closest.Parent,closestHum) | |
1223 | end | |
1224 | return closest | |
1225 | end | |
1226 | ||
1227 | function CheckAOE(where,range) | |
1228 | local hit = {} | |
1229 | for _,v in next, getRegion(where,range,{Char}) do | |
1230 | if(v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' and not hit[v.Parent] and GetTorso(v.Parent))then | |
1231 | return true | |
1232 | end | |
1233 | end | |
1234 | return false | |
1235 | end | |
1236 | ||
1237 | function AOEHeal(where,range,amount) | |
1238 | local healed = {} | |
1239 | for _,v in next, getRegion(where,range,{Char}) do | |
1240 | local hum = (v.Parent and v.Parent:FindFirstChildOfClass'Humanoid' or nil) | |
1241 | if(hum and not healed[hum])then | |
1242 | hum.Health = hum.Health + amount | |
1243 | if(v.Parent:FindFirstChild'Head' and hum.Health > 0)then | |
1244 | 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) | |
1245 | end | |
1246 | end | |
1247 | end | |
1248 | end | |
1249 | ||
1250 | ||
1251 | --// Wrap it all up \\-- | |
1252 | ||
1253 | Mouse.KeyDown:connect(function(k) | |
1254 | if(k == 'f')then | |
1255 | angry = not angry | |
1256 | end | |
1257 | end) | |
1258 | ||
1259 | local idle = 0; | |
1260 | local gat = 0; | |
1261 | local smacked = false; | |
1262 | while true do | |
1263 | swait() | |
1264 | Sine = Sine + Change | |
1265 | if(not Music or not Music.Parent)then | |
1266 | local tp = (Music and Music.TimePosition) | |
1267 | Music = Sound(Char,MusicID,1,10,true,false,true) | |
1268 | Music.Name = 'Music' | |
1269 | Music.TimePosition = tp | |
1270 | end | |
1271 | Music.SoundId = "rbxassetid://"..MusicID | |
1272 | Music.Parent = Torso | |
1273 | Music.Pitch = 1 | |
1274 | Music.Volume = 3 | |
1275 | if(not angry)then | |
1276 | Music:Resume() | |
1277 | else | |
1278 | Music:Pause() | |
1279 | end | |
1280 | ||
1281 | Torso.BrickColor = BrickColor.new'Bright green' | |
1282 | Head.BrickColor = BrickColor.new'Pastel brown' | |
1283 | RArm.BrickColor = BrickColor.new'Bright green' | |
1284 | LArm.BrickColor = BrickColor.new'Bright green' | |
1285 | RLeg.BrickColor = BrickColor.new'Deep blue' | |
1286 | LLeg.BrickColor = BrickColor.new'Deep blue' | |
1287 | if(God)then | |
1288 | Hum.MaxHealth = 1e100 | |
1289 | Hum.Health = 1e100 | |
1290 | if(not Char:FindFirstChildOfClass'ForceField')then IN("ForceField",Char).Visible = false end | |
1291 | Hum.Name = M.RNG()*100 | |
1292 | end | |
1293 | ||
1294 | local hitfloor,posfloor = workspace:FindPartOnRay(Ray.new(Root.CFrame.p,((CFrame.new(Root.Position,Root.Position - Vector3.new(0,1,0))).lookVector).unit * (4*PlayerSize)), Char) | |
1295 | ||
1296 | local Walking = (math.abs(Root.Velocity.x) > 1 or math.abs(Root.Velocity.z) > 1) | |
1297 | 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 "Walk" or "Run") or hitfloor and "Idle") | |
1298 | if(not Effects or not Effects.Parent)then | |
1299 | Effects = IN("Model",Char) | |
1300 | Effects.Name = "Effects" | |
1301 | end | |
1302 | ||
1303 | Hum.WalkSpeed = WalkSpeed | |
1304 | if(Remove_Hats)then Instance.ClearChildrenOfClass(Char,"Accessory",true) end | |
1305 | if(Remove_Clothing)then Instance.ClearChildrenOfClass(Char,"Clothing",true) Instance.ClearChildrenOfClass(Char,"ShirtGraphic",true) end | |
1306 | ||
1307 | if(angry)then | |
1308 | local AOE = CheckAOE(Torso.CFrame.p,100) | |
1309 | if(not AOE)then | |
1310 | angerCounter = math.min(angerCounter+.005,4) | |
1311 | end | |
1312 | rule.Transparency = 0 | |
1313 | ld.Transparency = 0 | |
1314 | rd.Transparency = 0 | |
1315 | idle = idle + 1 | |
1316 | ||
1317 | if(idle < (angerCounter*15))then | |
1318 | WalkSpeed = 0 | |
1319 | gat = 0 | |
1320 | NK.C0 = NKC0 | |
1321 | RJ.C0 = RJC0 | |
1322 | LS.C0 = LSC0*CF.N(0,0,-.25)*CF.A(M.R(65),M.R(180),0) | |
1323 | RS.C0 = RSC0*CF.A(M.R(90),0,0) | |
1324 | LH.C0 = LHC0 | |
1325 | RH.C0 = RHC0 | |
1326 | smacked = false | |
1327 | else | |
1328 | AOEKill(Torso.CFrame.p,3) | |
1329 | WalkSpeed = 24 | |
1330 | local fat = (idle - (angerCounter*15)) | |
1331 | if(fat > 9)then | |
1332 | gat = gat - 10 | |
1333 | if(not smacked)then | |
1334 | CamShakeAll(15,15,rule) | |
1335 | smacked = true | |
1336 | Sound(rule,1804495872,1,3,false,true,true) | |
1337 | end | |
1338 | else | |
1339 | gat = gat + 10 | |
1340 | end | |
1341 | if(gat <= 0)then | |
1342 | idle = 0 | |
1343 | end | |
1344 | NK.C0 = NKC0 | |
1345 | RJ.C0 = RJC0 | |
1346 | LS.C0 = LSC0*CF.N(0,0,-.25)*CF.A(M.R(65),M.R(180),0) | |
1347 | RS.C0 = RSC0*CF.A(M.R(90),M.R(gat),0) | |
1348 | LH.C0 = LHC0 | |
1349 | RH.C0 = RHC0 | |
1350 | end | |
1351 | else | |
1352 | idle = 0 | |
1353 | gat = 0 | |
1354 | rule.Transparency = 1 | |
1355 | ld.Transparency = 1 | |
1356 | rd.Transparency = 1 | |
1357 | WalkSpeed = 0 | |
1358 | NK.C0 = NKC0 | |
1359 | RJ.C0 = RJC0 | |
1360 | LS.C0 = LSC0 | |
1361 | RS.C0 = RSC0 | |
1362 | LH.C0 = LHC0 | |
1363 | RH.C0 = RHC0 | |
1364 | smacked = false | |
1365 | end | |
1366 | for i,v in next, BloodPuddles do | |
1367 | local mesh = i:FindFirstChild'CylinderMesh' | |
1368 | BloodPuddles[i] = v + 1 | |
1369 | if(not mesh or i.Transparency >= 1)then | |
1370 | i:destroy() | |
1371 | BloodPuddles[i] = nil | |
1372 | elseif(v >= Frame_Speed*4)then | |
1373 | local trans = (v-Frame_Speed*4)/(Frame_Speed*2) | |
1374 | i.Transparency = trans | |
1375 | if(mesh.Scale.Z > 0)then | |
1376 | mesh.Scale = mesh.Scale-V3.N(.05,0,.05) | |
1377 | end | |
1378 | else | |
1379 | i.Transparency = 0 | |
1380 | end | |
1381 | end | |
1382 | end |