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