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