SHOW:
|
|
- or go back to the newest paste.
1 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
2 | local Player,game,owner = owner,game | |
3 | local RealPlayer = Player | |
4 | do | |
5 | print("FE Compatibility code by Mokiros") | |
6 | local rp = RealPlayer | |
7 | script.Parent = rp.Character | |
8 | ||
9 | --RemoteEvent for communicating | |
10 | local Event = Instance.new("RemoteEvent") | |
11 | Event.Name = "UserInput_Event" | |
12 | ||
13 | --Fake event to make stuff like Mouse.KeyDown work | |
14 | local function fakeEvent() | |
15 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end} | |
16 | t.connect = t.Connect | |
17 | return t | |
18 | end | |
19 | ||
20 | --Creating fake input objects with fake variables | |
21 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
22 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
23 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
24 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
25 | end} | |
26 | --Merged 2 functions into one by checking amount of arguments | |
27 | CAS.UnbindAction = CAS.BindAction | |
28 | ||
29 | --This function will trigger the events that have been :Connect()'ed | |
30 | local function te(self,ev,...) | |
31 | local t = m[ev] | |
32 | if t and t._fakeEvent then | |
33 | for _,f in pairs(t.Functions) do | |
34 | f(...) | |
35 | end | |
36 | end | |
37 | end | |
38 | m.TrigEvent = te | |
39 | UIS.TrigEvent = te | |
40 | ||
41 | Event.OnServerEvent:Connect(function(plr,io) | |
42 | if plr~=rp then return end | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | if not io.isMouse then | |
46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
49 | end | |
50 | for _,t in pairs(CAS.Actions) do | |
51 | for _,k in pairs(t.Keys) do | |
52 | if k==io.KeyCode then | |
53 | t.Function(t.Name,io.UserInputState,io) | |
54 | end | |
55 | end | |
56 | end | |
57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
59 | end | |
60 | end) | |
61 | Event.Parent = NLS([==[ | |
62 | local Player = game:GetService("Players").LocalPlayer | |
63 | local Event = script:WaitForChild("UserInput_Event") | |
64 | ||
65 | local Mouse = Player:GetMouse() | |
66 | local UIS = game:GetService("UserInputService") | |
67 | local input = function(io,a) | |
68 | if a then return end | |
69 | --Since InputObject is a client-side instance, we create and pass table instead | |
70 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target}) | |
71 | end | |
72 | UIS.InputBegan:Connect(input) | |
73 | UIS.InputEnded:Connect(input) | |
74 | ||
75 | local h,t | |
76 | --Give the server mouse data 30 times every second, but only if the values changed | |
77 | --If player is not moving their mouse, client won't fire events | |
78 | while wait(1/30) do | |
79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
80 | h,t=Mouse.Hit,Mouse.Target | |
81 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
82 | end | |
83 | end]==],Player.Character) | |
84 | ||
85 | ----Sandboxed game object that allows the usage of client-side methods and services | |
86 | --Real game object | |
87 | local _rg = game | |
88 | ||
89 | --Metatable for fake service | |
90 | local fsmt = { | |
91 | __index = function(self,k) | |
92 | local s = rawget(self,"_RealService") | |
93 | if s then return s[k] end | |
94 | end, | |
95 | __newindex = function(self,k,v) | |
96 | local s = rawget(self,"_RealService") | |
97 | if s then s[k]=v end | |
98 | end, | |
99 | __call = function(self,...) | |
100 | local s = rawget(self,"_RealService") | |
101 | if s then return s(...) end | |
102 | end | |
103 | } | |
104 | local function FakeService(t,RealService) | |
105 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
106 | return setmetatable(t,fsmt) | |
107 | end | |
108 | ||
109 | --Fake game object | |
110 | local g = { | |
111 | GetService = function(self,s) | |
112 | return self[s] | |
113 | end, | |
114 | Players = FakeService({ | |
115 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player) | |
116 | },"Players"), | |
117 | UserInputService = FakeService(UIS,"UserInputService"), | |
118 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
119 | } | |
120 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
121 | g.service = g.GetService | |
122 | ||
123 | g.RunService = FakeService({ | |
124 | RenderStepped = _rg:GetService("RunService").Heartbeat, | |
125 | BindToRenderStep = function(self,name,_,fun) | |
126 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
127 | end, | |
128 | UnbindFromRenderStep = function(self,name) | |
129 | self._btrs[name]:Disconnect() | |
130 | end, | |
131 | },"RunService") | |
132 | ||
133 | setmetatable(g,{ | |
134 | __index=function(self,s) | |
135 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
136 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
137 | end, | |
138 | __newindex = fsmt.__newindex, | |
139 | __call = fsmt.__call | |
140 | }) | |
141 | --Changing owner to fake player object to support owner:GetMouse() | |
142 | game,owner = g,g.Players.LocalPlayer | |
143 | end | |
144 | --//====================================================\\-- | |
145 | --|| CREATED BY SHACKLUSTER | |
146 | --\\====================================================//-- | |
147 | ||
148 | wait(0.2) | |
149 | ||
150 | Player = game:GetService("Players").LocalPlayer | |
151 | PlayerGui = Player.PlayerGui | |
152 | Cam = workspace.CurrentCamera | |
153 | Backpack = Player.Backpack | |
154 | Character = Player.Character | |
155 | Humanoid = Character.Humanoid | |
156 | Mouse = Player:GetMouse() | |
157 | RootPart = Character["HumanoidRootPart"] | |
158 | Torso = Character["Torso"] | |
159 | Head = Character["Head"] | |
160 | RightArm = Character["Right Arm"] | |
161 | LeftArm = Character["Left Arm"] | |
162 | RightLeg = Character["Right Leg"] | |
163 | LeftLeg = Character["Left Leg"] | |
164 | RootJoint = RootPart["RootJoint"] | |
165 | Neck = Torso["Neck"] | |
166 | RightShoulder = Torso["Right Shoulder"] | |
167 | LeftShoulder = Torso["Left Shoulder"] | |
168 | RightHip = Torso["Right Hip"] | |
169 | LeftHip = Torso["Left Hip"] | |
170 | ||
171 | IT = Instance.new | |
172 | CF = CFrame.new | |
173 | VT = Vector3.new | |
174 | RAD = math.rad | |
175 | C3 = Color3.new | |
176 | UD2 = UDim2.new | |
177 | BRICKC = BrickColor.new | |
178 | ANGLES = CFrame.Angles | |
179 | EULER = CFrame.fromEulerAnglesXYZ | |
180 | COS = math.cos | |
181 | ACOS = math.acos | |
182 | SIN = math.sin | |
183 | ASIN = math.asin | |
184 | ABS = math.abs | |
185 | MRANDOM = math.random | |
186 | FLOOR = math.floor | |
187 | ||
188 | --//=================================\\ | |
189 | --|| USEFUL VALUES | |
190 | --\\=================================// | |
191 | ||
192 | Animation_Speed = 3 | |
193 | Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60) | |
194 | local Speed = 10 | |
195 | local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
196 | local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
197 | local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) | |
198 | local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) | |
199 | local DAMAGEMULTIPLIER = 1 | |
200 | local ANIM = "Idle" | |
201 | local ATTACK = false | |
202 | local EQUIPPED = false | |
203 | local HOLD = false | |
204 | local COMBO = 1 | |
205 | local Rooted = false | |
206 | local SINE = 0 | |
207 | local KEYHOLD = false | |
208 | local CHANGE = 2 / Animation_Speed | |
209 | local WALKINGANIM = false | |
210 | local VALUE1 = false | |
211 | local VALUE2 = false | |
212 | local ROBLOXIDLEANIMATION = IT("Animation") | |
213 | ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation" | |
214 | ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571" | |
215 | --ROBLOXIDLEANIMATION.Parent = Humanoid | |
216 | local WEAPONGUI = IT("ScreenGui", PlayerGui) | |
217 | WEAPONGUI.Name = "Weapon GUI" | |
218 | local ANIMATOR = Humanoid.Animator | |
219 | local ANIMATE = Character.Animate | |
220 | local UNANCHOR = true | |
221 | local GHOSTS = {} | |
222 | ANIMATE:remove() | |
223 | Character.Archivable = true | |
224 | script.Parent = WEAPONGUI | |
225 | local GHOSTBASE = Character:Clone() | |
226 | GHOSTBASE.Parent = nil | |
227 | GHOSTBASE.Name = "Ghost" | |
228 | for _, c in pairs(GHOSTBASE:GetChildren()) do | |
229 | if c.ClassName == "Part" and c.Transparency < 1 then | |
230 | c.Color = C3(0,0,0) | |
231 | if c.ClassName == "Accessory" or c.ClassName == "Hat" or c.ClassName == "CharacterMesh" or c.ClassName == "Shirt" or c.ClassName == "Pants" then | |
232 | c:remove() | |
233 | end | |
234 | end | |
235 | end | |
236 | local sick = Instance.new("Sound",Torso) | |
237 | sick.SoundId = "rbxassetid://1472374501" | |
238 | sick.Looped = true | |
239 | sick.Pitch = 0.7 | |
240 | sick.Volume = 3 | |
241 | sick:Play() | |
242 | local Effects = IT("Folder", Character) | |
243 | Effects.Name = "Effects" | |
244 | Character.Archivable = false | |
245 | ||
246 | --//=================================\\ | |
247 | --\\=================================// | |
248 | ||
249 | ||
250 | --//=================================\\ | |
251 | --|| SAZERENOS' ARTIFICIAL HEARTBEAT | |
252 | --\\=================================// | |
253 | ||
254 | ArtificialHB = Instance.new("BindableEvent", script) | |
255 | ArtificialHB.Name = "ArtificialHB" | |
256 | ||
257 | script:WaitForChild("ArtificialHB") | |
258 | ||
259 | frame = Frame_Speed | |
260 | tf = 0 | |
261 | allowframeloss = false | |
262 | tossremainder = false | |
263 | lastframe = tick() | |
264 | script.ArtificialHB:Fire() | |
265 | ||
266 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
267 | tf = tf + s | |
268 | if tf >= frame then | |
269 | if allowframeloss then | |
270 | script.ArtificialHB:Fire() | |
271 | lastframe = tick() | |
272 | else | |
273 | for i = 1, math.floor(tf / frame) do | |
274 | script.ArtificialHB:Fire() | |
275 | end | |
276 | lastframe = tick() | |
277 | end | |
278 | if tossremainder then | |
279 | tf = 0 | |
280 | else | |
281 | tf = tf - frame * math.floor(tf / frame) | |
282 | end | |
283 | end | |
284 | end) | |
285 | ||
286 | --//=================================\\ | |
287 | --\\=================================// | |
288 | ||
289 | --//=================================\\ | |
290 | --|| SOME FUNCTIONS | |
291 | --\\=================================// | |
292 | ||
293 | function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS) | |
294 | return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS) | |
295 | end | |
296 | ||
297 | function PositiveAngle(NUMBER) | |
298 | if NUMBER >= 0 then | |
299 | NUMBER = 0 | |
300 | end | |
301 | return NUMBER | |
302 | end | |
303 | ||
304 | function NegativeAngle(NUMBER) | |
305 | if NUMBER <= 0 then | |
306 | NUMBER = 0 | |
307 | end | |
308 | return NUMBER | |
309 | end | |
310 | ||
311 | function Swait(NUMBER) | |
312 | if NUMBER == 0 or NUMBER == nil then | |
313 | ArtificialHB.Event:wait() | |
314 | else | |
315 | for i = 1, NUMBER do | |
316 | ArtificialHB.Event:wait() | |
317 | end | |
318 | end | |
319 | end | |
320 | ||
321 | function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET) | |
322 | local NEWMESH = IT(MESH) | |
323 | if MESH == "SpecialMesh" then | |
324 | NEWMESH.MeshType = MESHTYPE | |
325 | if MESHID ~= "nil" and MESHID ~= "" then | |
326 | NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID | |
327 | end | |
328 | if TEXTUREID ~= "nil" and TEXTUREID ~= "" then | |
329 | NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID | |
330 | end | |
331 | end | |
332 | NEWMESH.Offset = OFFSET or VT(0, 0, 0) | |
333 | NEWMESH.Scale = SCALE | |
334 | NEWMESH.Parent = PARENT | |
335 | return NEWMESH | |
336 | end | |
337 | ||
338 | function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR) | |
339 | local NEWPART = IT("Part") | |
340 | NEWPART.formFactor = FORMFACTOR | |
341 | NEWPART.Reflectance = REFLECTANCE | |
342 | NEWPART.Transparency = TRANSPARENCY | |
343 | NEWPART.CanCollide = false | |
344 | NEWPART.Locked = true | |
345 | NEWPART.Anchored = true | |
346 | if ANCHOR == false then | |
347 | NEWPART.Anchored = false | |
348 | end | |
349 | NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR)) | |
350 | NEWPART.Name = NAME | |
351 | NEWPART.Size = SIZE | |
352 | NEWPART.Position = Torso.Position | |
353 | NEWPART.Material = MATERIAL | |
354 | NEWPART:BreakJoints() | |
355 | NEWPART.Parent = PARENT | |
356 | return NEWPART | |
357 | end | |
358 | ||
359 | local function weldBetween(a, b) | |
360 | local weldd = Instance.new("ManualWeld") | |
361 | weldd.Part0 = a | |
362 | weldd.Part1 = b | |
363 | weldd.C0 = CFrame.new() | |
364 | weldd.C1 = b.CFrame:inverse() * a.CFrame | |
365 | weldd.Parent = a | |
366 | return weldd | |
367 | end | |
368 | ||
369 | ||
370 | function QuaternionFromCFrame(cf) | |
371 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
372 | local trace = m00 + m11 + m22 | |
373 | if trace > 0 then | |
374 | local s = math.sqrt(1 + trace) | |
375 | local recip = 0.5 / s | |
376 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
377 | else | |
378 | local i = 0 | |
379 | if m11 > m00 then | |
380 | i = 1 | |
381 | end | |
382 | if m22 > (i == 0 and m00 or m11) then | |
383 | i = 2 | |
384 | end | |
385 | if i == 0 then | |
386 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
387 | local recip = 0.5 / s | |
388 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
389 | elseif i == 1 then | |
390 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
391 | local recip = 0.5 / s | |
392 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
393 | elseif i == 2 then | |
394 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
395 | local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
396 | end | |
397 | end | |
398 | end | |
399 | ||
400 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
401 | local xs, ys, zs = x + x, y + y, z + z | |
402 | local wx, wy, wz = w * xs, w * ys, w * zs | |
403 | local xx = x * xs | |
404 | local xy = x * ys | |
405 | local xz = x * zs | |
406 | local yy = y * ys | |
407 | local yz = y * zs | |
408 | local zz = z * zs | |
409 | 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)) | |
410 | end | |
411 | ||
412 | function QuaternionSlerp(a, b, t) | |
413 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
414 | local startInterp, finishInterp; | |
415 | if cosTheta >= 0.0001 then | |
416 | if (1 - cosTheta) > 0.0001 then | |
417 | local theta = ACOS(cosTheta) | |
418 | local invSinTheta = 1 / SIN(theta) | |
419 | startInterp = SIN((1 - t) * theta) * invSinTheta | |
420 | finishInterp = SIN(t * theta) * invSinTheta | |
421 | else | |
422 | startInterp = 1 - t | |
423 | finishInterp = t | |
424 | end | |
425 | else | |
426 | if (1 + cosTheta) > 0.0001 then | |
427 | local theta = ACOS(-cosTheta) | |
428 | local invSinTheta = 1 / SIN(theta) | |
429 | startInterp = SIN((t - 1) * theta) * invSinTheta | |
430 | finishInterp = SIN(t * theta) * invSinTheta | |
431 | else | |
432 | startInterp = t - 1 | |
433 | finishInterp = t | |
434 | end | |
435 | end | |
436 | 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 | |
437 | end | |
438 | ||
439 | function Clerp(a, b, t) | |
440 | local qa = {QuaternionFromCFrame(a)} | |
441 | local qb = {QuaternionFromCFrame(b)} | |
442 | local ax, ay, az = a.x, a.y, a.z | |
443 | local bx, by, bz = b.x, b.y, b.z | |
444 | local _t = 1 - t | |
445 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
446 | end | |
447 | ||
448 | function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME) | |
449 | local frame = IT("Frame") | |
450 | frame.BackgroundTransparency = TRANSPARENCY | |
451 | frame.BorderSizePixel = BORDERSIZEPIXEL | |
452 | frame.Position = POSITION | |
453 | frame.Size = SIZE | |
454 | frame.BackgroundColor3 = COLOR | |
455 | frame.BorderColor3 = BORDERCOLOR | |
456 | frame.Name = NAME | |
457 | frame.Parent = PARENT | |
458 | return frame | |
459 | end | |
460 | ||
461 | function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME) | |
462 | local label = IT("TextLabel") | |
463 | label.BackgroundTransparency = 1 | |
464 | label.Size = UD2(1, 0, 1, 0) | |
465 | label.Position = UD2(0, 0, 0, 0) | |
466 | label.TextColor3 = TEXTCOLOR | |
467 | label.TextStrokeTransparency = STROKETRANSPARENCY | |
468 | label.TextTransparency = TRANSPARENCY | |
469 | label.FontSize = TEXTFONTSIZE | |
470 | label.Font = TEXTFONT | |
471 | label.BorderSizePixel = BORDERSIZEPIXEL | |
472 | label.TextScaled = false | |
473 | label.Text = TEXT | |
474 | label.Name = NAME | |
475 | label.Parent = PARENT | |
476 | return label | |
477 | end | |
478 | ||
479 | function NoOutlines(PART) | |
480 | PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10 | |
481 | end | |
482 | ||
483 | function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1) | |
484 | local NEWWELD = IT(TYPE) | |
485 | NEWWELD.Part0 = PART0 | |
486 | NEWWELD.Part1 = PART1 | |
487 | NEWWELD.C0 = C0 | |
488 | NEWWELD.C1 = C1 | |
489 | NEWWELD.Parent = PARENT | |
490 | return NEWWELD | |
491 | end | |
492 | ||
493 | local S = IT("Sound") | |
494 | function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP) | |
495 | local NEWSOUND = nil | |
496 | coroutine.resume(coroutine.create(function() | |
497 | NEWSOUND = S:Clone() | |
498 | NEWSOUND.Parent = PARENT | |
499 | NEWSOUND.Volume = VOLUME | |
500 | NEWSOUND.Pitch = PITCH | |
501 | NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID | |
502 | NEWSOUND:play() | |
503 | if DOESLOOP == true then | |
504 | NEWSOUND.Looped = true | |
505 | else | |
506 | repeat wait(1) until NEWSOUND.Playing == false | |
507 | NEWSOUND:remove() | |
508 | end | |
509 | end)) | |
510 | return NEWSOUND | |
511 | end | |
512 | ||
513 | function CFrameFromTopBack(at, top, back) | |
514 | local right = top:Cross(back) | |
515 | 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) | |
516 | end | |
517 | ||
518 | --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}) | |
519 | function WACKYEFFECT(Table) | |
520 | local TYPE = (Table.EffectType or "Sphere") | |
521 | local SIZE = (Table.Size or VT(1,1,1)) | |
522 | local ENDSIZE = (Table.Size2 or VT(0,0,0)) | |
523 | local TRANSPARENCY = (Table.Transparency or 0) | |
524 | local ENDTRANSPARENCY = (Table.Transparency2 or 1) | |
525 | local CFRAME = (Table.CFrame or Torso.CFrame) | |
526 | local MOVEDIRECTION = (Table.MoveToPos or nil) | |
527 | local ROTATION1 = (Table.RotationX or 0) | |
528 | local ROTATION2 = (Table.RotationY or 0) | |
529 | local ROTATION3 = (Table.RotationZ or 0) | |
530 | local MATERIAL = (Table.Material or "Neon") | |
531 | local COLOR = (Table.Color or C3(1,1,1)) | |
532 | local TIME = (Table.Time or 45) | |
533 | local SOUNDID = (Table.SoundID or nil) | |
534 | local SOUNDPITCH = (Table.SoundPitch or nil) | |
535 | local SOUNDVOLUME = (Table.SoundVolume or nil) | |
536 | coroutine.resume(coroutine.create(function() | |
537 | local PLAYSSOUND = false | |
538 | local SOUND = nil | |
539 | local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true) | |
540 | if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then | |
541 | PLAYSSOUND = true | |
542 | SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false) | |
543 | end | |
544 | EFFECT.Color = COLOR | |
545 | local MSH = nil | |
546 | if TYPE == "Sphere" then | |
547 | MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0)) | |
548 | elseif TYPE == "Block" then | |
549 | MSH = IT("BlockMesh",EFFECT) | |
550 | MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X) | |
551 | elseif TYPE == "Wave" then | |
552 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8)) | |
553 | elseif TYPE == "Ring" then | |
554 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0)) | |
555 | elseif TYPE == "Slash" then | |
556 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
557 | elseif TYPE == "Round Slash" then | |
558 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
559 | elseif TYPE == "Swirl" then | |
560 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0)) | |
561 | elseif TYPE == "Skull" then | |
562 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0)) | |
563 | elseif TYPE == "Crystal" then | |
564 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0)) | |
565 | end | |
566 | if MSH ~= nil then | |
567 | local MOVESPEED = nil | |
568 | if MOVEDIRECTION ~= nil then | |
569 | MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME | |
570 | end | |
571 | local GROWTH = SIZE - ENDSIZE | |
572 | local TRANS = TRANSPARENCY - ENDTRANSPARENCY | |
573 | if TYPE == "Block" then | |
574 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
575 | else | |
576 | EFFECT.CFrame = CFRAME | |
577 | end | |
578 | for LOOP = 1, TIME+1 do | |
579 | Swait() | |
580 | MSH.Scale = MSH.Scale - GROWTH/TIME | |
581 | if TYPE == "Wave" then | |
582 | MSH.Offset = VT(0,0,-MSH.Scale.X/8) | |
583 | end | |
584 | EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME | |
585 | if TYPE == "Block" then | |
586 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
587 | else | |
588 | EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3)) | |
589 | end | |
590 | if MOVEDIRECTION ~= nil then | |
591 | local ORI = EFFECT.Orientation | |
592 | EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED) | |
593 | EFFECT.Orientation = ORI | |
594 | end | |
595 | end | |
596 | if PLAYSSOUND == false then | |
597 | EFFECT:remove() | |
598 | else | |
599 | SOUND.Stopped:Connect(function() | |
600 | EFFECT:remove() | |
601 | end) | |
602 | end | |
603 | else | |
604 | if PLAYSSOUND == false then | |
605 | EFFECT:remove() | |
606 | else | |
607 | repeat Swait() until SOUND.Playing == false | |
608 | EFFECT:remove() | |
609 | end | |
610 | end | |
611 | end)) | |
612 | end | |
613 | ||
614 | function MakeForm(PART,TYPE) | |
615 | if TYPE == "Cyl" then | |
616 | local MSH = IT("CylinderMesh",PART) | |
617 | elseif TYPE == "Ball" then | |
618 | local MSH = IT("SpecialMesh",PART) | |
619 | MSH.MeshType = "Sphere" | |
620 | elseif TYPE == "Wedge" then | |
621 | local MSH = IT("SpecialMesh",PART) | |
622 | MSH.MeshType = "Wedge" | |
623 | end | |
624 | end | |
625 | ||
626 | Debris = game:GetService("Debris") | |
627 | ||
628 | function CastProperRay(StartPos, EndPos, Distance, Ignore) | |
629 | local DIRECTION = CF(StartPos,EndPos).lookVector | |
630 | return Raycast(StartPos, DIRECTION, Distance, Ignore) | |
631 | end | |
632 | ||
633 | function turnto(position) | |
634 | RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0) | |
635 | end | |
636 | ||
637 | function CreateDebreeRing(FLOOR,POSITION,SIZE,BLOCKSIZE,SWAIT) | |
638 | if FLOOR ~= nil then | |
639 | coroutine.resume(coroutine.create(function() | |
640 | local PART = CreatePart(3, Effects, "Plastic", 0, 1, "Pearl", "DebreeCenter", VT(0,0,0)) | |
641 | PART.CFrame = CF(POSITION) | |
642 | for i = 1, 45 do | |
643 | local RingPiece = CreatePart(3, Effects, "Plastic", 0, 0, "Pearl", "DebreePart", BLOCKSIZE) | |
644 | RingPiece.Material = FLOOR.Material | |
645 | RingPiece.Color = FLOOR.Color | |
646 | RingPiece.CFrame = PART.CFrame * ANGLES(RAD(0), RAD(i*8), RAD(0)) * CF(SIZE*4, 0, 0) * ANGLES(RAD(MRANDOM(-360,360)),RAD(MRANDOM(-360,360)),RAD(MRANDOM(-360,360))) | |
647 | Debris:AddItem(RingPiece,SWAIT) | |
648 | end | |
649 | PART:remove() | |
650 | end)) | |
651 | end | |
652 | end | |
653 | ||
654 | function CreateFlyingDebree(FLOOR,POSITION,AMOUNT,BLOCKSIZE,SWAIT,STRENGTH,DOES360) | |
655 | if FLOOR ~= nil then | |
656 | for i = 1, AMOUNT do | |
657 | local DEBREE = CreatePart(3, Effects, "Neon", 0, 0, "Peal", "Debree", BLOCKSIZE, false) | |
658 | DEBREE.Material = FLOOR.Material | |
659 | DEBREE.Color = FLOOR.Color | |
660 | DEBREE.CFrame = POSITION * ANGLES(RAD(MRANDOM(-360,360)),RAD(MRANDOM(-360,360)),RAD(MRANDOM(-360,360))) | |
661 | if DOES360 == true then | |
662 | DEBREE.Velocity = VT(MRANDOM(-STRENGTH,STRENGTH),MRANDOM(-STRENGTH,STRENGTH),MRANDOM(-STRENGTH,STRENGTH)) | |
663 | else | |
664 | DEBREE.Velocity = VT(MRANDOM(-STRENGTH,STRENGTH),STRENGTH,MRANDOM(-STRENGTH,STRENGTH)) | |
665 | end | |
666 | coroutine.resume(coroutine.create(function() | |
667 | Swait(15) | |
668 | DEBREE.Parent = workspace | |
669 | DEBREE.CanCollide = true | |
670 | Debris:AddItem(DEBREE,SWAIT) | |
671 | end)) | |
672 | end | |
673 | end | |
674 | end | |
675 | ||
676 | function SpawnTrail(FROM,TO) | |
677 | local TRAIL = CreatePart(3, Effects, "Neon", 0, 0.5, "Pearl", "Arrow", VT(0,0,0)) | |
678 | MakeForm(TRAIL,"Cyl") | |
679 | local DIST = (FROM - TO).Magnitude | |
680 | TRAIL.Size = VT(0.1,DIST,0.1) | |
681 | TRAIL.CFrame = CF(FROM, TO) * CF(0, 0, -DIST/2) * ANGLES(RAD(90),RAD(0),RAD(0)) | |
682 | coroutine.resume(coroutine.create(function() | |
683 | for i = 1, 5 do | |
684 | Swait() | |
685 | TRAIL.Transparency = TRAIL.Transparency + 0.1 | |
686 | end | |
687 | TRAIL:remove() | |
688 | end)) | |
689 | end | |
690 | ||
691 | local Decal = IT("Decal") | |
692 | function SpawnBulletHole(POSITION) | |
693 | local O1 = CreatePart(3, Effects, "Neon", 0, 1, "Really red", "Bullet hole", VT(0.2,0,0.2)) | |
694 | local decal = Decal:Clone() | |
695 | decal.Parent = O1 | |
696 | decal.Face = "Top" | |
697 | decal.Texture = "http://www.roblox.com/asset/?id=130624105" | |
698 | local decal2 = Decal:Clone() | |
699 | decal2.Parent = O1 | |
700 | decal2.Face = "Bottom" | |
701 | decal2.Texture = "http://www.roblox.com/asset/?id=130624105" | |
702 | O1.CFrame = POSITION*ANGLES(RAD(0),RAD(MRANDOM(-180,180)),RAD(0)) | |
703 | Debris:AddItem(O1,5) | |
704 | end | |
705 | ||
706 | local asd = Instance.new("ParticleEmitter") | |
707 | asd.Color = ColorSequence.new(Color3.new(1, 0, 0), Color3.new(.5, 0, 0)) | |
708 | asd.LightEmission = .1 | |
709 | asd.Texture = "http://www.roblox.com/asset/?ID=291880914" | |
710 | aaa = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2),NumberSequenceKeypoint.new(1, 2)}) | |
711 | bbb = NumberSequence.new({NumberSequenceKeypoint.new(0, 1),NumberSequenceKeypoint.new(0.0636, 0), NumberSequenceKeypoint.new(1, 1)}) | |
712 | asd.Transparency = bbb | |
713 | asd.Size = aaa | |
714 | asd.ZOffset = .9 | |
715 | asd.Acceleration = Vector3.new(0, -15, 0) | |
716 | asd.LockedToPart = false | |
717 | asd.EmissionDirection = "Back" | |
718 | asd.Lifetime = NumberRange.new(1, 2) | |
719 | asd.Rotation = NumberRange.new(-100, 100) | |
720 | asd.RotSpeed = NumberRange.new(-100, 100) | |
721 | asd.Speed = NumberRange.new(10) | |
722 | asd.Enabled = false | |
723 | asd.VelocitySpread = 999 | |
724 | ||
725 | function getbloody(victim,amount) | |
726 | local PART = IT("Part",Effects) | |
727 | PART.Transparency = 1 | |
728 | PART.Size = victim.Size | |
729 | PART.Anchored = true | |
730 | PART.CanCollide = false | |
731 | PART.CFrame = CF(victim.Position) | |
732 | local HITPLAYERSOUNDS = {"356551938","264486467"} | |
733 | Debris:AddItem(PART,5) | |
734 | CreateSound(HITPLAYERSOUNDS[MRANDOM(1, #HITPLAYERSOUNDS)], PART, 1, (math.random(8,12)/10)) | |
735 | CreateSound(HITPLAYERSOUNDS[MRANDOM(1, #HITPLAYERSOUNDS)], PART, 1, (math.random(8,12)/10)) | |
736 | CreateSound(HITPLAYERSOUNDS[MRANDOM(1, #HITPLAYERSOUNDS)], PART, 1, (math.random(8,12)/10)) | |
737 | local prtcl = asd:Clone() | |
738 | prtcl.Parent = PART | |
739 | prtcl:Emit(amount*10) | |
740 | end | |
741 | ||
742 | function BulletDetection(FROM,TO) | |
743 | local AIMHIT,AIMPOS,NORMAL = CastProperRay(FROM,TO,2000,Character) | |
744 | coroutine.resume(coroutine.create(function() | |
745 | if AIMHIT ~= nil then | |
746 | if AIMHIT.Parent ~= Character then | |
747 | if AIMHIT.Parent:FindFirstChildOfClass("Humanoid") or AIMHIT.Parent.Parent:FindFirstChildOfClass("Humanoid") then | |
748 | if AIMHIT.Name ~= "Head" and AIMHIT.Parent.ClassName ~= "Accessory" then | |
749 | ApplyDamage(AIMHIT.Parent:FindFirstChildOfClass("Humanoid"),MRANDOM(15,25),AIMHIT) | |
750 | elseif AIMHIT.Name == "Head" or AIMHIT.Parent.ClassName == "Accessory" then | |
751 | if AIMHIT.Parent.ClassName == "Accessory" then | |
752 | if AIMHIT:FindFirstChild("HatAttachment") or AIMHIT:FindFirstChild("FaceFrontAttachment") or AIMHIT:FindFirstChild("HairAttachment") then | |
753 | AIMHIT.Parent.Parent:BreakJoints() | |
754 | if AIMHIT.Parent.Parent:FindFirstChild("Head") then | |
755 | getbloody(AIMHIT.Parent.Parent.Head,15) | |
756 | AIMHIT.Parent.Parent.Head:remove() | |
757 | StatLabel(AIMHIT.CFrame * CF(0, 0 + (AIMHIT.Size.z - 1), 0), "Headshot!", C3(1,0,0)) | |
758 | end | |
759 | else | |
760 | ApplyDamage(AIMHIT.Parent.Parent:FindFirstChildOfClass("Humanoid"),MRANDOM(25,65),AIMHIT) | |
761 | end | |
762 | elseif AIMHIT.Name == "Head" then | |
763 | getbloody(AIMHIT,15) | |
764 | AIMHIT.Parent:BreakJoints() | |
765 | AIMHIT:remove() | |
766 | StatLabel(AIMHIT.CFrame * CF(0, 0 + (AIMHIT.Size.z - 1), 0), "Headshot!", C3(1,0,0)) | |
767 | end | |
768 | end | |
769 | else | |
770 | CreateFlyingDebree(AIMHIT,CF(AIMPOS),7,VT(0.1,0.1,0.1),5,35,true) | |
771 | SpawnBulletHole(CF(AIMPOS,AIMPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0))) | |
772 | end | |
773 | end | |
774 | end | |
775 | end)) | |
776 | return AIMHIT,AIMPOS,NORMAL | |
777 | end | |
778 | ||
779 | --//=================================\\ | |
780 | --|| WEAPON CREATION | |
781 | --\\=================================// | |
782 | ||
783 | for i = 1, 35 do | |
784 | local FACE = CreatePart(3, Character, "Fabric", 0, 0+(i-1)/35.2, "Dark stone grey", "FaceGradient", VT(1.01,0.5,1.01),false) | |
785 | FACE.Color = C3(0,0,0) | |
786 | Head:FindFirstChildOfClass("SpecialMesh"):Clone().Parent = FACE | |
787 | CreateWeldOrSnapOrMotor("Weld", Head, Head, FACE, CF(0,0.35-(i-1)/75,0), CF(0, 0, 0)) | |
788 | end | |
789 | local EYE = CreatePart(3, Character, "Neon", 0, 0, "Really red", "Eyeball", VT(0.15,0.15,0.15),false) | |
790 | MakeForm(EYE,"Ball") | |
791 | CreateWeldOrSnapOrMotor("Weld", Head, Head, EYE, CF(0.15,0.26,-0.55), CF(0, 0, 0)) | |
792 | local EYE2 = CreatePart(3, Character, "Neon", 0, 0, "Really red", "Eyeball", VT(0.15,0.15,0.15),false) | |
793 | MakeForm(EYE2,"Ball") | |
794 | CreateWeldOrSnapOrMotor("Weld", Head, Head, EYE2, CF(-0.15,0.26,-0.55), CF(0, 0, 0)) | |
795 | local Gun = CreatePart(3, Character, "SmoothPlastic", 0, 0, "Really black", "Gun", VT(0, 0, 0),false) | |
796 | local HandleMesh = CreateMesh("SpecialMesh", Gun, "FileMesh", "468351345", "468351348", VT(0.06,0.06,0.06), VT(0,0, 0)) | |
797 | local Weld = CreateWeldOrSnapOrMotor("Weld", Gun, RightArm, Gun, CF(0, -1.8, -0.2) * ANGLES(RAD(0), RAD(90), RAD(-90)), CF(0, 0, 0)) | |
798 | ||
799 | local BODY = {} | |
800 | ||
801 | for _, c in pairs(Character:GetDescendants()) do | |
802 | if c:IsA("BasePart") and c.Name ~= "Handle" then | |
803 | if c ~= RootPart and c ~= Torso and c ~= Head and c ~= RightArm and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then | |
804 | c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0) | |
805 | end | |
806 | table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency}) | |
807 | elseif c:IsA("JointInstance") then | |
808 | table.insert(BODY,{c,c.Parent,nil,nil,nil}) | |
809 | end | |
810 | end | |
811 | ||
812 | for e = 1, #BODY do | |
813 | if BODY[e] ~= nil then | |
814 | local STUFF = BODY[e] | |
815 | local PART = STUFF[1] | |
816 | local PARENT = STUFF[2] | |
817 | local MATERIAL = STUFF[3] | |
818 | local COLOR = STUFF[4] | |
819 | local TRANSPARENCY = STUFF[5] | |
820 | if PART.ClassName == "Part" and PART ~= RootPart then | |
821 | PART.Material = MATERIAL | |
822 | PART.Color = COLOR | |
823 | PART.Transparency = TRANSPARENCY | |
824 | end | |
825 | PART.AncestryChanged:Connect(function() | |
826 | PART.Parent = PARENT | |
827 | end) | |
828 | end | |
829 | end | |
830 | ||
831 | function refit() | |
832 | Character.Parent = workspace | |
833 | for e = 1, #BODY do | |
834 | if BODY[e] ~= nil then | |
835 | local STUFF = BODY[e] | |
836 | local PART = STUFF[1] | |
837 | local PARENT = STUFF[2] | |
838 | local MATERIAL = STUFF[3] | |
839 | local COLOR = STUFF[4] | |
840 | local TRANSPARENCY = STUFF[5] | |
841 | if PART.ClassName == "Part" and PART ~= RootPart then | |
842 | PART.Material = MATERIAL | |
843 | PART.Color = COLOR | |
844 | PART.Transparency = TRANSPARENCY | |
845 | end | |
846 | if PART.Parent ~= PARENT then | |
847 | Humanoid:remove() | |
848 | PART.Parent = PARENT | |
849 | Humanoid = IT("Humanoid",Character) | |
850 | end | |
851 | end | |
852 | end | |
853 | end | |
854 | ||
855 | local SKILLTEXTCOLOR = C3(0,0,0) | |
856 | local SKILLFONT = "SciFi" | |
857 | local SKILLTEXTSIZE = 7 | |
858 | ||
859 | Humanoid.Died:connect(function() | |
860 | refit() | |
861 | end) | |
862 | ||
863 | function Blink() | |
864 | coroutine.resume(coroutine.create(function() | |
865 | if EYE ~= nil then | |
866 | for i = 1, 5 do | |
867 | Swait() | |
868 | EYE.Mesh.Scale = EYE.Mesh.Scale - VT(0,0.2,0) | |
869 | EYE2.Mesh.Scale = EYE.Mesh.Scale | |
870 | end | |
871 | for i = 1, 7 do | |
872 | Swait() | |
873 | EYE.Mesh.Scale = EYE.Mesh.Scale + VT(0,0.2,0) | |
874 | EYE2.Mesh.Scale = EYE.Mesh.Scale | |
875 | end | |
876 | EYE.Mesh.Scale = VT(1,1,1) | |
877 | EYE2.Mesh.Scale = EYE.Mesh.Scale | |
878 | end | |
879 | end)) | |
880 | end | |
881 | ||
882 | local AMMO1FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.23, 0, 0.80, 0), UD2(0.07, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Ammo 1 Frame") | |
883 | local AMMO2FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.50, 0, 0.80, 0), UD2(0.07, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Ammo 2 Frame") | |
884 | local SKILL1FRAME = CreateFrame(WEAPONGUI, 0.75, 2, UD2(0.23, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 1 Frame") | |
885 | local SKILL2FRAME = CreateFrame(WEAPONGUI, 0.75, 2, UD2(0.50, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 2 Frame") | |
886 | ||
887 | local SKILL3TEXT = CreateLabel(SKILL1FRAME, "[Q] Shell", C3(0,0,0), 7, SKILLFONT, 0, 2, 1, "Text 3") | |
888 | local SKILL4TEXT = CreateLabel(SKILL2FRAME, "[E] Sinful Shell", C3(1,0,0), 8, "Antique", 0, 2, 1, "Text 4") | |
889 | ||
890 | local AMMOIMAGE1 = IT("ImageLabel",AMMO1FRAME) | |
891 | AMMOIMAGE1.Size = UD2(1,0,1,0) | |
892 | AMMOIMAGE1.BackgroundTransparency = 1 | |
893 | AMMOIMAGE1.BorderSizePixel = 0 | |
894 | AMMOIMAGE1.Image = "http://www.roblox.com/asset/?id=1493961907" | |
895 | local AMMOIMAGE2 = IT("ImageLabel",AMMO2FRAME) | |
896 | AMMOIMAGE2.Size = UD2(1,0,1,0) | |
897 | AMMOIMAGE2.BackgroundTransparency = 1 | |
898 | AMMOIMAGE2.BorderSizePixel = 0 | |
899 | AMMOIMAGE2.Image = "http://www.roblox.com/asset/?id=1493962162" | |
900 | ||
901 | --//=================================\\ | |
902 | --|| DAMAGE FUNCTIONS | |
903 | --\\=================================// | |
904 | ||
905 | function StatLabel(CFRAME, TEXT, COLOR) | |
906 | local STATPART = CreatePart(3, Effects, "SmoothPlastic", 0, 1, "Really black", "Effect", VT()) | |
907 | STATPART.CFrame = CF(CFRAME.p,CFRAME.p+VT(MRANDOM(-5,5),MRANDOM(0,5),MRANDOM(-5,5))) | |
908 | local BODYGYRO = IT("BodyGyro", STATPART) | |
909 | game:GetService("Debris"):AddItem(STATPART ,5) | |
910 | local BILLBOARDGUI = Instance.new("BillboardGui", STATPART) | |
911 | BILLBOARDGUI.Adornee = STATPART | |
912 | BILLBOARDGUI.Size = UD2(2.5, 0, 2.5 ,0) | |
913 | BILLBOARDGUI.StudsOffset = VT(-2, 2, 0) | |
914 | BILLBOARDGUI.AlwaysOnTop = false | |
915 | local TEXTLABEL = Instance.new("TextLabel", BILLBOARDGUI) | |
916 | TEXTLABEL.BackgroundTransparency = 1 | |
917 | TEXTLABEL.Size = UD2(2.5, 0, 2.5, 0) | |
918 | TEXTLABEL.Text = TEXT | |
919 | TEXTLABEL.Font = SKILLFONT | |
920 | TEXTLABEL.FontSize="Size42" | |
921 | TEXTLABEL.TextColor3 = COLOR | |
922 | TEXTLABEL.TextStrokeTransparency = 0 | |
923 | TEXTLABEL.TextScaled = true | |
924 | TEXTLABEL.TextWrapped = true | |
925 | coroutine.resume(coroutine.create(function(THEPART, THEBODYPOSITION, THETEXTLABEL) | |
926 | for i = 1, 10 do | |
927 | Swait() | |
928 | STATPART.CFrame = STATPART.CFrame * CF(0,0,-0.2) | |
929 | TEXTLABEL.TextTransparency = TEXTLABEL.TextTransparency + (1/10) | |
930 | TEXTLABEL.TextStrokeTransparency = TEXTLABEL.TextTransparency | |
931 | end | |
932 | THEPART.Parent = nil | |
933 | end),STATPART, TEXTLABEL) | |
934 | end | |
935 | ||
936 | --//=================================\\ | |
937 | --|| DAMAGING | |
938 | --\\=================================// | |
939 | ||
940 | function ApplyDamage(Humanoid,Damage,TorsoPart) | |
941 | local defence = Instance.new("BoolValue",Humanoid.Parent) | |
942 | defence.Name = ("HitBy"..Player.Name) | |
943 | game:GetService("Debris"):AddItem(defence, 0.001) | |
944 | Damage = Damage * DAMAGEMULTIPLIER | |
945 | if Humanoid.Health ~= 0 then | |
946 | local CritChance = MRANDOM(1,100) | |
947 | if Damage > Humanoid.Health then | |
948 | Damage = math.ceil(Humanoid.Health) | |
949 | if Damage == 0 then | |
950 | Damage = 0.1 | |
951 | end | |
952 | end | |
953 | Humanoid.Health = Humanoid.Health - Damage | |
954 | StatLabel(TorsoPart.CFrame * CF(0, 0 + (TorsoPart.Size.z - 1), 0), Damage, C3(0, 0, 0)) | |
955 | end | |
956 | end | |
957 | ||
958 | function Ghostify(POSITION,RANGE) | |
959 | local CHILDREN = workspace:GetDescendants() | |
960 | for index, CHILD in pairs(CHILDREN) do | |
961 | if CHILD.ClassName == "Model" and CHILD ~= Character and CHILD.Parent ~= Effects then | |
962 | local HUM = CHILD:FindFirstChildOfClass("Humanoid") | |
963 | if HUM then | |
964 | local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso") | |
965 | if TORSO then | |
966 | if HUM.Health > 0 and (TORSO.Position - POSITION).Magnitude <= RANGE then | |
967 | local GHOST = GHOSTBASE:Clone() | |
968 | GHOST.Parent = Effects | |
969 | GHOST.Torso.CFrame = TORSO.CFrame | |
970 | table.insert(GHOSTS,GHOST) | |
971 | CHILD:remove() | |
972 | end | |
973 | end | |
974 | end | |
975 | end | |
976 | end | |
977 | end | |
978 | ||
979 | --//=================================\\ | |
980 | --|| ATTACK FUNCTIONS AND STUFF | |
981 | --\\=================================// | |
982 | ||
983 | function Shell() | |
984 | ATTACK = true | |
985 | Rooted = false | |
986 | local GYRO = IT("BodyGyro",RootPart) | |
987 | GYRO.D = 750 | |
988 | GYRO.P = 20000 | |
989 | GYRO.MaxTorque = VT(0,40000000,0) | |
990 | for i=0, 1, 0.1 / Animation_Speed do | |
991 | Swait() | |
992 | GYRO.cframe = CF(RootPart.Position,Mouse.Hit.p) | |
993 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(25), RAD(0), RAD(35)), 0.75 / Animation_Speed) | |
994 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(25 - 0.5 * SIN(SINE / 12)), RAD(15), RAD(-35)), 0.75 / Animation_Speed) | |
995 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.7 - 0.1 * COS(SINE / 12), 0) * ANGLES(RAD(115), RAD(0), RAD(35)) * ANGLES(RAD(0), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 0.75 / Animation_Speed) | |
996 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.45, -0.1) * ANGLES(RAD(25), RAD(0), RAD(5)) * LEFTSHOULDERC0, 0.75 / Animation_Speed) | |
997 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.8 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(50), RAD(0)) * ANGLES(RAD(-35), RAD(0), RAD(35)), 0.75 / Animation_Speed) | |
998 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1.3 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(5), RAD(0), RAD(-25)), 0.75 / Animation_Speed) | |
999 | end | |
1000 | GYRO:remove() | |
1001 | CreateSound(696483710, Gun, 5, 1, false) | |
1002 | local AIMHIT,AIMPOS,NORMAL = BulletDetection(Gun.Position,Mouse.Hit.p) | |
1003 | SpawnTrail(Gun.CFrame*CF(1.5,0.5,0).p,AIMPOS) | |
1004 | WACKYEFFECT({Time = 3, EffectType = "Sphere", Size = VT(1,0.3,0.3), Size2 = VT(1,0,0), Transparency = 0, Transparency2 = 1, CFrame = Gun.CFrame*CF(1.5,0.5,0), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil}) | |
1005 | for i=0, 0.3, 0.1 / Animation_Speed do | |
1006 | Swait() | |
1007 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(25), RAD(0), RAD(35)), 0.75 / Animation_Speed) | |
1008 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(25 - 0.5 * SIN(SINE / 12)), RAD(15), RAD(-35)), 0.75 / Animation_Speed) | |
1009 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.7 - 0.1 * COS(SINE / 12), 0.3) * ANGLES(RAD(110), RAD(0), RAD(35)) * ANGLES(RAD(0), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 0.75 / Animation_Speed) | |
1010 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.45, -0.1) * ANGLES(RAD(25), RAD(0), RAD(5)) * LEFTSHOULDERC0, 0.75 / Animation_Speed) | |
1011 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.8 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(50), RAD(0)) * ANGLES(RAD(-35), RAD(0), RAD(35)), 0.75 / Animation_Speed) | |
1012 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1.3 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(5), RAD(0), RAD(-25)), 0.75 / Animation_Speed) | |
1013 | end | |
1014 | ATTACK = false | |
1015 | Rooted = false | |
1016 | end | |
1017 | ||
1018 | function SinfulShell() | |
1019 | ATTACK = true | |
1020 | Rooted = false | |
1021 | local GYRO = IT("BodyGyro",RootPart) | |
1022 | GYRO.D = 750 | |
1023 | GYRO.P = 20000 | |
1024 | GYRO.MaxTorque = VT(0,40000000,0) | |
1025 | for i=0, 1, 0.1 / Animation_Speed do | |
1026 | Swait() | |
1027 | GYRO.cframe = CF(RootPart.Position,Mouse.Hit.p) | |
1028 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(25), RAD(0), RAD(35)), 0.75 / Animation_Speed) | |
1029 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(25 - 0.5 * SIN(SINE / 12)), RAD(15), RAD(-35)), 0.75 / Animation_Speed) | |
1030 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.7 - 0.1 * COS(SINE / 12), 0) * ANGLES(RAD(115), RAD(0), RAD(35)) * ANGLES(RAD(0), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 0.75 / Animation_Speed) | |
1031 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.45, -0.1) * ANGLES(RAD(25), RAD(0), RAD(5)) * LEFTSHOULDERC0, 0.75 / Animation_Speed) | |
1032 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.8 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(50), RAD(0)) * ANGLES(RAD(-35), RAD(0), RAD(35)), 0.75 / Animation_Speed) | |
1033 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1.3 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(5), RAD(0), RAD(-25)), 0.75 / Animation_Speed) | |
1034 | end | |
1035 | GYRO:remove() | |
1036 | CreateSound(696483710, Gun, 5, 1, false) | |
1037 | WACKYEFFECT({Time = 3, EffectType = "Sphere", Size = VT(1,0.3,0.3), Size2 = VT(1,0,0), Transparency = 0, Transparency2 = 1, CFrame = Gun.CFrame*CF(1.5,0.5,0), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,0,0), SoundID = nil, SoundPitch = nil, SoundVolume = nil}) | |
1038 | coroutine.resume(coroutine.create(function() | |
1039 | local Bullet = CreatePart(3, Effects, "SmoothPlastic", 0, 0, "Really red", "Sinful bullet", VT(0,0,0)) | |
1040 | CreateMesh("SpecialMesh", Bullet, "FileMesh", "94295100", "", VT(6, 6, 7), VT(0,0, 0)) | |
1041 | Bullet.CFrame = Gun.CFrame*CF(1.5,0.5,0) | |
1042 | local AIMPOINT = Mouse.Hit.p | |
1043 | local STARTPOS = Gun.CFrame*CF(1.5,0.5,0).p | |
1044 | local VECTOR = CF(STARTPOS,AIMPOINT) | |
1045 | local IMPACTED = false | |
1046 | CreateSound(1393698948, Bullet, 10, 1, true) | |
1047 | for E = 1, 50 do | |
1048 | if IMPACTED == true then | |
1049 | break | |
1050 | end | |
1051 | local TARGETPOINT = VECTOR*CF(0,0,-E*5)*ANGLES(RAD(0),RAD(0),RAD(MRANDOM(0,360)))*CF(0,1,0).p | |
1052 | Bullet.CFrame = CF(Bullet.Position,TARGETPOINT) | |
1053 | for i = 1, 5 do | |
1054 | Swait() | |
1055 | WACKYEFFECT({Time = 15, EffectType = "Swirl", Size = VT(1,1,1), Size2 = VT(3,3,3), Transparency = 0, Transparency2 = 1, CFrame = Bullet.CFrame * ANGLES(RAD(90), RAD(0), RAD(0)), MoveToPos = nil, RotationX = 0, RotationY = i+E, RotationZ = 0, Material = "Neon", Color = C3(1,0,0), SoundID = nil, SoundPitch = 1, SoundVolume = 5}) | |
1056 | Bullet.CFrame = Bullet.CFrame*CF(0,0,-1) | |
1057 | local AIMHIT,AIMPOS,NORMAL = Raycast(Bullet.Position,Bullet.CFrame.lookVector,1.3,Character) | |
1058 | if AIMHIT ~= nil then | |
1059 | IMPACTED = true | |
1060 | break | |
1061 | end | |
1062 | end | |
1063 | end | |
1064 | WACKYEFFECT({Time = 25, EffectType = "Sphere", Size = VT(10,10,10), Size2 = VT(9,9,9), Transparency = 0, Transparency2 = 1, CFrame = Bullet.CFrame, MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,0,0), SoundID = 182765513, SoundPitch = MRANDOM(8,12)/10, SoundVolume = 7}) | |
1065 | for i = 1, 7 do | |
1066 | WACKYEFFECT({Time = 25, EffectType = "Sphere", Size = VT(1,15,1), Size2 = VT(0,25,0), Transparency = 0, Transparency2 = 1, CFrame = Bullet.CFrame*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,0,0), SoundID = nil, SoundPitch = nil, SoundVolume = nil}) | |
1067 | end | |
1068 | Ghostify(Bullet.Position,10) | |
1069 | Bullet:remove() | |
1070 | end)) | |
1071 | for i=0, 0.3, 0.1 / Animation_Speed do | |
1072 | Swait() | |
1073 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(25), RAD(0), RAD(35)), 0.75 / Animation_Speed) | |
1074 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(25 - 0.5 * SIN(SINE / 12)), RAD(15), RAD(-35)), 0.75 / Animation_Speed) | |
1075 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.7 - 0.1 * COS(SINE / 12), 0.3) * ANGLES(RAD(110), RAD(0), RAD(35)) * ANGLES(RAD(0), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 0.75 / Animation_Speed) | |
1076 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.45, -0.1) * ANGLES(RAD(25), RAD(0), RAD(5)) * LEFTSHOULDERC0, 0.75 / Animation_Speed) | |
1077 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.8 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(50), RAD(0)) * ANGLES(RAD(-35), RAD(0), RAD(35)), 0.75 / Animation_Speed) | |
1078 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1.3 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(5), RAD(0), RAD(-25)), 0.75 / Animation_Speed) | |
1079 | end | |
1080 | ATTACK = false | |
1081 | Rooted = false | |
1082 | end | |
1083 | ||
1084 | --//=================================\\ | |
1085 | --|| ASSIGN THINGS TO KEYS | |
1086 | --\\=================================// | |
1087 | ||
1088 | function MouseDown(Mouse) | |
1089 | if ATTACK == false then | |
1090 | end | |
1091 | end | |
1092 | ||
1093 | function MouseUp(Mouse) | |
1094 | HOLD = false | |
1095 | end | |
1096 | ||
1097 | function KeyDown(Key) | |
1098 | KEYHOLD = true | |
1099 | if Key == "q" and ATTACK == false then | |
1100 | Shell() | |
1101 | end | |
1102 | ||
1103 | if Key == "e" and ATTACK == false then | |
1104 | SinfulShell() | |
1105 | end | |
1106 | end | |
1107 | ||
1108 | function KeyUp(Key) | |
1109 | KEYHOLD = false | |
1110 | end | |
1111 | ||
1112 | Mouse.Button1Down:connect(function(NEWKEY) | |
1113 | MouseDown(NEWKEY) | |
1114 | end) | |
1115 | Mouse.Button1Up:connect(function(NEWKEY) | |
1116 | MouseUp(NEWKEY) | |
1117 | end) | |
1118 | Mouse.KeyDown:connect(function(NEWKEY) | |
1119 | KeyDown(NEWKEY) | |
1120 | end) | |
1121 | Mouse.KeyUp:connect(function(NEWKEY) | |
1122 | KeyUp(NEWKEY) | |
1123 | end) | |
1124 | ||
1125 | --//=================================\\ | |
1126 | --\\=================================// | |
1127 | ||
1128 | ||
1129 | function unanchor() | |
1130 | if UNANCHOR == true then | |
1131 | g = Character:GetChildren() | |
1132 | for i = 1, #g do | |
1133 | if g[i].ClassName == "Part" then | |
1134 | g[i].Anchored = false | |
1135 | end | |
1136 | end | |
1137 | end | |
1138 | end | |
1139 | ||
1140 | ||
1141 | --//=================================\\ | |
1142 | --|| WRAP THE WHOLE SCRIPT UP | |
1143 | --\\=================================// | |
1144 | ||
1145 | Humanoid.Changed:connect(function(Jump) | |
1146 | if Jump == "Jump" and (Disable_Jump == true) then | |
1147 | Humanoid.Jump = false | |
1148 | end | |
1149 | end) | |
1150 | ||
1151 | local BLINKLOOP = 0 | |
1152 | ||
1153 | while true do | |
1154 | Swait() | |
1155 | script.Parent = WEAPONGUI | |
1156 | ANIMATE.Parent = nil | |
1157 | Humanoid.Parent = Character | |
1158 | if Humanoid then | |
1159 | local IDLEANIMATION = Humanoid:LoadAnimation(ROBLOXIDLEANIMATION) | |
1160 | IDLEANIMATION:Play() | |
1161 | end | |
1162 | SINE = SINE + CHANGE | |
1163 | local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude | |
1164 | local TORSOVERTICALVELOCITY = RootPart.Velocity.y | |
1165 | local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character) | |
1166 | local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16) | |
1167 | if ANIM == "Walk" and TORSOVELOCITY > 1 then | |
1168 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, -0.15 * COS(SINE / (WALKSPEEDVALUE / 2))) * ANGLES(RAD(0), RAD(0) - RootPart.RotVelocity.Y / 75, RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1169 | Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * 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) | |
1170 | RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ 0.2 * COS(SINE / WALKSPEEDVALUE)) * 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) | |
1171 | LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ -0.2 * COS(SINE / WALKSPEEDVALUE)) * 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) | |
1172 | elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then | |
1173 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1174 | Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1175 | RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1176 | LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1177 | end | |
1178 | if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then | |
1179 | ANIM = "Jump" | |
1180 | if ATTACK == false then | |
1181 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1182 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1183 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(20)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
1184 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
1185 | 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) | |
1186 | 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) | |
1187 | end | |
1188 | elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then | |
1189 | ANIM = "Fall" | |
1190 | if ATTACK == false then | |
1191 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1192 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1193 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(60)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
1194 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-60)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
1195 | 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) | |
1196 | 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) | |
1197 | end | |
1198 | elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then | |
1199 | ANIM = "Idle" | |
1200 | if ATTACK == false then | |
1201 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(25), RAD(0), RAD(15)), 0.15 / Animation_Speed) | |
1202 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(25 - 0.5 * SIN(SINE / 12)), RAD(0), RAD(-15)), 0.15 / Animation_Speed) | |
1203 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.7 - 0.1 * COS(SINE / 12), 0) * ANGLES(RAD(25), RAD(0), RAD(12)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed) | |
1204 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.45, -0.1) * ANGLES(RAD(25), RAD(0), RAD(5)) * LEFTSHOULDERC0, 0.15 / Animation_Speed) | |
1205 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(-15), RAD(0), RAD(45)), 0.15 / Animation_Speed) | |
1206 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(-15)), 0.15 / Animation_Speed) | |
1207 | end | |
1208 | elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then | |
1209 | ANIM = "Walk" | |
1210 | if ATTACK == false then | |
1211 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.2) * ANGLES(RAD(30), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1212 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 - 3 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1213 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.7 - 0.1 * COS(SINE / 12), 0) * ANGLES(RAD(30), RAD(0), RAD(5)) * RIGHTSHOULDERC0, 0.35 / Animation_Speed) | |
1214 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(30-60 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(-5)) * LEFTSHOULDERC0, 0.35 / Animation_Speed) | |
1215 | RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(30), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 2 / Animation_Speed) | |
1216 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(30), RAD(-75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(15)), 2 / Animation_Speed) | |
1217 | end | |
1218 | end | |
1219 | unanchor() | |
1220 | Humanoid.MaxHealth = "inf" | |
1221 | Humanoid.Health = "inf" | |
1222 | if Rooted == false then | |
1223 | Disable_Jump = false | |
1224 | Humanoid.WalkSpeed = Speed | |
1225 | elseif Rooted == true then | |
1226 | Disable_Jump = true | |
1227 | Humanoid.WalkSpeed = 0 | |
1228 | end | |
1229 | sick.SoundId = "rbxassetid://1472374501" | |
1230 | sick.Looped = true | |
1231 | sick.Pitch = 0.7 | |
1232 | sick.Volume = 3 | |
1233 | sick.Playing = true | |
1234 | sick.Parent = Torso | |
1235 | if Head:FindFirstChild("face") then | |
1236 | Head.face.Texture = "rbxassetid://403870689" | |
1237 | end | |
1238 | BLINKLOOP = BLINKLOOP + 1 | |
1239 | if BLINKLOOP >=650 then | |
1240 | BLINKLOOP = 0 | |
1241 | Blink() | |
1242 | end | |
1243 | if #GHOSTS>0 then | |
1244 | for e=1,#GHOSTS do | |
1245 | if GHOSTS[e]~=nil then | |
1246 | local Thing=GHOSTS[e] | |
1247 | if Thing~=nil then | |
1248 | if Thing:FindFirstChild("Head") then | |
1249 | if Thing:FindFirstChild("Head"):FindFirstChild("face") then | |
1250 | Thing:FindFirstChild("Head").face.Texture = "rbxassetid://479674570" | |
1251 | end | |
1252 | if Thing:FindFirstChild("Head"):FindFirstChildOfClass("Sound") then | |
1253 | Thing:FindFirstChild("Head"):FindFirstChildOfClass("Sound"):remove() | |
1254 | end | |
1255 | end | |
1256 | local TORSO = Thing:FindFirstChild("Torso") | |
1257 | if TORSO then | |
1258 | TORSO.Anchored = false | |
1259 | local ROOT = Thing.HumanoidRootPart | |
1260 | local RootJoint1 = ROOT:FindFirstChild("RootJoint") | |
1261 | local Neck1 = TORSO:FindFirstChild("Neck") | |
1262 | local RightShoulder1 = TORSO:FindFirstChild("Right Shoulder") | |
1263 | local LeftShoulder1 = TORSO:FindFirstChild("Left Shoulder") | |
1264 | local RightHip1 = TORSO:FindFirstChild("Right Hip") | |
1265 | local LeftHip1 = TORSO:FindFirstChild("Left Hip") | |
1266 | if ROOT and RootJoint1 then | |
1267 | local VELOCITY = (ROOT.Velocity * VT(1, 0, 1)).magnitude | |
1268 | if VELOCITY < 1 then | |
1269 | RootJoint1.C0 = ROOTC0 * CF(0, 0, 0 + 0.15 * COS(SINE / 12)) * ANGLES(RAD(4 + 2.5 * SIN(SINE / 12)), RAD(0), RAD(2.5 * SIN(SINE / 12))) | |
1270 | Neck1.C0 = NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 + 4.5 * SIN(SINE / 12)), RAD(0), RAD( - 2.5 * SIN(SINE / 12))) | |
1271 | RightShoulder1.C0 = CF(1.5, 0.5 + 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(0 - 2.5 * SIN(SINE / 12)), RAD(5 + 1.5 * SIN(SINE / 12))) * RIGHTSHOULDERC0 | |
1272 | LeftShoulder1.C0 = CF(-1.5, 0.5 + 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(0 + 2.5 * SIN(SINE / 12)), RAD(-5 - 1.5 * SIN(SINE / 12))) * LEFTSHOULDERC0 | |
1273 | RightHip1.C0 = CF(1, -1, -0.01) * ANGLES(RAD(-2.5 * SIN(SINE / 12)), RAD(75), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)) | |
1274 | LeftHip1.C0 = CF(-1, -0.5, -0.5) * ANGLES(RAD(-2.5 * SIN(SINE / 12)), RAD(-90), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)) | |
1275 | elseif VELOCITY > 1 then | |
1276 | RootJoint1.C0 = ROOTC0 * CF(0, 0, 0 + 0.15 * COS(SINE / 12)) * ANGLES(RAD(25 + 2.5 * SIN(SINE / 12)), RAD(0), RAD(2.5 * SIN(SINE / 12))) | |
1277 | Neck1.C0 = NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-25 + 4.5 * SIN(SINE / 12)), RAD(0), RAD( - 2.5 * SIN(SINE / 12))) | |
1278 | RightShoulder1.C0 = CF(1.5, 0.5 + 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(-25), RAD(0 - 2.5 * SIN(SINE / 12)), RAD(15 + 1.5 * SIN(SINE / 12))) * RIGHTSHOULDERC0 | |
1279 | LeftShoulder1.C0 = CF(-1.5, 0.5 + 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(-25), RAD(0 + 2.5 * SIN(SINE / 12)), RAD(-15 - 1.5 * SIN(SINE / 12))) * LEFTSHOULDERC0 | |
1280 | RightHip1.C0 = CF(1, -1, -0.01) * ANGLES(RAD(-25-2.5 * SIN(SINE / 12)), RAD(75), RAD(0)) * ANGLES(RAD(-8 - 5.5 * SIN(SINE / 12)), RAD(0), RAD(0)) | |
1281 | LeftHip1.C0 = CF(-1, -0.5, -0.5) * ANGLES(RAD(-2.5 * SIN(SINE / 12)), RAD(-90), RAD(0)) * ANGLES(RAD(-8 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)) | |
1282 | end | |
1283 | end | |
1284 | local Human = Thing.Humanoid | |
1285 | if Human then | |
1286 | Human.HipHeight = 0.3 | |
1287 | for _, c in pairs(Thing:GetChildren()) do | |
1288 | if c.ClassName == "Part" and c.Transparency < 1 then | |
1289 | c.Color = C3(0,0,0) | |
1290 | c.Transparency = 0.65 + 0.15 * COS(SINE / 25) | |
1291 | elseif c.ClassName == "Accessory" or c.ClassName == "Hat" or c.ClassName == "CharacterMesh" or c.ClassName == "Shirt" or c.ClassName == "Pants" then | |
1292 | c:remove() | |
1293 | end | |
1294 | end | |
1295 | if Human then | |
1296 | local IDLEANIMATION = Human:LoadAnimation(ROBLOXIDLEANIMATION) | |
1297 | IDLEANIMATION:Play() | |
1298 | end | |
1299 | local list = game.Workspace:children() | |
1300 | local torso = nil | |
1301 | local dist = 50 | |
1302 | local temp = nil | |
1303 | local human = nil | |
1304 | local temp2 = nil | |
1305 | local OwnerInDanger = false | |
1306 | for x = 1, #list do | |
1307 | temp2 = list[x] | |
1308 | if (temp2.className == "Model") and (temp2 ~= Character) and (temp2 ~= Thing) then | |
1309 | temp = temp2:findFirstChild("Torso") or temp2:findFirstChild("UpperTorso") | |
1310 | human = temp2:findFirstChildOfClass("Humanoid") | |
1311 | if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then | |
1312 | if (temp.Position - Torso.Position).magnitude < 15 then | |
1313 | OwnerInDanger = true | |
1314 | newdist = (temp.Position - TORSO.Position).magnitude | |
1315 | dist = (Torso.Position - temp.Position).magnitude | |
1316 | Human:MoveTo(temp.Position) | |
1317 | torso = temp | |
1318 | if newdist < 7 then | |
1319 | torso.CFrame = CF(torso.Position,TORSO.Position)*CF(0,0,5) | |
1320 | CreateSound(814168787, temp, 1, 2, false) | |
1321 | ApplyDamage(human,MRANDOM(15,35),temp) | |
1322 | WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(1,1,1), Size2 = VT(3,1,3), Transparency = 0, Transparency2 = 1, CFrame = CF(TORSO.Position,torso.Position)*CF(0,0,-2) * 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 = 1, SoundVolume = 5}) | |
1323 | WACKYEFFECT({Time = 35, EffectType = "Wave", Size = VT(1,1,1), Size2 = VT(3,1,3), Transparency = 0, Transparency2 = 1, CFrame = torso.CFrame*CF(0,-4*torso.Size.Y/2,0), MoveToPos = nil, RotationX = 0, RotationY = 5, RotationZ = 0, Material = "Neon", Color = C3(0,0,0), SoundID = nil, SoundPitch = 1, SoundVolume = 5}) | |
1324 | end | |
1325 | end | |
1326 | end | |
1327 | end | |
1328 | end | |
1329 | if OwnerInDanger == false then | |
1330 | for x = 1, #list do | |
1331 | temp2 = list[x] | |
1332 | if (temp2.className == "Model") and (temp2 ~= Character) and (temp2 ~= Thing) then | |
1333 | temp = temp2:findFirstChild("Torso") or temp2:findFirstChild("UpperTorso") | |
1334 | human = temp2:findFirstChildOfClass("Humanoid") | |
1335 | if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then | |
1336 | if (temp.Position - Torso.Position).magnitude < dist then | |
1337 | newdist = (temp.Position - TORSO.Position).magnitude | |
1338 | Human:MoveTo(temp.Position) | |
1339 | torso = temp | |
1340 | if newdist < 15 then | |
1341 | if MRANDOM(1,35) == 1 then | |
1342 | CreateSound(438665935, temp, 1, 3, false) | |
1343 | ApplyDamage(human,MRANDOM(2,20),temp) | |
1344 | WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(1,1,1), Size2 = VT(3,1,3), Transparency = 0, Transparency2 = 1, CFrame = CF(TORSO.Position,torso.Position)*CF(0,0,-2) * 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 = 1, SoundVolume = 5}) | |
1345 | end | |
1346 | end | |
1347 | end | |
1348 | end | |
1349 | end | |
1350 | end | |
1351 | end | |
1352 | if torso == nil then | |
1353 | Human.WalkSpeed = Speed -0.2 | |
1354 | if (Torso.Position - TORSO.Position).magnitude < 12 and (Torso.Position - TORSO.Position).magnitude >= 11 then | |
1355 | Human:MoveTo(TORSO.Position) | |
1356 | elseif (Torso.Position - TORSO.Position).magnitude > 15 then | |
1357 | Human:MoveTo(Torso.Position) | |
1358 | elseif (Torso.Position - TORSO.Position).magnitude < 11 then | |
1359 | Human:MoveTo(CF(Torso.Position,TORSO.Position)*CF(0,0,-5).p) | |
1360 | end | |
1361 | else | |
1362 | if OwnerInDanger == false then | |
1363 | Human.WalkSpeed = Speed*1.2 | |
1364 | else | |
1365 | Human.WalkSpeed = Speed*5 | |
1366 | end | |
1367 | end | |
1368 | if Human.Health == 0 then | |
1369 | Thing:remove() | |
1370 | table.remove(GHOSTS,e) | |
1371 | else | |
1372 | Human.Health = Human.Health + 0.5 | |
1373 | end | |
1374 | else | |
1375 | Thing:remove() | |
1376 | table.remove(GHOSTS,e) | |
1377 | end | |
1378 | else | |
1379 | Thing:remove() | |
1380 | table.remove(GHOSTS,e) | |
1381 | end | |
1382 | end | |
1383 | end | |
1384 | end | |
1385 | end | |
1386 | refit() | |
1387 | end | |
1388 | ||
1389 | --//=================================\\ | |
1390 | --\\=================================// | |
1391 | ||
1392 | ||
1393 | ||
1394 | ||
1395 | ||
1396 | --//====================================================\\-- | |
1397 | --|| END OF SCRIPT | |
1398 | --\\====================================================//-- |