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