SHOW:
|
|
- or go back to the newest paste.
1 | warn(" made by [ Shackluster ] ") | |
2 | warn(" edited by [ Nameclan ] ") | |
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 | ||
9 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
10 | print(" this script was converted by An ignorant / zach ") | |
11 | warn(" credits goes to the real creator ") | |
12 | warn(" pls dont abuse ") | |
13 | warn(" i beg u ") | |
14 | local Player,game,owner = owner,game | |
15 | local RealPlayer = Player | |
16 | do | |
17 | print("FE Compatibility code by Mokiros") | |
18 | local rp = RealPlayer | |
19 | script.Parent = rp.Character | |
20 | ||
21 | --RemoteEvent for communicating | |
22 | local Event = Instance.new("RemoteEvent") | |
23 | Event.Name = "UserInput_Event" | |
24 | ||
25 | --Fake event to make stuff like Mouse.KeyDown work | |
26 | local function fakeEvent() | |
27 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end} | |
28 | t.connect = t.Connect | |
29 | return t | |
30 | end | |
31 | ||
32 | --Creating fake input objects with fake variables | |
33 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
34 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
35 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
36 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
37 | end} | |
38 | --Merged 2 functions into one by checking amount of arguments | |
39 | CAS.UnbindAction = CAS.BindAction | |
40 | ||
41 | --This function will trigger the events that have been :Connect()'ed | |
42 | local function te(self,ev,...) | |
43 | local t = m[ev] | |
44 | if t and t._fakeEvent then | |
45 | for _,f in pairs(t.Functions) do | |
46 | f(...) | |
47 | end | |
48 | end | |
49 | end | |
50 | m.TrigEvent = te | |
51 | UIS.TrigEvent = te | |
52 | ||
53 | Event.OnServerEvent:Connect(function(plr,io) | |
54 | if plr~=rp then return end | |
55 | m.Target = io.Target | |
56 | m.Hit = io.Hit | |
57 | if not io.isMouse then | |
58 | local b = io.UserInputState == Enum.UserInputState.Begin | |
59 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
60 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
61 | end | |
62 | for _,t in pairs(CAS.Actions) do | |
63 | for _,k in pairs(t.Keys) do | |
64 | if k==io.KeyCode then | |
65 | t.Function(t.Name,io.UserInputState,io) | |
66 | end | |
67 | end | |
68 | end | |
69 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
70 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
71 | end | |
72 | end) | |
73 | Event.Parent = NLS([==[ | |
74 | local Player = game:GetService("Players").LocalPlayer | |
75 | local Event = script:WaitForChild("UserInput_Event") | |
76 | ||
77 | local Mouse = Player:GetMouse() | |
78 | local UIS = game:GetService("UserInputService") | |
79 | local input = function(io,a) | |
80 | if a then return end | |
81 | --Since InputObject is a client-side instance, we create and pass table instead | |
82 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target}) | |
83 | end | |
84 | UIS.InputBegan:Connect(input) | |
85 | UIS.InputEnded:Connect(input) | |
86 | ||
87 | local h,t | |
88 | --Give the server mouse data 30 times every second, but only if the values changed | |
89 | --If player is not moving their mouse, client won't fire events | |
90 | while wait(1/30) do | |
91 | if h~=Mouse.Hit or t~=Mouse.Target then | |
92 | h,t=Mouse.Hit,Mouse.Target | |
93 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
94 | end | |
95 | end]==],Player.Character) | |
96 | ||
97 | ----Sandboxed game object that allows the usage of client-side methods and services | |
98 | --Real game object | |
99 | local _rg = game | |
100 | ||
101 | --Metatable for fake service | |
102 | local fsmt = { | |
103 | __index = function(self,k) | |
104 | local s = rawget(self,"_RealService") | |
105 | if s then return s[k] end | |
106 | end, | |
107 | __newindex = function(self,k,v) | |
108 | local s = rawget(self,"_RealService") | |
109 | if s then s[k]=v end | |
110 | end, | |
111 | __call = function(self,...) | |
112 | local s = rawget(self,"_RealService") | |
113 | if s then return s(...) end | |
114 | end | |
115 | } | |
116 | local function FakeService(t,RealService) | |
117 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
118 | return setmetatable(t,fsmt) | |
119 | end | |
120 | ||
121 | --Fake game object | |
122 | local g = { | |
123 | GetService = function(self,s) | |
124 | return self[s] | |
125 | end, | |
126 | Players = FakeService({ | |
127 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player) | |
128 | },"Players"), | |
129 | UserInputService = FakeService(UIS,"UserInputService"), | |
130 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
131 | } | |
132 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
133 | g.service = g.GetService | |
134 | ||
135 | g.RunService = FakeService({ | |
136 | RenderStepped = _rg:GetService("RunService").Heartbeat, | |
137 | BindToRenderStep = function(self,name,_,fun) | |
138 | ||
139 | end, | |
140 | UnbindFromRenderStep = function(self,name) | |
141 | self._btrs[name]:Disconnect() | |
142 | end, | |
143 | },"RunService") | |
144 | ||
145 | setmetatable(g,{ | |
146 | __index=function(self,s) | |
147 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
148 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
149 | end, | |
150 | __newindex = fsmt.__newindex, | |
151 | __call = fsmt.__call | |
152 | }) | |
153 | --Changing owner to fake player object to support owner:GetMouse() | |
154 | game,owner = g,g.Players.LocalPlayer | |
155 | end | |
156 | ||
157 | wait(0.2) | |
158 | ||
159 | ||
160 | ||
161 | Player = game:GetService("Players").LocalPlayer | |
162 | PlayerGui = Player.PlayerGui | |
163 | Cam = workspace.CurrentCamera | |
164 | - | local naeeym2 = Instance.new("BillboardGui",Character) |
164 | + | |
165 | - | naeeym2.AlwaysOnTop = true |
165 | + | |
166 | - | naeeym2.Size = UDim2.new(5,35,2,35) |
166 | + | |
167 | - | naeeym2.StudsOffset = Vector3.new(0,2,0) |
167 | + | |
168 | - | naeeym2.Adornee = Character.Head |
168 | + | |
169 | - | naeeym2.Name = "Name" |
169 | + | |
170 | - | naeeym2.PlayerToHideFrom = Player |
170 | + | |
171 | - | local tecks2 = Instance.new("TextLabel",naeeym2) |
171 | + | |
172 | - | tecks2.BackgroundTransparency = 1 |
172 | + | |
173 | - | tecks2.TextScaled = true |
173 | + | |
174 | - | tecks2.BorderSizePixel = 0 |
174 | + | |
175 | - | tecks2.Text = Player.Name..", The Ultimate Edgelord" |
175 | + | |
176 | - | tecks2.Font = "Antique" |
176 | + | |
177 | - | tecks2.TextSize = 30 |
177 | + | |
178 | - | tecks2.TextStrokeTransparency = 0 |
178 | + | |
179 | - | tecks2.TextColor3 = Color3.new(0,0,0) |
179 | + | |
180 | - | tecks2.TextStrokeColor3 = Color3.new(0.2,0.2,0.2) |
180 | + | |
181 | - | tecks2.Size = UDim2.new(1,0,0.5,0) |
181 | + | |
182 | - | tecks2.Parent = naeeym2 |
182 | + | |
183 | sick.Looped = true | |
184 | sick.Pitch = 1 | |
185 | sick.Volume = 2 | |
186 | sick:Play() | |
187 | ||
188 | IT = Instance.new | |
189 | CF = CFrame.new | |
190 | VT = Vector3.new | |
191 | RAD = math.rad | |
192 | C3 = Color3.new | |
193 | UD2 = UDim2.new | |
194 | BRICKC = BrickColor.new | |
195 | ANGLES = CFrame.Angles | |
196 | EULER = CFrame.fromEulerAnglesXYZ | |
197 | COS = math.cos | |
198 | ACOS = math.acos | |
199 | SIN = math.sin | |
200 | ASIN = math.asin | |
201 | ABS = math.abs | |
202 | MRANDOM = math.random | |
203 | FLOOR = math.floor | |
204 | ||
205 | function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET) | |
206 | local NEWMESH = IT(MESH) | |
207 | if MESH == "SpecialMesh" then | |
208 | NEWMESH.MeshType = MESHTYPE | |
209 | if MESHID ~= "nil" and MESHID ~= "" then | |
210 | NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID | |
211 | end | |
212 | if TEXTUREID ~= "nil" and TEXTUREID ~= "" then | |
213 | NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID | |
214 | end | |
215 | end | |
216 | NEWMESH.Offset = OFFSET or VT(0, 0, 0) | |
217 | NEWMESH.Scale = SCALE | |
218 | NEWMESH.Parent = PARENT | |
219 | return NEWMESH | |
220 | end | |
221 | ||
222 | function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR) | |
223 | local NEWPART = IT("Part") | |
224 | NEWPART.formFactor = FORMFACTOR | |
225 | NEWPART.Reflectance = REFLECTANCE | |
226 | NEWPART.Transparency = TRANSPARENCY | |
227 | NEWPART.CanCollide = false | |
228 | NEWPART.Locked = true | |
229 | NEWPART.Anchored = true | |
230 | if ANCHOR == false then | |
231 | NEWPART.Anchored = false | |
232 | end | |
233 | NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR)) | |
234 | NEWPART.Name = NAME | |
235 | NEWPART.Size = SIZE | |
236 | NEWPART.Position = Torso.Position | |
237 | NEWPART.Material = MATERIAL | |
238 | NEWPART:BreakJoints() | |
239 | NEWPART.Parent = PARENT | |
240 | return NEWPART | |
241 | end | |
242 | ||
243 | --//=================================\\ | |
244 | --|| CUSTOMIZATION | |
245 | --\\=================================// | |
246 | ||
247 | Player_Size = 1 --Size of the player. | |
248 | Animation_Speed = 3 | |
249 | Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60) | |
250 | ||
251 | local Speed = 16 | |
252 | local Effects2 = {} | |
253 | ||
254 | --//=================================\\ | |
255 | --|| END OF CUSTOMIZATION | |
256 | --\\=================================// | |
257 | ||
258 | local function weldBetween(a, b) | |
259 | local weldd = Instance.new("ManualWeld") | |
260 | weldd.Part0 = a | |
261 | weldd.Part1 = b | |
262 | weldd.C0 = CFrame.new() | |
263 | weldd.C1 = b.CFrame:inverse() * a.CFrame | |
264 | weldd.Parent = a | |
265 | return weldd | |
266 | end | |
267 | ||
268 | --//=================================\\ | |
269 | --|| USEFUL VALUES | |
270 | --\\=================================// | |
271 | ||
272 | local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
273 | local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
274 | local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) | |
275 | local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) | |
276 | local CHANGEDEFENSE = 0 | |
277 | local CHANGEDAMAGE = 0 | |
278 | local CHANGEMOVEMENT = 0 | |
279 | local ANIM = "Idle" | |
280 | local ATTACK = false | |
281 | local EQUIPPED = false | |
282 | local HOLD = false | |
283 | local COMBO = 1 | |
284 | local Rooted = false | |
285 | local Horn1 = IT("Folder", Character) | |
286 | Horn1.Name = "Horn1" | |
287 | local SINE = 0 | |
288 | local KEYHOLD = false | |
289 | local CHANGE = 2 / Animation_Speed | |
290 | local WALKINGANIM = false | |
291 | local MODE = "Cop" | |
292 | local WALK = 0 | |
293 | local VALUE1 = false | |
294 | local VALUE2 = false | |
295 | local ROBLOXIDLEANIMATION = IT("Animation") | |
296 | ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation" | |
297 | ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571" | |
298 | --ROBLOXIDLEANIMATION.Parent = Humanoid | |
299 | local WEAPONGUI = IT("ScreenGui", PlayerGui) | |
300 | WEAPONGUI.Name = "Weapon GUI" | |
301 | local Effects = IT("Folder", Character) | |
302 | Effects.Name = "Effects" | |
303 | local Weapon = IT("Model") | |
304 | Weapon.Name = "Adds" | |
305 | local Effects = IT("Folder", Weapon) | |
306 | Effects.Name = "Effects" | |
307 | local ANIMATOR = Humanoid.Animator | |
308 | local ANIMATE = Character.Animate | |
309 | local HITPLAYERSOUNDS = {--[["199149137", "199149186", "199149221", "199149235", "199149269", "199149297"--]]"263032172", "263032182", "263032200", "263032221", "263032252", "263033191"} | |
310 | local HITARMORSOUNDS = {"199149321", "199149338", "199149367", "199149409", "199149452"} | |
311 | local HITWEAPONSOUNDS = {"199148971", "199149025", "199149072", "199149109", "199149119"} | |
312 | local HITBLOCKSOUNDS = {"199148933", "199148947"} | |
313 | local UNANCHOR = true | |
314 | ||
315 | local SKILLTEXTCOLOR = C3(0,0,0) | |
316 | ||
317 | ||
318 | ||
319 | --//=================================\\ | |
320 | --\\=================================// | |
321 | ||
322 | ||
323 | --//=================================\\ | |
324 | --|| SAZERENOS' ARTIFICIAL HEARTBEAT | |
325 | --\\=================================// | |
326 | ||
327 | ArtificialHB = Instance.new("BindableEvent", script) | |
328 | ArtificialHB.Name = "ArtificialHB" | |
329 | ||
330 | script:WaitForChild("ArtificialHB") | |
331 | ||
332 | frame = Frame_Speed | |
333 | tf = 0 | |
334 | allowframeloss = false | |
335 | tossremainder = false | |
336 | lastframe = tick() | |
337 | script.ArtificialHB:Fire() | |
338 | ||
339 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
340 | tf = tf + s | |
341 | if tf >= frame then | |
342 | if allowframeloss then | |
343 | script.ArtificialHB:Fire() | |
344 | lastframe = tick() | |
345 | else | |
346 | for i = 1, math.floor(tf / frame) do | |
347 | script.ArtificialHB:Fire() | |
348 | end | |
349 | lastframe = tick() | |
350 | end | |
351 | if tossremainder then | |
352 | tf = 0 | |
353 | else | |
354 | tf = tf - frame * math.floor(tf / frame) | |
355 | end | |
356 | end | |
357 | end) | |
358 | ||
359 | --//=================================\\ | |
360 | --\\=================================// | |
361 | ||
362 | ||
363 | ||
364 | ||
365 | ||
366 | --//=================================\\ | |
367 | --|| SOME FUNCTIONS | |
368 | --\\=================================// | |
369 | ||
370 | function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS) | |
371 | return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS) | |
372 | end | |
373 | ||
374 | function PositiveAngle(NUMBER) | |
375 | if NUMBER >= 0 then | |
376 | NUMBER = 0 | |
377 | end | |
378 | return NUMBER | |
379 | end | |
380 | ||
381 | function NegativeAngle(NUMBER) | |
382 | if NUMBER <= 0 then | |
383 | NUMBER = 0 | |
384 | end | |
385 | return NUMBER | |
386 | end | |
387 | ||
388 | function Swait(NUMBER) | |
389 | if NUMBER == 0 or NUMBER == nil then | |
390 | ArtificialHB.Event:wait() | |
391 | else | |
392 | for i = 1, NUMBER do | |
393 | ArtificialHB.Event:wait() | |
394 | end | |
395 | end | |
396 | end | |
397 | ||
398 | function QuaternionFromCFrame(cf) | |
399 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
400 | local trace = m00 + m11 + m22 | |
401 | if trace > 0 then | |
402 | local s = math.sqrt(1 + trace) | |
403 | local recip = 0.5 / s | |
404 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
405 | else | |
406 | local i = 0 | |
407 | if m11 > m00 then | |
408 | i = 1 | |
409 | end | |
410 | if m22 > (i == 0 and m00 or m11) then | |
411 | i = 2 | |
412 | end | |
413 | if i == 0 then | |
414 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
415 | local recip = 0.5 / s | |
416 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
417 | elseif i == 1 then | |
418 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
419 | local recip = 0.5 / s | |
420 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
421 | elseif i == 2 then | |
422 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
423 | local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
424 | end | |
425 | end | |
426 | end | |
427 | ||
428 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
429 | local xs, ys, zs = x + x, y + y, z + z | |
430 | local wx, wy, wz = w * xs, w * ys, w * zs | |
431 | local xx = x * xs | |
432 | local xy = x * ys | |
433 | local xz = x * zs | |
434 | local yy = y * ys | |
435 | local yz = y * zs | |
436 | local zz = z * zs | |
437 | return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy)) | |
438 | end | |
439 | ||
440 | function QuaternionSlerp(a, b, t) | |
441 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
442 | local startInterp, finishInterp; | |
443 | if cosTheta >= 0.0001 then | |
444 | if (1 - cosTheta) > 0.0001 then | |
445 | local theta = ACOS(cosTheta) | |
446 | local invSinTheta = 1 / SIN(theta) | |
447 | startInterp = SIN((1 - t) * theta) * invSinTheta | |
448 | finishInterp = SIN(t * theta) * invSinTheta | |
449 | else | |
450 | startInterp = 1 - t | |
451 | finishInterp = t | |
452 | end | |
453 | else | |
454 | if (1 + cosTheta) > 0.0001 then | |
455 | local theta = ACOS(-cosTheta) | |
456 | local invSinTheta = 1 / SIN(theta) | |
457 | startInterp = SIN((t - 1) * theta) * invSinTheta | |
458 | finishInterp = SIN(t * theta) * invSinTheta | |
459 | else | |
460 | startInterp = t - 1 | |
461 | finishInterp = t | |
462 | end | |
463 | end | |
464 | return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp | |
465 | end | |
466 | ||
467 | function Clerp(a, b, t) | |
468 | local qa = {QuaternionFromCFrame(a)} | |
469 | local qb = {QuaternionFromCFrame(b)} | |
470 | local ax, ay, az = a.x, a.y, a.z | |
471 | local bx, by, bz = b.x, b.y, b.z | |
472 | local _t = 1 - t | |
473 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
474 | end | |
475 | ||
476 | function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME) | |
477 | local frame = IT("Frame") | |
478 | frame.BackgroundTransparency = TRANSPARENCY | |
479 | frame.BorderSizePixel = BORDERSIZEPIXEL | |
480 | frame.Position = POSITION | |
481 | frame.Size = SIZE | |
482 | frame.BackgroundColor3 = COLOR | |
483 | frame.BorderColor3 = BORDERCOLOR | |
484 | frame.Name = NAME | |
485 | frame.Parent = PARENT | |
486 | return frame | |
487 | end | |
488 | ||
489 | function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME) | |
490 | local label = IT("TextLabel") | |
491 | label.BackgroundTransparency = 1 | |
492 | label.Size = UD2(1, 0, 1, 0) | |
493 | label.Position = UD2(0, 0, 0, 0) | |
494 | label.TextColor3 = TEXTCOLOR | |
495 | label.TextStrokeTransparency = STROKETRANSPARENCY | |
496 | label.TextTransparency = TRANSPARENCY | |
497 | label.FontSize = TEXTFONTSIZE | |
498 | label.Font = TEXTFONT | |
499 | label.BorderSizePixel = BORDERSIZEPIXEL | |
500 | label.TextScaled = false | |
501 | label.Text = TEXT | |
502 | label.Name = NAME | |
503 | label.Parent = PARENT | |
504 | return label | |
505 | end | |
506 | ||
507 | function NoOutlines(PART) | |
508 | PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10 | |
509 | end | |
510 | ||
511 | ||
512 | function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1) | |
513 | local NEWWELD = IT(TYPE) | |
514 | NEWWELD.Part0 = PART0 | |
515 | NEWWELD.Part1 = PART1 | |
516 | NEWWELD.C0 = C0 | |
517 | NEWWELD.C1 = C1 | |
518 | NEWWELD.Parent = PARENT | |
519 | return NEWWELD | |
520 | end | |
521 | ||
522 | local S = IT("Sound") | |
523 | ||
524 | function CreateSound(ID, PARENT, VOLUME, PITCH) | |
525 | local NEWSOUND = nil | |
526 | coroutine.resume(coroutine.create(function() | |
527 | NEWSOUND = S:Clone() | |
528 | NEWSOUND.Parent = PARENT | |
529 | NEWSOUND.Volume = VOLUME | |
530 | NEWSOUND.Pitch = PITCH | |
531 | NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID | |
532 | Swait() | |
533 | NEWSOUND:play() | |
534 | game:GetService("Debris"):AddItem(NEWSOUND, 10) | |
535 | end)) | |
536 | return NEWSOUND | |
537 | end | |
538 | ||
539 | function CFrameFromTopBack(at, top, back) | |
540 | local right = top:Cross(back) | |
541 | return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z) | |
542 | end | |
543 | ||
544 | function CreateWave(SIZE,WAIT,CFRAME,DOESROT,ROT,COLOR,GROW) | |
545 | local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(0,0,0)) | |
546 | local mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8)) | |
547 | wave.CFrame = CFRAME | |
548 | coroutine.resume(coroutine.create(function(PART) | |
549 | for i = 1, WAIT do | |
550 | Swait() | |
551 | mesh.Scale = mesh.Scale + GROW | |
552 | mesh.Offset = VT(0,0,-(mesh.Scale.X/8)) | |
553 | if DOESROT == true then | |
554 | wave.CFrame = wave.CFrame * CFrame.fromEulerAnglesXYZ(0,ROT,0) | |
555 | end | |
556 | wave.Transparency = wave.Transparency + (0.5/WAIT) | |
557 | if wave.Transparency > 0.99 then | |
558 | wave:remove() | |
559 | end | |
560 | end | |
561 | end)) | |
562 | end | |
563 | ||
564 | --WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil}) | |
565 | function WACKYEFFECT(Table) | |
566 | local TYPE = (Table.EffectType or "Sphere") | |
567 | local SIZE = (Table.Size or VT(1,1,1)) | |
568 | local ENDSIZE = (Table.Size2 or VT(0,0,0)) | |
569 | local TRANSPARENCY = (Table.Transparency or 0) | |
570 | local ENDTRANSPARENCY = (Table.Transparency2 or 1) | |
571 | local CFRAME = (Table.CFrame or Torso.CFrame) | |
572 | local MOVEDIRECTION = (Table.MoveToPos or nil) | |
573 | local ROTATION1 = (Table.RotationX or 0) | |
574 | local ROTATION2 = (Table.RotationY or 0) | |
575 | local ROTATION3 = (Table.RotationZ or 0) | |
576 | local MATERIAL = (Table.Material or "Neon") | |
577 | local COLOR = (Table.Color or C3(1,1,1)) | |
578 | local TIME = (Table.Time or 45) | |
579 | local SOUNDID = (Table.SoundID or nil) | |
580 | local SOUNDPITCH = (Table.SoundPitch or nil) | |
581 | local SOUNDVOLUME = (Table.SoundVolume or nil) | |
582 | coroutine.resume(coroutine.create(function() | |
583 | local PLAYSSOUND = false | |
584 | local SOUND = nil | |
585 | local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Really red"), "Effect", VT(1,1,1), true) | |
586 | if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then | |
587 | PLAYSSOUND = true | |
588 | SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false) | |
589 | end | |
590 | EFFECT.Color = COLOR | |
591 | local MSH = nil | |
592 | if TYPE == "Sphere" then | |
593 | MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0)) | |
594 | elseif TYPE == "Block" then | |
595 | MSH = IT("BlockMesh",EFFECT) | |
596 | MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X) | |
597 | elseif TYPE == "Wave" then | |
598 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8)) | |
599 | elseif TYPE == "Ring" then | |
600 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0)) | |
601 | elseif TYPE == "Slash" then | |
602 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
603 | elseif TYPE == "Round Slash" then | |
604 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
605 | elseif TYPE == "Swirl" then | |
606 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0)) | |
607 | elseif TYPE == "Skull" then | |
608 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0)) | |
609 | elseif TYPE == "Crystal" then | |
610 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0)) | |
611 | end | |
612 | if MSH ~= nil then | |
613 | local MOVESPEED = nil | |
614 | if MOVEDIRECTION ~= nil then | |
615 | MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME | |
616 | end | |
617 | local GROWTH = SIZE - ENDSIZE | |
618 | local TRANS = TRANSPARENCY - ENDTRANSPARENCY | |
619 | if TYPE == "Block" then | |
620 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
621 | else | |
622 | EFFECT.CFrame = CFRAME | |
623 | end | |
624 | for LOOP = 1, TIME+1 do | |
625 | Swait() | |
626 | MSH.Scale = MSH.Scale - GROWTH/TIME | |
627 | if TYPE == "Wave" then | |
628 | MSH.Offset = VT(0,0,-MSH.Scale.X/8) | |
629 | end | |
630 | EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME | |
631 | if TYPE == "Block" then | |
632 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
633 | else | |
634 | EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3)) | |
635 | end | |
636 | if MOVEDIRECTION ~= nil then | |
637 | local ORI = EFFECT.Orientation | |
638 | EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED) | |
639 | EFFECT.Orientation = ORI | |
640 | end | |
641 | end | |
642 | if PLAYSSOUND == false then | |
643 | EFFECT:remove() | |
644 | else | |
645 | SOUND.Stopped:Connect(function() | |
646 | EFFECT:remove() | |
647 | end) | |
648 | end | |
649 | else | |
650 | if PLAYSSOUND == false then | |
651 | EFFECT:remove() | |
652 | else | |
653 | repeat Swait() until SOUND.Playing == false | |
654 | EFFECT:remove() | |
655 | end | |
656 | end | |
657 | end)) | |
658 | end | |
659 | ||
660 | function CreateRing(SIZE,DOESROT,ROT,WAIT,CFRAME,COLOR,GROW) | |
661 | local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(0,0,0)) | |
662 | local mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "559831844", "", SIZE, VT(0,0,0)) | |
663 | wave.CFrame = CFRAME | |
664 | coroutine.resume(coroutine.create(function(PART) | |
665 | for i = 1, WAIT do | |
666 | Swait() | |
667 | mesh.Scale = mesh.Scale + GROW | |
668 | if DOESROT == true then | |
669 | wave.CFrame = wave.CFrame * CFrame.fromEulerAnglesXYZ(0,ROT,0) | |
670 | end | |
671 | wave.Transparency = wave.Transparency + (0.5/WAIT) | |
672 | if wave.Transparency > 0.99 then | |
673 | wave:remove() | |
674 | end | |
675 | end | |
676 | end)) | |
677 | end | |
678 | ||
679 | function MagicSphere(SIZE,WAIT,CFRAME,COLOR,GROW) | |
680 | local wave = CreatePart(3, Effects, "Neon", 0, 0, BRICKC(COLOR), "Effect", VT(1,1,1), true) | |
681 | local mesh = CreateMesh("SpecialMesh", wave, "Sphere", "", "", SIZE, VT(0,0,0)) | |
682 | wave.CFrame = CFRAME | |
683 | coroutine.resume(coroutine.create(function(PART) | |
684 | for i = 1, WAIT do | |
685 | Swait() | |
686 | mesh.Scale = mesh.Scale + GROW | |
687 | wave.Transparency = wave.Transparency + (1/WAIT) | |
688 | if wave.Transparency > 0.99 then | |
689 | wave:remove() | |
690 | end | |
691 | end | |
692 | end)) | |
693 | end | |
694 | ||
695 | function Slice(KIND,SIZE,WAIT,CFRAME,COLOR,GROW) | |
696 | local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(1,1,1), true) | |
697 | local mesh = nil | |
698 | if KIND == "Base" then | |
699 | mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "448386996", "", VT(0,SIZE/10,SIZE/10), VT(0,0,0)) | |
700 | elseif KIND == "Thin" then | |
701 | mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "662586858", "", VT(SIZE/10,0,SIZE/10), VT(0,0,0)) | |
702 | elseif KIND == "Round" then | |
703 | mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "662585058", "", VT(SIZE/10,0,SIZE/10), VT(0,0,0)) | |
704 | end | |
705 | wave.CFrame = CFRAME | |
706 | coroutine.resume(coroutine.create(function(PART) | |
707 | for i = 1, WAIT do | |
708 | Swait() | |
709 | mesh.Scale = mesh.Scale + GROW/10 | |
710 | wave.Transparency = wave.Transparency + (0.5/WAIT) | |
711 | if wave.Transparency > 0.99 then | |
712 | wave:remove() | |
713 | end | |
714 | end | |
715 | end)) | |
716 | end | |
717 | ||
718 | function MakeForm(PART,TYPE) | |
719 | if TYPE == "Cyl" then | |
720 | local MSH = IT("CylinderMesh",PART) | |
721 | elseif TYPE == "Ball" then | |
722 | local MSH = IT("SpecialMesh",PART) | |
723 | MSH.MeshType = "Sphere" | |
724 | elseif TYPE == "Wedge" then | |
725 | local MSH = IT("SpecialMesh",PART) | |
726 | MSH.MeshType = "Wedge" | |
727 | end | |
728 | end | |
729 | ||
730 | function SpawnKnife(SIZE,ISGRABBED,LIMB,ROT,ROT2,DOESDODAMAGE,DAMAGE) | |
731 | SIZE = SIZE / 2 | |
732 | local WELD = nil | |
733 | local KNIFEMODEL = IT("Model",Effects) | |
734 | KNIFEMODEL.Name = "Knife" | |
735 | local HandlePart = CreatePart(3, KNIFEMODEL, "Neon", 0,0, "Really red", "Handle", VT(0.2,1.5,0.2)*SIZE,false) | |
736 | MakeForm(HandlePart,"Cyl") | |
737 | if ISGRABBED == true then | |
738 | WELD = CreateWeldOrSnapOrMotor("Weld", HandlePart, LIMB, HandlePart, CF(0, -1, 0) * ANGLES(RAD(ROT), RAD(ROT2), RAD(0)), CF(0, 0, 0)) | |
739 | end | |
740 | local BladePart = CreatePart(3, KNIFEMODEL, "Neon", 0,1, "Really red", "BladeHolder", VT(0.2,2.8+(3.25/1.5),0.2)*SIZE,false) | |
741 | BladePart.CFrame = HandlePart.CFrame*CF(0,-2.8*SIZE,-0.05*SIZE) | |
742 | weldBetween(HandlePart,BladePart) | |
743 | local Part = CreatePart(3, KNIFEMODEL, "Neon", 0,0, "Really red", "Blade", VT(0,2.8,1)*SIZE,false) | |
744 | MakeForm(Part,"Wedge") | |
745 | Part.CFrame = BladePart.CFrame*CF(0,-1.475*SIZE,0.45*SIZE) * ANGLES(RAD(180), RAD(0), RAD(0)) | |
746 | weldBetween(BladePart,Part) | |
747 | local Part = CreatePart(3, KNIFEMODEL, "Neon", 0,0, "Really red", "Blade", VT(0,3.25/1.5,0.5)*SIZE,false) | |
748 | MakeForm(Part,"Wedge") | |
749 | Part.CFrame = BladePart.CFrame*CF(0,1*SIZE,1.2*SIZE) * ANGLES(RAD(180), RAD(0), RAD(0)) | |
750 | weldBetween(BladePart,Part) | |
751 | local Part = CreatePart(3, KNIFEMODEL, "Neon", 0,0, "Really red", "Blade", VT(0,3.25/1.5,1)*SIZE,false) | |
752 | Part.CFrame = BladePart.CFrame*CF(0,1*SIZE,0.45*SIZE) * ANGLES(RAD(180), RAD(0), RAD(0)) | |
753 | weldBetween(BladePart,Part) | |
754 | local A = IT("Attachment",BladePart) | |
755 | A.Position = VT(0,BladePart.Size.Y/2,0) | |
756 | local B = IT("Attachment",BladePart) | |
757 | B.Position = VT(0,-BladePart.Size.Y/2,0) | |
758 | local Trail = IT("Trail",BladePart) | |
759 | Trail.Attachment0 = A | |
760 | Trail.Attachment1 = B | |
761 | Trail.Lifetime = 0.2 | |
762 | Trail.Color = ColorSequence.new(BRICKC"Really red".Color) | |
763 | Trail.Transparency = NumberSequence.new(0, 1) | |
764 | for _, c in pairs(KNIFEMODEL:GetChildren()) do | |
765 | if c.ClassName == "Part" then | |
766 | c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0) | |
767 | end | |
768 | end | |
769 | if DOESDODAMAGE == true then | |
770 | local HIT = false | |
771 | BladePart.CanCollide = true | |
772 | local TOUCHED = BladePart.Touched:Connect(function(hit) | |
773 | if HIT == false then | |
774 | if hit ~= nil then | |
775 | if hit.Parent ~= nil then | |
776 | if hit.Parent ~= Character and hit.Parent:FindFirstChildOfClass("Humanoid") then | |
777 | HIT = true | |
778 | ApplyDamage(hit.Parent:FindFirstChildOfClass("Humanoid"),DAMAGE,2,2) | |
779 | wait(0.1) | |
780 | HIT = false | |
781 | end | |
782 | end | |
783 | end | |
784 | end | |
785 | end) | |
786 | end | |
787 | return KNIFEMODEL,WELD,BladePart | |
788 | end | |
789 | ||
790 | function PuddleOfBlood(Position,MaxDrop,Model,MaxSize) | |
791 | local HITFLOOR, HITPOS, NORMAL = Raycast(Position, (CF(Position, Position + VT(0, -1, 0))).lookVector, MaxDrop, Model) | |
792 | if HITFLOOR ~= nil then | |
793 | if HITFLOOR.Parent ~= Effects and HITFLOOR.Parent ~= Character then | |
794 | if HITFLOOR.Name == "BloodPuddle" then | |
795 | local DIST = (Position - HITFLOOR.Position).Magnitude | |
796 | if (HITFLOOR.Size.Z <= 5 and HITFLOOR.Size.Z < MaxSize) or (HITFLOOR.Size.Z > 5 and HITFLOOR.Size.Z < MaxSize and DIST < HITFLOOR.Size.Z/3) then | |
797 | HITFLOOR.Size = HITFLOOR.Size + VT(0.1,0,0.1) | |
798 | end | |
799 | else | |
800 | if HITFLOOR.Anchored == true then | |
801 | local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(2,0,2)) | |
802 | BLOOD.CFrame = CF(HITPOS,HITPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0)) | |
803 | MakeForm(BLOOD,"Cyl") | |
804 | coroutine.resume(coroutine.create(function() | |
805 | Swait(75) | |
806 | while true do | |
807 | Swait() | |
808 | BLOOD.Size = BLOOD.Size - VT(0.02,0,0.02) | |
809 | if BLOOD.Size.Z < 0.051 then | |
810 | BLOOD:remove() | |
811 | break | |
812 | end | |
813 | end | |
814 | end)) | |
815 | end | |
816 | end | |
817 | end | |
818 | end | |
819 | end | |
820 | ||
821 | function MakeForm(PART,TYPE) | |
822 | if TYPE == "Cyl" then | |
823 | local MSH = IT("CylinderMesh",PART) | |
824 | elseif TYPE == "Ball" then | |
825 | local MSH = IT("SpecialMesh",PART) | |
826 | MSH.MeshType = "Sphere" | |
827 | elseif TYPE == "Wedge" then | |
828 | local MSH = IT("SpecialMesh",PART) | |
829 | MSH.MeshType = "Wedge" | |
830 | end | |
831 | end | |
832 | ||
833 | function SpawnTrail(FROM,TO,BIG) | |
834 | local TRAIL = CreatePart(3, Effects, "Neon", 0, 0.5, "New Yeller", "Trail", VT(0,0,0)) | |
835 | MakeForm(TRAIL,"Cyl") | |
836 | local DIST = (FROM - TO).Magnitude | |
837 | if BIG == true then | |
838 | TRAIL.Size = VT(0.5,DIST,0.5) | |
839 | else | |
840 | TRAIL.Size = VT(0.25,DIST,0.25) | |
841 | end | |
842 | TRAIL.CFrame = CF(FROM, TO) * CF(0, 0, -DIST/2) * ANGLES(RAD(90),RAD(0),RAD(0)) | |
843 | coroutine.resume(coroutine.create(function() | |
844 | for i = 1, 5 do | |
845 | Swait() | |
846 | TRAIL.Transparency = TRAIL.Transparency + 0.1 | |
847 | end | |
848 | TRAIL:remove() | |
849 | end)) | |
850 | end | |
851 | ||
852 | function SpawnTrail2(FROM,TO,BIG) | |
853 | local TRAIL = CreatePart(3, Effects, "Neon", 0, 0.5, "New Yeller", "Trail", VT(0,0,0)) | |
854 | MakeForm(TRAIL,"Cyl") | |
855 | local DIST = (FROM - TO).Magnitude | |
856 | if BIG == true then | |
857 | TRAIL.Size = VT(0.8,DIST,0.8) | |
858 | else | |
859 | TRAIL.Size = VT(0.27,DIST,0.27) | |
860 | end | |
861 | TRAIL.CFrame = CF(FROM, TO) * CF(0, 0, -DIST/2) * ANGLES(RAD(90),RAD(0),RAD(0)) | |
862 | coroutine.resume(coroutine.create(function() | |
863 | for i = 1, 5 do | |
864 | Swait() | |
865 | TRAIL.Transparency = TRAIL.Transparency + 0.1 | |
866 | end | |
867 | TRAIL:remove() | |
868 | end)) | |
869 | end | |
870 | ||
871 | Debris = game:GetService("Debris") | |
872 | ||
873 | function CastProperRay(StartPos, EndPos, Distance, Ignore) | |
874 | local DIRECTION = CF(StartPos,EndPos).lookVector | |
875 | return Raycast(StartPos, DIRECTION, Distance, Ignore) | |
876 | end | |
877 | ||
878 | function turnto(position) | |
879 | RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0) | |
880 | end | |
881 | ||
882 | function SprayBlood(POSITION,DIRECTION,BloodSize,DoesTable,Table) | |
883 | local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(0.5,0.5,0.5),false) | |
884 | BLOOD.CFrame = CF(POSITION) | |
885 | MakeForm(BLOOD,"Ball") | |
886 | local bv = Instance.new("BodyVelocity",BLOOD) | |
887 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
888 | bv.velocity = CF(POSITION,DIRECTION+VT(MRANDOM(-3,3),MRANDOM(-3,3)/30,MRANDOM(-3,3))).lookVector*65 | |
889 | bv.Name = "MOVE" | |
890 | Debris:AddItem(bv,0.05) | |
891 | coroutine.resume(coroutine.create(function() | |
892 | local HASTOUCHEDGROUND = false | |
893 | local HIT = BLOOD.Touched:Connect(function(hit) | |
894 | if hit.Anchored == true then | |
895 | HASTOUCHEDGROUND = true | |
896 | if DoesTable == true then | |
897 | AddChildrenToTable(BLOOD.Position,workspace,15,Table) | |
898 | end | |
899 | PuddleOfBlood(BLOOD.Position+VT(0,1,0),2,BLOOD,BloodSize) | |
900 | end | |
901 | end) | |
902 | for i = 1, 75 do | |
903 | Swait() | |
904 | if i > 5 then | |
905 | BLOOD.CanCollide = true | |
906 | end | |
907 | if HASTOUCHEDGROUND == true then | |
908 | break | |
909 | end | |
910 | end | |
911 | BLOOD:remove() | |
912 | end)) | |
913 | end | |
914 | ||
915 | function CheckTableForString(Table, String) | |
916 | for i, v in pairs(Table) do | |
917 | if string.find(string.lower(String), string.lower(v)) then | |
918 | return true | |
919 | end | |
920 | end | |
921 | return false | |
922 | end | |
923 | ||
924 | function CheckIntangible(Hit) | |
925 | local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Lightning", "Bullet"} | |
926 | if Hit and Hit.Parent then | |
927 | if ((not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then | |
928 | return true | |
929 | end | |
930 | end | |
931 | return false | |
932 | end | |
933 | ||
934 | Debris = game:GetService("Debris") | |
935 | ||
936 | function CastZapRay(StartPos, Vec, Length, Ignore, DelayIfHit) | |
937 | local Direction = CFrame.new(StartPos, Vec).lookVector | |
938 | local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore}) | |
939 | local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Direction * Length), Ignore) | |
940 | if RayHit and CheckIntangible(RayHit) then | |
941 | if DelayIfHit then | |
942 | wait() | |
943 | end | |
944 | RayHit, RayPos, RayNormal = CastZapRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit) | |
945 | end | |
946 | return RayHit, RayPos, RayNormal | |
947 | end | |
948 | ||
949 | function turnto(position) | |
950 | RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0) | |
951 | end | |
952 | ||
953 | --//=================================\\ | |
954 | --|| WEAPON CREATION | |
955 | --\\=================================// | |
956 | ||
957 | armor = Instance.new("Part") | |
958 | armormesh = Instance.new("SpecialMesh") | |
959 | armor.Anchored = false | |
960 | armor.CanCollide = false | |
961 | armor.Size = Vector3.new(1.4, 0.7, 1.3) | |
962 | armor.BrickColor = BrickColor.new("Black") | |
963 | armor.FrontSurface = Enum.SurfaceType.SmoothNoOutlines | |
964 | armor.Material = Enum.Material.SmoothPlastic | |
965 | armor.Color = Color3.new(0.105882, 0.164706, 0.207843) | |
966 | armor.RightSurface = Enum.SurfaceType.SmoothNoOutlines | |
967 | armor.LeftSurface = Enum.SurfaceType.SmoothNoOutlines | |
968 | armor.BottomSurface = Enum.SurfaceType.SmoothNoOutlines | |
969 | armor.BackSurface = Enum.SurfaceType.SmoothNoOutlines | |
970 | armor.TopSurface = Enum.SurfaceType.SmoothNoOutlines | |
971 | armor.Parent = Character | |
972 | armor.CFrame = CFrame.new(-87.19, 0.42, -26.37) * CFrame.Angles(0, 0, 0) | |
973 | armormesh.MeshId = "rbxassetid://840131767" | |
974 | armormesh.MeshType = Enum.MeshType.FileMesh | |
975 | armormesh.Parent = armor | |
976 | local wlf4 = Instance.new("Weld",armor) | |
977 | wlf4.Part0 = armor | |
978 | wlf4.Part1 = Torso | |
979 | wlf4.C0 = wlf4.C0 * CFrame.Angles(math.rad(0),math.rad(180),math.rad(0)) | |
980 | wlf4.C1 = CFrame.new(0,0,0) | |
981 | ||
982 | for _, c in pairs(Weapon:GetChildren()) do | |
983 | if c.Name == "Left Arm" or c.Name == "LeftLowerArm" then | |
984 | LEFTCUFF = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Cuff", VT(c.Size.X+0.1, 0.1, c.Size.Z+0.1),false) | |
985 | LEFTCUFF.CFrame = c.CFrame | |
986 | weldBetween(c,LEFTCUFF) | |
987 | end | |
988 | end | |
989 | for _, c in pairs(Weapon:GetChildren()) do | |
990 | if c.Name == "Right Arm" or c.Name == "RightLowerArm" then | |
991 | RIGHTCUFF = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Cuff", VT(c.Size.X+0.1, 0.1, c.Size.Z+0.1),false) | |
992 | RIGHTCUFF.CFrame = c.CFrame | |
993 | weldBetween(c,RIGHTCUFF) | |
994 | end | |
995 | end | |
996 | if RIGHTCUFF and LEFTCUFF then | |
997 | local A = IT("Attachment",RIGHTCUFF) | |
998 | local B = IT("Attachment",LEFTCUFF) | |
999 | ChainLink = IT("Beam",Weapon) | |
1000 | ChainLink.Texture = "rbxassetid://73042633" | |
1001 | ChainLink.Color = ColorSequence.new(C3(0.8,0.8,0.8)) | |
1002 | ChainLink.TextureSpeed = 0 | |
1003 | ChainLink.Width0 = 1 | |
1004 | ChainLink.Width1 = 1 | |
1005 | ChainLink.Segments = 25 | |
1006 | ChainLink.TextureLength = 3 | |
1007 | ChainLink.Attachment0 = B | |
1008 | ChainLink.Attachment1 = A | |
1009 | ChainLink.FaceCamera = true | |
1010 | ChainLink.Transparency = NumberSequence.new(0) | |
1011 | end | |
1012 | ||
1013 | local GUN = CreatePart(3, Weapon, "Neon", 0, 0, "Really black", "Gun", VT(1, 0.8, 3),false) | |
1014 | CreateMesh("SpecialMesh", GUN, "FileMesh", "94219391", "94219470", VT(0.7, 0.7, 0.8), VT(0,0,0)) | |
1015 | local GUNWELD = CreateWeldOrSnapOrMotor("Weld", GUN, Torso, GUN, CF(-0.0,0.5,0.9) * ANGLES(RAD(90), RAD(110), RAD(167)), CF(0, 0, 0)) | |
1016 | ||
1017 | local GUN2 = CreatePart(3, Weapon, "Neon", 0, 0, "Really black", "Gun2", VT(1, 0.8, 3),false) | |
1018 | CreateMesh("SpecialMesh", GUN2, "FileMesh", "623102664", "623102879", VT(0.01, 0.01, 0.01), VT(0,0,0)) | |
1019 | local GUN2WELD = CreateWeldOrSnapOrMotor("Weld", GUN2, Torso, GUN2, CF(-1.1,-1.1,0) * ANGLES(RAD(0), RAD(90), RAD(-90)), CF(0, 0, 0)) | |
1020 | ||
1021 | local PRT = CreatePart(3, Character, "Fabric", 0, 0, "Really black", "Hood", VT(1,1,1),false) | |
1022 | PRT.Color = C3(0,0,0) | |
1023 | local HoodWeld = CreateWeldOrSnapOrMotor("Weld", Head, Head, PRT, CF(0,0.2,0), CF(0, 0, 0)) | |
1024 | CreateMesh("SpecialMesh", PRT, "FileMesh", "76062497", "", VT(1,1,1)*1.05, VT(0,0,0)) | |
1025 | local PRT = CreatePart(3, Character, "Neon", 0, 0, "Really black", "Scarf", VT(1,1,1),false) | |
1026 | PRT.Color = C3(0,0,0) | |
1027 | CreateWeldOrSnapOrMotor("Weld", Torso, Torso, PRT, CF(0.05,0.4,-0.05) * ANGLES(RAD(-3), RAD(0), RAD(0)), CF(0, 0, 0)) | |
1028 | CreateMesh("SpecialMesh", PRT, "FileMesh", "99856331", "", VT(1.1,1,1.1), VT(0,0,0)) | |
1029 | ||
1030 | local EYE = CreatePart(3, Weapon, "Neon", 0, 0, "Really black", "Eye", VT(0.1,0.25,0.2),false) | |
1031 | CreateWeldOrSnapOrMotor("Weld", EYE, Head, EYE, CF(0.15,0.25,-0.53) * ANGLES(RAD(0), RAD(0), RAD(-80)), CF(0, 0, 0)) | |
1032 | MakeForm(EYE,"Ball") | |
1033 | local EYE = CreatePart(3, Weapon, "Neon", 0, 0, "Really black", "Eye", VT(0.1,0.25,0.2),false) | |
1034 | CreateWeldOrSnapOrMotor("Weld", EYE, Head, EYE, CF(-0.15,0.25,-0.53) * ANGLES(RAD(0), RAD(0), RAD(80)), CF(0, 0, 0)) | |
1035 | MakeForm(EYE,"Ball") | |
1036 | ||
1037 | local EYE = CreatePart(3, Weapon, "Neon", 0, 0, "Really white", "Eye", VT(0.1,0.1,0.1),false) | |
1038 | CreateWeldOrSnapOrMotor("Weld", EYE, Head, EYE, CF(0.15,0.19,-0.58) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0)) | |
1039 | MakeForm(EYE,"Ball") | |
1040 | local EYE = CreatePart(3, Weapon, "Neon", 0, 0, "Really white", "Eye", VT(0.1,0.1,0.1),false) | |
1041 | CreateWeldOrSnapOrMotor("Weld", EYE, Head, EYE, CF(-0.15,0.19,-0.58) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0)) | |
1042 | MakeForm(EYE,"Ball") | |
1043 | ||
1044 | local EYE = CreatePart(3, Weapon, "Neon", 0, 0, "Really black", "Eye", VT(0.005,0.005,0.005),false) | |
1045 | CreateWeldOrSnapOrMotor("Weld", EYE, Head, EYE, CF(0.15,0.20,-0.62) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0)) | |
1046 | MakeForm(EYE,"Ball") | |
1047 | local EYE = CreatePart(3, Weapon, "Neon", 0, 0, "Really black", "Eye", VT(0.005,0.005,0.005),false) | |
1048 | CreateWeldOrSnapOrMotor("Weld", EYE, Head, EYE, CF(-0.15,0.20,-0.62) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0)) | |
1049 | MakeForm(EYE,"Ball") | |
1050 | ||
1051 | local LASTPART = Head | |
1052 | for i = 1, 15 do | |
1053 | local MATH = (1-(i/16)) | |
1054 | if LASTPART == Head then | |
1055 | local Horn = CreatePart(3, Horn1, "Granite", 0, 0, "Dirt brown", "Horn", VT(1,0.25,1),false) | |
1056 | CreateWeldOrSnapOrMotor("Weld", Horn1, LASTPART, Horn, CF(0.45, 0.5, -0.15) * ANGLES(RAD(-35), RAD(5), RAD(-25)), CF(0, 0, 0)) | |
1057 | LASTPART = Horn | |
1058 | Horn.Color = C3((i/15),0,0) | |
1059 | local MSH = IT("BlockMesh",Horn) | |
1060 | MSH.Scale = VT(0.16*MATH,1,0.16*MATH) | |
1061 | else | |
1062 | local Horn = CreatePart(3, Horn1, "Granite", 0, 0, "Dirt brown", "Horn", VT(1,0.25,1),false) | |
1063 | CreateWeldOrSnapOrMotor("Weld", Horn1, LASTPART, Horn, CF(0, Horn.Size.Y/2.1, 0) * ANGLES(RAD(25), RAD(5), RAD(0)), CF(0, -Horn.Size.Y/2.2, 0)) | |
1064 | LASTPART = Horn | |
1065 | Horn.Color = C3((i/15),0,0) | |
1066 | local MSH = IT("BlockMesh",Horn) | |
1067 | MSH.Scale = VT(0.16*MATH,1,0.16*MATH) | |
1068 | end | |
1069 | end | |
1070 | local LASTPART = Head | |
1071 | for i = 1, 15 do | |
1072 | local MATH = (1-(i/16)) | |
1073 | if LASTPART == Head then | |
1074 | local Horn = CreatePart(3, Horn1, "Granite", 0, 0, "Dirt brown", "Horn", VT(1,0.25,1),false) | |
1075 | CreateWeldOrSnapOrMotor("Weld", Horn1, LASTPART, Horn, CF(-0.45, 0.5, -0.15) * ANGLES(RAD(-35), RAD(-5), RAD(25)), CF(0, 0, 0)) | |
1076 | LASTPART = Horn | |
1077 | Horn.Color = C3((i/15),0,0) | |
1078 | local MSH = IT("BlockMesh",Horn) | |
1079 | MSH.Scale = VT(0.16*MATH,1,0.16*MATH) | |
1080 | else | |
1081 | local Horn = CreatePart(3, Horn1, "Granite", 0, 0, "Dirt brown", "Horn", VT(1,0.25,1),false) | |
1082 | CreateWeldOrSnapOrMotor("Weld", Horn1, LASTPART, Horn, CF(0, Horn.Size.Y/2.1, 0) * ANGLES(RAD(25), RAD(-5), RAD(0)), CF(0, -Horn.Size.Y/2.2, 0)) | |
1083 | LASTPART = Horn | |
1084 | Horn.Color = C3((i/15),0,0) | |
1085 | local MSH = IT("BlockMesh",Horn) | |
1086 | MSH.Scale = VT(0.16*MATH,1,0.16*MATH) | |
1087 | end | |
1088 | end | |
1089 | ||
1090 | local LASTPART = Head | |
1091 | for i = 1, 15 do | |
1092 | local MATH = (1-(i/16)) | |
1093 | if LASTPART == Head then | |
1094 | local Horn = CreatePart(3, Horn1, "Granite", 0, 0, "Dirt brown", "Horn", VT(1,0.25,1),false) | |
1095 | CreateWeldOrSnapOrMotor("Weld", Horn1, LASTPART, Horn, CF(-0.45, 0.5, -0.15) * ANGLES(RAD(-35), RAD(-5), RAD(25)), CF(0, 0, 0)) | |
1096 | LASTPART = Horn | |
1097 | Horn.Color = C3((i/15),0,0) | |
1098 | local MSH = IT("BlockMesh",Horn) | |
1099 | MSH.Scale = VT(0.16*MATH,1,0.16*MATH) | |
1100 | else | |
1101 | local Horn = CreatePart(3, Horn1, "Granite", 0, 0, "Dirt brown", "Horn", VT(1,0.25,1),false) | |
1102 | CreateWeldOrSnapOrMotor("Weld", Horn1, LASTPART, Horn, CF(0, Horn.Size.Y/2.1, 0) * ANGLES(RAD(25), RAD(-5), RAD(0)), CF(0, -Horn.Size.Y/2.2, 0)) | |
1103 | LASTPART = Horn | |
1104 | Horn.Color = C3((i/15),0,0) | |
1105 | local MSH = IT("BlockMesh",Horn) | |
1106 | MSH.Scale = VT(0.16*MATH,1,0.16*MATH) | |
1107 | end | |
1108 | end | |
1109 | ||
1110 | for i = 1, 10 do | |
1111 | local FACE = CreatePart(3, Head, "Fabric", 0, 0+(i-1)/10.2, "Dark stone grey", "FaceGradient", VT(1.01,0.65,1.01),false) | |
1112 | FACE.Color = C3(0,0,0) | |
1113 | Head:FindFirstChildOfClass("SpecialMesh"):Clone().Parent = FACE | |
1114 | CreateWeldOrSnapOrMotor("Weld", Head, Head, FACE, CF(0,0.28-(i-1)/30,0), CF(0, 0, 0)) | |
1115 | end | |
1116 | ||
1117 | for _, c in pairs(Weapon:GetChildren()) do | |
1118 | if c.ClassName == "Part" then | |
1119 | c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0) | |
1120 | end | |
1121 | end | |
1122 | ||
1123 | Weapon.Parent = Character | |
1124 | ||
1125 | Humanoid.Died:connect(function() | |
1126 | ATTACK = true | |
1127 | end) | |
1128 | ||
1129 | ||
1130 | --//=================================\\ | |
1131 | --|| DAMAGE FUNCTIONS | |
1132 | --\\=================================// | |
1133 | ||
1134 | function StatLabel(CFRAME, TEXT, COLOR) | |
1135 | local STATPART = CreatePart(3, Effects, "SmoothPlastic", 0, 1, "Really black", "Effect", VT()) | |
1136 | STATPART.CFrame = CF(CFRAME.p,CFRAME.p+VT(MRANDOM(-5,5),MRANDOM(0,5),MRANDOM(-5,5))) | |
1137 | local BODYGYRO = IT("BodyGyro", STATPART) | |
1138 | game:GetService("Debris"):AddItem(STATPART ,5) | |
1139 | local BILLBOARDGUI = Instance.new("BillboardGui", STATPART) | |
1140 | BILLBOARDGUI.Adornee = STATPART | |
1141 | BILLBOARDGUI.Size = UD2(2.5, 0, 2.5 ,0) | |
1142 | BILLBOARDGUI.StudsOffset = VT(-2, 2, 0) | |
1143 | BILLBOARDGUI.AlwaysOnTop = false | |
1144 | local TEXTLABEL = Instance.new("TextLabel", BILLBOARDGUI) | |
1145 | TEXTLABEL.BackgroundTransparency = 1 | |
1146 | TEXTLABEL.Size = UD2(2.5, 0, 2.5, 0) | |
1147 | TEXTLABEL.Text = TEXT | |
1148 | TEXTLABEL.Font = "Fantasy" | |
1149 | TEXTLABEL.FontSize="Size42" | |
1150 | TEXTLABEL.TextColor3 = COLOR | |
1151 | TEXTLABEL.TextStrokeTransparency = 0 | |
1152 | TEXTLABEL.TextScaled = true | |
1153 | TEXTLABEL.TextWrapped = true | |
1154 | coroutine.resume(coroutine.create(function(THEPART, THEBODYPOSITION, THETEXTLABEL) | |
1155 | for i = 1, 50 do | |
1156 | Swait() | |
1157 | STATPART.CFrame = STATPART.CFrame * CF(0,0,-0.2) | |
1158 | TEXTLABEL.TextTransparency = TEXTLABEL.TextTransparency + (1/50) | |
1159 | TEXTLABEL.TextStrokeTransparency = TEXTLABEL.TextTransparency | |
1160 | end | |
1161 | THEPART.Parent = nil | |
1162 | end),STATPART, TEXTLABEL) | |
1163 | end | |
1164 | ||
1165 | function Switch() | |
1166 | ATTACK = true | |
1167 | Rooted = true | |
1168 | if MODE == "Cop" then | |
1169 | for i=0, 0.3, 0.1 / Animation_Speed do | |
1170 | Swait() | |
1171 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1172 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1173 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(25)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1174 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-25)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1175 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1176 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1177 | end | |
1178 | for i=0, 1, 0.1 / Animation_Speed do | |
1179 | Swait() | |
1180 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1181 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1182 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.25, 0.5, -0.5) * ANGLES(RAD(100), RAD(0), RAD(-70)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1183 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.35, -0.35) * ANGLES(RAD(70), RAD(0), RAD(80)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1184 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1185 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1186 | end | |
1187 | CreateSound(363808674, Torso, 6, 1, false) | |
1188 | for i=0, 0.6, 0.1 / Animation_Speed do | |
1189 | Swait() | |
1190 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1191 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5), RAD(25), RAD(0)), 1 / Animation_Speed) | |
1192 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.25, 0.5, -0.5) * ANGLES(RAD(100), RAD(0), RAD(-50)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1193 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.35, -0.35) * ANGLES(RAD(70), RAD(0), RAD(60)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1194 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1195 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1196 | end | |
1197 | CreateSound(363808674, Torso, 6, 1, false) | |
1198 | for i=0, 0.6, 0.1 / Animation_Speed do | |
1199 | Swait() | |
1200 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1201 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5), RAD(-25), RAD(0)), 1 / Animation_Speed) | |
1202 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-55), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1203 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.35, -0.35) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1204 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1205 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1206 | end | |
1207 | GUN2WELD.Part0 = LeftArm | |
1208 | GUN2WELD.C0 = CF(0,-1.5,0) * ANGLES(RAD(0), RAD(90), RAD(-90)) | |
1209 | GUNWELD.Part0 = RightArm | |
1210 | GUNWELD.C0 = CF(-0.2,-1.8,0.1) * ANGLES(RAD(90), RAD(174), RAD(179)) | |
1211 | MODE = "Cops" | |
1212 | elseif MODE == "Cops" then | |
1213 | CreateSound(147722227, Torso, 4, 1.3, false) | |
1214 | for i=0, 0.3, 0.1 / Animation_Speed do | |
1215 | Swait() | |
1216 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1217 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5), RAD(-25), RAD(0)), 1 / Animation_Speed) | |
1218 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-55), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1219 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.35, -0.35) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1220 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1221 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1222 | end | |
1223 | GUN2WELD.Part0 = Torso | |
1224 | GUN2WELD.C0 = CF(-1.1,-1.1,0) * ANGLES(RAD(0), RAD(90), RAD(-90)) | |
1225 | GUNWELD.Part0 = Torso | |
1226 | GUNWELD.C0 = CF(-0.0,0.5,0.9) * ANGLES(RAD(90), RAD(110), RAD(167)) | |
1227 | MODE = "Cop" | |
1228 | end | |
1229 | ATTACK = false | |
1230 | Rooted = false | |
1231 | end | |
1232 | ||
1233 | --//=================================\\ | |
1234 | --|| DAMAGING | |
1235 | --\\=================================// | |
1236 | ||
1237 | function ApplyDamage(Humanoid,Damage,CritRate,CritMultiplier) | |
1238 | local defence = Instance.new("BoolValue",Humanoid.Parent) | |
1239 | defence.Name = ("HitBy"..Player.Name) | |
1240 | game:GetService("Debris"):AddItem(defence, 0.001) | |
1241 | if Humanoid.Health ~= 0 then | |
1242 | local CritChance = MRANDOM(1,100) | |
1243 | if CritChance < CritRate + 1 then | |
1244 | Damage = Damage*CritMultiplier | |
1245 | end | |
1246 | if Damage > Humanoid.Health then | |
1247 | Damage = math.ceil(Humanoid.Health) | |
1248 | if Damage == 0 then | |
1249 | Damage = 0.1 | |
1250 | end | |
1251 | end | |
1252 | Humanoid.Health = Humanoid.Health - Damage | |
1253 | if Humanoid.Parent:FindFirstChild("Head") then | |
1254 | CreateSound(HITPLAYERSOUNDS[MRANDOM(1,#HITPLAYERSOUNDS)], Humanoid.Parent.Head, 5, 1) | |
1255 | if CritChance < CritRate + 1 then | |
1256 | StatLabel(Humanoid.Parent.Head.CFrame * CF(0, 0 + (Humanoid.Parent.Head.Size.z - 1), 0), "CRIT//"..Damage, C3(1, 0, 0)) | |
1257 | else | |
1258 | StatLabel(Humanoid.Parent.Head.CFrame * CF(0, 0 + (Humanoid.Parent.Head.Size.z - 1), 0), Damage, SKILLTEXTCOLOR) | |
1259 | end | |
1260 | end | |
1261 | end | |
1262 | end | |
1263 | ||
1264 | function AoEDamage(position,radius,min,max,maxstrength,critrate,critmultiplier,CanBeDodgedByJumping) | |
1265 | local dmg = math.random(min,max) | |
1266 | for i,v in ipairs(workspace:GetChildren()) do | |
1267 | if v:FindFirstChild("HitBy"..Player.Name) == nil then | |
1268 | local body = v:GetChildren() | |
1269 | for part = 1, #body do | |
1270 | if(v:FindFirstChild("HitBy"..Player.Name) == nil and (body[part].ClassName == "Part" or body[part].ClassName == "MeshPart") and v ~= Character) then | |
1271 | if(body[part].Position - position).Magnitude < radius then | |
1272 | if v.ClassName == "Model" then | |
1273 | if v:FindFirstChildOfClass("Humanoid") then | |
1274 | if CanBeDodgedByJumping == true then | |
1275 | if body[part].Position.Y < position.Y+5 then | |
1276 | ApplyDamage(v:FindFirstChildOfClass("Humanoid"),dmg,critrate,critmultiplier) | |
1277 | end | |
1278 | else | |
1279 | ApplyDamage(v:FindFirstChildOfClass("Humanoid"),dmg,critrate,critmultiplier) | |
1280 | end | |
1281 | local bv = Instance.new("BodyVelocity") | |
1282 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
1283 | bv.velocity = RootPart.CFrame.lookVector*maxstrength | |
1284 | bv.Parent = body[part] | |
1285 | Debris:AddItem(bv,0.2) | |
1286 | end | |
1287 | end | |
1288 | end | |
1289 | end | |
1290 | end | |
1291 | end | |
1292 | if v:FindFirstChild("HitBy"..Player.Name) then | |
1293 | v:FindFirstChild("HitBy"..Player.Name):remove() | |
1294 | end | |
1295 | end | |
1296 | end | |
1297 | ||
1298 | function killnearest(position,range,maxstrength,direction) | |
1299 | for i,v in ipairs(workspace:GetChildren()) do | |
1300 | local body = v:GetChildren() | |
1301 | for part = 1, #body do | |
1302 | if((body[part].ClassName == "Part" or body[part].ClassName == "MeshPart") and v ~= Character) then | |
1303 | if(body[part].Position - position).Magnitude < range then | |
1304 | if v.ClassName == "Model" then | |
1305 | --v:BreakJoints() | |
1306 | end | |
1307 | local POS = position | |
1308 | coroutine.resume(coroutine.create(function() | |
1309 | body[part].Anchored = true | |
1310 | body[part].Parent = Effects | |
1311 | body[part].CanCollide = true | |
1312 | local SIZE = body[part].Size | |
1313 | body[part].Material = "Neon" | |
1314 | CreateSound("952306739", body[part], 2, MRANDOM(7, 12) / 10) | |
1315 | for i = 1, 75 do | |
1316 | Swait() | |
1317 | body[part].Color = C3(0,0,0) | |
1318 | body[part].Size = VT(1,1,1) | |
1319 | end | |
1320 | coroutine.resume(coroutine.create(function() | |
1321 | while true do | |
1322 | Swait() | |
1323 | body[part].Color = C3(0,0,0) | |
1324 | body[part].Size = VT(1,1,1) | |
1325 | end | |
1326 | end)) | |
1327 | body[part].Anchored = false | |
1328 | body[part].Velocity = direction.lookVector*maxstrength | |
1329 | end)) | |
1330 | end | |
1331 | end | |
1332 | end | |
1333 | if v.ClassName == "Part" then | |
1334 | if v.Anchored == false and (v.Position - position).Magnitude < range then | |
1335 | local POS = position | |
1336 | coroutine.resume(coroutine.create(function() | |
1337 | v.Anchored = true | |
1338 | v.Parent = Effects | |
1339 | local SIZE = v.Size | |
1340 | v.Material = "Neon" | |
1341 | CreateSound("952306739", v, 2, MRANDOM(7, 12) / 10) | |
1342 | for i = 1, 75 do | |
1343 | Swait() | |
1344 | v.Color = C3(0,0,0) | |
1345 | v.Size = VT(1,1,1) | |
1346 | end | |
1347 | coroutine.resume(coroutine.create(function() | |
1348 | while true do | |
1349 | Swait() | |
1350 | v.Color = C3(0,0,0) | |
1351 | v.Size = VT(1,1,1) | |
1352 | end | |
1353 | end)) | |
1354 | v.Anchored = false | |
1355 | v.Velocity = direction.lookVector*maxstrength | |
1356 | end)) | |
1357 | end | |
1358 | end | |
1359 | end | |
1360 | end | |
1361 | ||
1362 | function ApplyAoE4(POSITION,RANGE,BRUTAL) | |
1363 | local CHILDREN = workspace:GetDescendants() | |
1364 | for index, CHILD in pairs(CHILDREN) do | |
1365 | if CHILD.ClassName == "Model" and CHILD ~= Character then | |
1366 | local HUM = CHILD:FindFirstChildOfClass("Humanoid") | |
1367 | if HUM then | |
1368 | local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso") | |
1369 | if TORSO then | |
1370 | if (TORSO.Position - POSITION).Magnitude <= RANGE then | |
1371 | if BRUTAL == true then | |
1372 | Kill(CHILD) | |
1373 | else | |
1374 | CHILD:BreakJoints() | |
1375 | end | |
1376 | end | |
1377 | end | |
1378 | end | |
1379 | end | |
1380 | end | |
1381 | end | |
1382 | ||
1383 | function Kill(Char) | |
1384 | local NewCharacter = IT("Model",Effects) | |
1385 | NewCharacter.Name = "Ow im ded ;-;" | |
1386 | for _, c in pairs(Char:GetDescendants()) do | |
1387 | if c:IsA("BasePart") and c.Transparency == 0 then | |
1388 | c:BreakJoints() | |
1389 | c.Material = "Glass" | |
1390 | c.Color = C3(1,0,0) | |
1391 | c.CanCollide = true | |
1392 | c.Transparency = 0.3 | |
1393 | if c:FindFirstChildOfClass("SpecialMesh") then | |
1394 | c:FindFirstChildOfClass("SpecialMesh").TextureId = "" | |
1395 | end | |
1396 | if c.Name == "Head" then | |
1397 | c:ClearAllChildren() | |
1398 | c.Size = VT(c.Size.Y,c.Size.Y,c.Size.Y) | |
1399 | end | |
1400 | if c.ClassName == "MeshPart" then | |
1401 | c.TextureID = "" | |
1402 | end | |
1403 | if c:FindFirstChildOfClass("BodyPosition") then | |
1404 | c:FindFirstChildOfClass("BodyPosition"):remove() | |
1405 | end | |
1406 | if c:FindFirstChildOfClass("ParticleEmitter") then | |
1407 | c:FindFirstChildOfClass("ParticleEmitter"):remove() | |
1408 | end | |
1409 | c.Parent = NewCharacter | |
1410 | c.Name = "DeadPart" | |
1411 | c.Velocity = VT(MRANDOM(-45,45),MRANDOM(-45,45),MRANDOM(-45,45))/15 | |
1412 | c.RotVelocity = VT(MRANDOM(-45,45),MRANDOM(-15,85),MRANDOM(-45,45)) | |
1413 | end | |
1414 | end | |
1415 | Char:remove() | |
1416 | Debris:AddItem(NewCharacter,5) | |
1417 | end | |
1418 | ||
1419 | --//=================================\\ | |
1420 | --|| ATTACK FUNCTIONS AND STUFF | |
1421 | --\\=================================// | |
1422 | ||
1423 | function Bullet2() | |
1424 | ATTACK = true | |
1425 | Rooted = false | |
1426 | for i=0, 0.9, 0.07 / Animation_Speed do | |
1427 | Swait() | |
1428 | turnto(Mouse.Hit.p) | |
1429 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 22)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1430 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 22)), RAD(15 - 22 * SIN(SINE / 0.5)), RAD(0)), 0.15 / Animation_Speed) | |
1431 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0.5) * ANGLES(RAD(83), RAD(30), RAD(0)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed) | |
1432 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0.5) * ANGLES(RAD(83), RAD(-30), RAD(0)) * LEFTSHOULDERC0, 0.5 / Animation_Speed) | |
1433 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1434 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-50), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1435 | end | |
1436 | repeat | |
1437 | for i=0, 0.1, 0.07 / Animation_Speed do | |
1438 | Swait() | |
1439 | turnto(Mouse.Hit.p) | |
1440 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 22)) * ANGLES(RAD(0 - 55 * SIN(SINE / 0.5)), RAD(0 - 55 * SIN(SINE / 0.5)), RAD(0)), 0.15 / Animation_Speed) | |
1441 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 22)), RAD(15 - 22 * SIN(SINE / 0.5)), RAD(0)), 0.15 / Animation_Speed) | |
1442 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0.5) * ANGLES(RAD(83 - 22 * SIN(SINE / 0.5)), RAD(30), RAD(0)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed) | |
1443 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0.5) * ANGLES(RAD(83 - 22 * SIN(SINE / 0.5)), RAD(-30), RAD(0)) * LEFTSHOULDERC0, 0.5 / Animation_Speed) | |
1444 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1445 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-50), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1446 | end | |
1447 | local HIT,POS = CastProperRay(GUN.Position, Mouse.Hit.p, 1000, Character) | |
1448 | SpawnTrail(GUN.Position,POS) | |
1449 | if HIT ~= nil then | |
1450 | if HIT.Parent ~= workspace and HIT.Parent.ClassName ~= "Folder" then | |
1451 | Kill(HIT.Parent) | |
1452 | end | |
1453 | end | |
1454 | WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(1,1.5,1), Transparency = 0, Transparency2 = 1, CFrame = GUN.CFrame, MoveToPos = GUN.CFrame*CF(0,0.5,0).p, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = nil, SoundPitch = nil, SoundVolume = nil}) | |
1455 | WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = GUN.CFrame, MoveToPos = nil, RotationX = 0, RotationY = 5, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = 131073013, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 0.5}) | |
1456 | WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = CF(POS,GUN.Position) * ANGLES(RAD(-90), RAD(0), RAD(0)), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = nil, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 8}) | |
1457 | WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = CF(POS,GUN.Position) * ANGLES(RAD(-90), RAD(0), RAD(0)), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = nil, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 8}) | |
1458 | for i=0, 0.2, 0.07 / Animation_Speed do | |
1459 | Swait() | |
1460 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 22)) * ANGLES(RAD(0 - 55 * SIN(SINE / 0.5)), RAD(0 - 22 * SIN(SINE / 0.5)), RAD(0)), 0.15 / Animation_Speed) | |
1461 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 22)), RAD(15), RAD(0)), 0.15 / Animation_Speed) | |
1462 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0.5) * ANGLES(RAD(90 - 22 * SIN(SINE / 0.5)), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed) | |
1463 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(90 - 22 * SIN(SINE / 0.5)), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.5 / Animation_Speed) | |
1464 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1465 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-50), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1466 | end | |
1467 | local HIT,POS = CastProperRay(GUN.Position, Mouse.Hit.p, 1000, Character) | |
1468 | SpawnTrail2(GUN.Position,POS) | |
1469 | SpawnTrail(GUN2.Position,POS) | |
1470 | if HIT ~= nil then | |
1471 | if HIT.Parent ~= workspace and HIT.Parent.ClassName ~= "Folder" then | |
1472 | Kill(HIT.Parent) | |
1473 | end | |
1474 | end | |
1475 | WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(1,1.5,1), Transparency = 0, Transparency2 = 1, CFrame = GUN2.CFrame, MoveToPos = GUN2.CFrame*CF(0,0.5,0).p, RotationX = 0, RotationY = -15, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = nil, SoundPitch = nil, SoundVolume = nil}) | |
1476 | WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = GUN2.CFrame, MoveToPos = nil, RotationX = 0, RotationY = 5, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = 904440937, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 0.5}) | |
1477 | WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = CF(POS,GUN2.Position) * ANGLES(RAD(-90), RAD(0), RAD(0)), MoveToPos = nil, RotationX = 0, RotationY = -5, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = nil, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 8}) | |
1478 | WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = CF(POS,GUN2.Position) * ANGLES(RAD(-90), RAD(0), RAD(0)), MoveToPos = nil, RotationX = 0, RotationY = 5, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = nil, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 8}) | |
1479 | until KEYHOLD == false | |
1480 | ATTACK = false | |
1481 | Rooted = false | |
1482 | end | |
1483 | ||
1484 | function Nope() | |
1485 | ATTACK = true | |
1486 | Rooted = false | |
1487 | CreateSound(130932305, Torso, 6, 1, false) | |
1488 | for i=0, 0.6, 0.1 / Animation_Speed do | |
1489 | Swait() | |
1490 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1491 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(45)), 1 / Animation_Speed) | |
1492 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-55), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1493 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.35, -0.35) * ANGLES(RAD(-55), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1494 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1495 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1496 | end | |
1497 | for i=0, 0.6, 0.1 / Animation_Speed do | |
1498 | Swait() | |
1499 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1500 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(-45)), 1 / Animation_Speed) | |
1501 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(55), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1502 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.35, -0.35) * ANGLES(RAD(55), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1503 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1504 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1505 | end | |
1506 | ATTACK = false | |
1507 | Rooted = false | |
1508 | end | |
1509 | ||
1510 | ||
1511 | --//=================================\\ | |
1512 | --|| ASSIGN THINGS TO KEYS | |
1513 | --\\=================================// | |
1514 | ||
1515 | function MouseDown(Mouse) | |
1516 | if ATTACK == false then | |
1517 | end | |
1518 | end | |
1519 | ||
1520 | function MouseUp(Mouse) | |
1521 | HOLD = false | |
1522 | end | |
1523 | ||
1524 | function KeyDown(Key) | |
1525 | KEYHOLD = true | |
1526 | if Key == "z" and ATTACK == false then | |
1527 | if MODE == "Cop" then | |
1528 | Nope() | |
1529 | elseif MODE == "Cops" then | |
1530 | Bullet2() | |
1531 | end | |
1532 | end | |
1533 | ||
1534 | if Key == "b" and ATTACK == false then | |
1535 | end | |
1536 | ||
1537 | if Key == "c" and ATTACK == false then | |
1538 | end | |
1539 | ||
1540 | if Key == "t" and ATTACK == false then | |
1541 | end | |
1542 | ||
1543 | if Key == "x" and ATTACK == false then | |
1544 | Switch() | |
1545 | end | |
1546 | end | |
1547 | ||
1548 | function KeyUp(Key) | |
1549 | KEYHOLD = false | |
1550 | end | |
1551 | ||
1552 | Mouse.Button1Down:connect(function(NEWKEY) | |
1553 | MouseDown(NEWKEY) | |
1554 | end) | |
1555 | Mouse.Button1Up:connect(function(NEWKEY) | |
1556 | MouseUp(NEWKEY) | |
1557 | end) | |
1558 | Mouse.KeyDown:connect(function(NEWKEY) | |
1559 | KeyDown(NEWKEY) | |
1560 | end) | |
1561 | Mouse.KeyUp:connect(function(NEWKEY) | |
1562 | KeyUp(NEWKEY) | |
1563 | end) | |
1564 | ||
1565 | --//=================================\\ | |
1566 | --\\=================================// | |
1567 | ||
1568 | ||
1569 | function unanchor() | |
1570 | if UNANCHOR == true then | |
1571 | g = Character:GetChildren() | |
1572 | for i = 1, #g do | |
1573 | if g[i].ClassName == "Part" then | |
1574 | g[i].Anchored = false | |
1575 | end | |
1576 | end | |
1577 | end | |
1578 | end | |
1579 | ||
1580 | ||
1581 | --//=================================\\ | |
1582 | --|| WRAP THE WHOLE SCRIPT UP | |
1583 | --\\=================================// | |
1584 | ||
1585 | Humanoid.Changed:connect(function(Jump) | |
1586 | if Jump == "Jump" and (Disable_Jump == true) then | |
1587 | Humanoid.Jump = false | |
1588 | end | |
1589 | end) | |
1590 | ||
1591 | while true do | |
1592 | Swait() | |
1593 | ANIMATE.Parent = nil | |
1594 | local IDLEANIMATION = Humanoid:LoadAnimation(ROBLOXIDLEANIMATION) | |
1595 | IDLEANIMATION:Play() | |
1596 | SINE = SINE + CHANGE | |
1597 | local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude | |
1598 | local TORSOVERTICALVELOCITY = RootPart.Velocity.y | |
1599 | local LV = Torso.CFrame:pointToObjectSpace(Torso.Velocity - Torso.Position) | |
1600 | local HITFLOOR,HITPOS,NORMAL = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4 * Player_Size, Character) | |
1601 | local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16) | |
1602 | if ANIM == "Walk" and TORSOVELOCITY > 1 then | |
1603 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, -0.15 * COS(SINE / (WALKSPEEDVALUE / 2)) * Player_Size) * ANGLES(RAD(0), RAD(0) - RootPart.RotVelocity.Y / 75, RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1604 | Neck.C1 = Clerp(Neck.C1, CF(0 * Player_Size, -0.5 * Player_Size, 0 * Player_Size) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(2.5 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1605 | RightHip.C1 = Clerp(RightHip.C1, CF(0.5 * Player_Size, 0.875 * Player_Size - 0.125 * SIN(SINE / WALKSPEEDVALUE) * Player_Size, -0.125 * COS(SINE / WALKSPEEDVALUE) * Player_Size) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RightLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1606 | LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5 * Player_Size, 0.875 * Player_Size + 0.125 * SIN(SINE / WALKSPEEDVALUE) * Player_Size, 0.125 * COS(SINE / WALKSPEEDVALUE) * Player_Size) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LeftLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1607 | elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then | |
1608 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1609 | Neck.C1 = Clerp(Neck.C1, CF(0 * Player_Size, -0.5 * Player_Size, 0 * Player_Size) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1610 | RightHip.C1 = Clerp(RightHip.C1, CF(0.5 * Player_Size, 1 * Player_Size, 0 * Player_Size) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1611 | LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5 * Player_Size, 1 * Player_Size, 0 * Player_Size) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1612 | end | |
1613 | if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then | |
1614 | ANIM = "Jump" | |
1615 | if ATTACK == false then | |
1616 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1617 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 * Player_Size, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1618 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(20)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
1619 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
1620 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.3) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(-20)), 0.2 / Animation_Speed) | |
1621 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.3) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(20)), 0.2 / Animation_Speed) | |
1622 | end | |
1623 | elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then | |
1624 | ANIM = "Fall" | |
1625 | if ATTACK == false then | |
1626 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1627 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1628 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(60)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
1629 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-60)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
1630 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 0.2 / Animation_Speed) | |
1631 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10)), 0.2 / Animation_Speed) | |
1632 | end | |
1633 | elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then | |
1634 | ANIM = "Idle" | |
1635 | if ATTACK == false then | |
1636 | if MODE == "Cop" then | |
1637 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(MRANDOM(-5,5)), RAD(MRANDOM(-5,5)), RAD(MRANDOM(-5,5))), 1) | |
1638 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(160), RAD(0), RAD(15)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1639 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0 - 0.05 * COS(SINE / 7) + 0.05 * SIN(SINE / 7), 0, 0 + 0.05 * COS(SINE / 7)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.8 / Animation_Speed) | |
1640 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-3.5 * COS(SINE / 24)), RAD(0), RAD(12)) * ANGLES(RAD(0 - 2.5 * COS(SINE / 24) + 2.5 * SIN(SINE / 24)), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1641 | RightHip.C0 = Clerp(RightHip.C0, CF(1 - 0.05 * COS(SINE / 7) + 0.05 * SIN(SINE / 7), -1 - 0.05 * COS(SINE / 7), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.8 / Animation_Speed) | |
1642 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1 - 0.05 * COS(SINE / 7) + 0.05 * SIN(SINE / 7), -1 - 0.05 * COS(SINE / 7), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.8 / Animation_Speed) | |
1643 | elseif MODE == "Cops" then | |
1644 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1645 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-5 - 2.5 * COS(SINE / 12)), RAD(0), RAD(25)), 1 / Animation_Speed) | |
1646 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, -0.4) * ANGLES(RAD(150), RAD(0), RAD(0))* RIGHTSHOULDERC0, 0.15 / Animation_Speed) | |
1647 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, -0.4) * ANGLES(RAD(150), RAD(0), RAD(0))* LEFTSHOULDERC0, 0.15 / Animation_Speed) | |
1648 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1649 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1650 | end | |
1651 | end | |
1652 | elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then | |
1653 | ANIM = "Walk" | |
1654 | WALK = WALK + 1 / Animation_Speed | |
1655 | if WALK >= 15 - (5 * (Humanoid.WalkSpeed / 16 / Player_Size)) then | |
1656 | WALK = 0 | |
1657 | if WALKINGANIM == true then | |
1658 | WALKINGANIM = false | |
1659 | elseif WALKINGANIM == false then | |
1660 | WALKINGANIM = true | |
1661 | end | |
1662 | end | |
1663 | --RightHip.C1 = Clerp(RightHip.C1, CF(0.5 * Player_Size, 0.875 * Player_Size - 0.125 * SIN(SINE / WALKSPEEDVALUE) * Player_Size, -0.125 * COS(SINE / WALKSPEEDVALUE) * Player_Size) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RightLeg.RotVelocity.Y / 75, RAD(0), RAD(60 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1664 | --LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5 * Player_Size, 0.875 * Player_Size + 0.125 * SIN(SINE / WALKSPEEDVALUE) * Player_Size, 0.125 * COS(SINE / WALKSPEEDVALUE) * Player_Size) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LeftLeg.RotVelocity.Y / 75, RAD(0), RAD(60 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1665 | if ATTACK == false then | |
1666 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1) * ANGLES(RAD(5), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1667 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5 - 8 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1668 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(42), RAD(0), RAD(0))* RIGHTSHOULDERC0, 0.15 / Animation_Speed) | |
1669 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(42), RAD(0), RAD(0))* LEFTSHOULDERC0, 0.15 / Animation_Speed) | |
1670 | RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1 - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.2+ 0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 2 / Animation_Speed) | |
1671 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.2+ -0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(15)), 2 / Animation_Speed) | |
1672 | end | |
1673 | end | |
1674 | if Character:FindFirstChildOfClass("Accessory") then | |
1675 | Character:FindFirstChildOfClass("Accessory"):remove() | |
1676 | elseif Character:FindFirstChildOfClass("Hat") then | |
1677 | Character:FindFirstChildOfClass("Hat"):remove() | |
1678 | end | |
1679 | unanchor() | |
1680 | Humanoid.MaxHealth = "inf" | |
1681 | Humanoid.Health = "inf" | |
1682 | if Rooted == false then | |
1683 | Disable_Jump = false | |
1684 | Humanoid.WalkSpeed = Speed | |
1685 | elseif Rooted == true then | |
1686 | Disable_Jump = true | |
1687 | Humanoid.WalkSpeed = 0 | |
1688 | end | |
1689 | sick.Parent = Torso | |
1690 | local MATHS = {"0","1"} | |
1691 | Humanoid.Name = MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)]..MATHS[MRANDOM(1,#MATHS)] | |
1692 | Humanoid.PlatformStand = false | |
1693 | end | |
1694 | ||
1695 | --//=================================\\ | |
1696 | --\\=================================// | |
1697 | ||
1698 | ||
1699 | ||
1700 | ||
1701 | ||
1702 | --//====================================================\\-- | |
1703 | --|| END OF SCRIPT | |
1704 | --\\====================================================//-- |