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 | ||
3 | local Player,game,owner = owner,game | |
4 | ||
5 | local RealPlayer = Player | |
6 | ||
7 | do print("FE Compatibility code V3 by Desered_ROBLOX")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end | |
8 | --//====================================================\\-- | |
9 | --|| CREATED BY SHACKLUSTER | |
10 | --\\====================================================//-- | |
11 | ||
12 | wait(0.2) | |
13 | ||
14 | Player = game:GetService("Players").LocalPlayer | |
15 | PlayerGui = Player.PlayerGui | |
16 | Cam = workspace.CurrentCamera | |
17 | Backpack = Player.Backpack | |
18 | Character = Player.Character | |
19 | Humanoid = Character.Humanoid | |
20 | Mouse = Player:GetMouse() | |
21 | RootPart = Character["HumanoidRootPart"] | |
22 | Torso = Character["Torso"] | |
23 | Head = Character["Head"] | |
24 | RightArm = Character["Right Arm"] | |
25 | LeftArm = Character["Left Arm"] | |
26 | RightLeg = Character["Right Leg"] | |
27 | LeftLeg = Character["Left Leg"] | |
28 | RootJoint = RootPart["RootJoint"] | |
29 | Neck = Torso["Neck"] | |
30 | RightShoulder = Torso["Right Shoulder"] | |
31 | LeftShoulder = Torso["Left Shoulder"] | |
32 | RightHip = Torso["Right Hip"] | |
33 | LeftHip = Torso["Left Hip"] | |
34 | ||
35 | IT = Instance.new | |
36 | CF = CFrame.new | |
37 | VT = Vector3.new | |
38 | RAD = math.rad | |
39 | C3 = Color3.new | |
40 | UD2 = UDim2.new | |
41 | BRICKC = BrickColor.new | |
42 | ANGLES = CFrame.Angles | |
43 | EULER = CFrame.fromEulerAnglesXYZ | |
44 | COS = math.cos | |
45 | ACOS = math.acos | |
46 | SIN = math.sin | |
47 | ASIN = math.asin | |
48 | ABS = math.abs | |
49 | MRANDOM = math.random | |
50 | FLOOR = math.floor | |
51 | ||
52 | --//=================================\\ | |
53 | --|| USEFUL VALUES | |
54 | --\\=================================// | |
55 | ||
56 | Animation_Speed = 3 | |
57 | Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60) | |
58 | local Speed = 12 | |
59 | local SIZE = 1 | |
60 | local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
61 | local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
62 | local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) | |
63 | local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) | |
64 | local DAMAGEMULTIPLIER = 1 | |
65 | local ANIM = "Idle" | |
66 | local ATTACK = false | |
67 | local EQUIPPED = false | |
68 | local HOLD = false | |
69 | local COMBO = 1 | |
70 | local Rooted = false | |
71 | local SINE = 0 | |
72 | local KEYHOLD = false | |
73 | local CHANGE = 2 / Animation_Speed | |
74 | local WALKINGANIM = false | |
75 | local VALUE1 = false | |
76 | local VALUE2 = false | |
77 | local ROBLOXIDLEANIMATION = IT("Animation") | |
78 | ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation" | |
79 | ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=194248247" | |
80 | --ROBLOXIDLEANIMATION.Parent = Humanoid | |
81 | local WEAPONGUI = IT("ScreenGui", PlayerGui) | |
82 | WEAPONGUI.Name = "Weapon GUI" | |
83 | local Weapon = IT("Model") | |
84 | Weapon.Name = "Adds" | |
85 | local Effects = IT("Folder", Weapon) | |
86 | Effects.Name = "Effects" | |
87 | local ANIMATOR = Humanoid.Animator | |
88 | local ANIMATE = Character.Animate | |
89 | local UNANCHOR = true | |
90 | local PLAYANIMS = true | |
91 | local CLOAKED = false | |
92 | ||
93 | --//=================================\\ | |
94 | --\\=================================// | |
95 | ||
96 | ||
97 | --//=================================\\ | |
98 | --|| SAZERENOS' ARTIFICIAL HEARTBEAT | |
99 | --\\=================================// | |
100 | ||
101 | ArtificialHB = Instance.new("BindableEvent", script) | |
102 | ArtificialHB.Name = "ArtificialHB" | |
103 | ||
104 | script:WaitForChild("ArtificialHB") | |
105 | ||
106 | frame = Frame_Speed | |
107 | tf = 0 | |
108 | allowframeloss = false | |
109 | tossremainder = false | |
110 | lastframe = tick() | |
111 | script.ArtificialHB:Fire() | |
112 | ||
113 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
114 | tf = tf + s | |
115 | if tf >= frame then | |
116 | if allowframeloss then | |
117 | script.ArtificialHB:Fire() | |
118 | lastframe = tick() | |
119 | else | |
120 | for i = 1, math.floor(tf / frame) do | |
121 | script.ArtificialHB:Fire() | |
122 | end | |
123 | lastframe = tick() | |
124 | end | |
125 | if tossremainder then | |
126 | tf = 0 | |
127 | else | |
128 | tf = tf - frame * math.floor(tf / frame) | |
129 | end | |
130 | end | |
131 | end) | |
132 | ||
133 | --//=================================\\ | |
134 | --\\=================================// | |
135 | ||
136 | --//=================================\\ | |
137 | --|| SOME FUNCTIONS | |
138 | --\\=================================// | |
139 | ||
140 | function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS) | |
141 | return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS) | |
142 | end | |
143 | ||
144 | function PositiveAngle(NUMBER) | |
145 | if NUMBER >= 0 then | |
146 | NUMBER = 0 | |
147 | end | |
148 | return NUMBER | |
149 | end | |
150 | ||
151 | function NegativeAngle(NUMBER) | |
152 | if NUMBER <= 0 then | |
153 | NUMBER = 0 | |
154 | end | |
155 | return NUMBER | |
156 | end | |
157 | ||
158 | function Swait(NUMBER) | |
159 | if NUMBER == 0 or NUMBER == nil then | |
160 | ArtificialHB.Event:wait() | |
161 | else | |
162 | for i = 1, NUMBER do | |
163 | ArtificialHB.Event:wait() | |
164 | end | |
165 | end | |
166 | end | |
167 | ||
168 | function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET) | |
169 | local NEWMESH = IT(MESH) | |
170 | if MESH == "SpecialMesh" then | |
171 | NEWMESH.MeshType = MESHTYPE | |
172 | if MESHID ~= "nil" and MESHID ~= "" then | |
173 | NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID | |
174 | end | |
175 | if TEXTUREID ~= "nil" and TEXTUREID ~= "" then | |
176 | NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID | |
177 | end | |
178 | end | |
179 | NEWMESH.Offset = OFFSET or VT(0, 0, 0) | |
180 | NEWMESH.Scale = SCALE | |
181 | NEWMESH.Parent = PARENT | |
182 | return NEWMESH | |
183 | end | |
184 | ||
185 | function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR) | |
186 | local NEWPART = IT("Part") | |
187 | NEWPART.formFactor = FORMFACTOR | |
188 | NEWPART.Reflectance = REFLECTANCE | |
189 | NEWPART.Transparency = TRANSPARENCY | |
190 | NEWPART.CanCollide = false | |
191 | NEWPART.Locked = true | |
192 | NEWPART.Anchored = true | |
193 | if ANCHOR == false then | |
194 | NEWPART.Anchored = false | |
195 | end | |
196 | NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR)) | |
197 | NEWPART.Name = NAME | |
198 | NEWPART.Size = SIZE | |
199 | NEWPART.Position = Torso.Position | |
200 | NEWPART.Material = MATERIAL | |
201 | NEWPART:BreakJoints() | |
202 | NEWPART.Parent = PARENT | |
203 | return NEWPART | |
204 | end | |
205 | ||
206 | local function weldBetween(a, b) | |
207 | local weldd = Instance.new("ManualWeld") | |
208 | weldd.Part0 = a | |
209 | weldd.Part1 = b | |
210 | weldd.C0 = CFrame.new() | |
211 | weldd.C1 = b.CFrame:inverse() * a.CFrame | |
212 | weldd.Parent = a | |
213 | return weldd | |
214 | end | |
215 | ||
216 | ||
217 | function QuaternionFromCFrame(cf) | |
218 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
219 | local trace = m00 + m11 + m22 | |
220 | if trace > 0 then | |
221 | local s = math.sqrt(1 + trace) | |
222 | local recip = 0.5 / s | |
223 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
224 | else | |
225 | local i = 0 | |
226 | if m11 > m00 then | |
227 | i = 1 | |
228 | end | |
229 | if m22 > (i == 0 and m00 or m11) then | |
230 | i = 2 | |
231 | end | |
232 | if i == 0 then | |
233 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
234 | local recip = 0.5 / s | |
235 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
236 | elseif i == 1 then | |
237 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
238 | local recip = 0.5 / s | |
239 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
240 | elseif i == 2 then | |
241 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
242 | local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
243 | end | |
244 | end | |
245 | end | |
246 | ||
247 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
248 | local xs, ys, zs = x + x, y + y, z + z | |
249 | local wx, wy, wz = w * xs, w * ys, w * zs | |
250 | local xx = x * xs | |
251 | local xy = x * ys | |
252 | local xz = x * zs | |
253 | local yy = y * ys | |
254 | local yz = y * zs | |
255 | local zz = z * zs | |
256 | 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)) | |
257 | end | |
258 | ||
259 | function QuaternionSlerp(a, b, t) | |
260 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
261 | local startInterp, finishInterp; | |
262 | if cosTheta >= 0.0001 then | |
263 | if (1 - cosTheta) > 0.0001 then | |
264 | local theta = ACOS(cosTheta) | |
265 | local invSinTheta = 1 / SIN(theta) | |
266 | startInterp = SIN((1 - t) * theta) * invSinTheta | |
267 | finishInterp = SIN(t * theta) * invSinTheta | |
268 | else | |
269 | startInterp = 1 - t | |
270 | finishInterp = t | |
271 | end | |
272 | else | |
273 | if (1 + cosTheta) > 0.0001 then | |
274 | local theta = ACOS(-cosTheta) | |
275 | local invSinTheta = 1 / SIN(theta) | |
276 | startInterp = SIN((t - 1) * theta) * invSinTheta | |
277 | finishInterp = SIN(t * theta) * invSinTheta | |
278 | else | |
279 | startInterp = t - 1 | |
280 | finishInterp = t | |
281 | end | |
282 | end | |
283 | 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 | |
284 | end | |
285 | ||
286 | function Clerp(a, b, t) | |
287 | local qa = {QuaternionFromCFrame(a)} | |
288 | local qb = {QuaternionFromCFrame(b)} | |
289 | local ax, ay, az = a.x, a.y, a.z | |
290 | local bx, by, bz = b.x, b.y, b.z | |
291 | local _t = 1 - t | |
292 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
293 | end | |
294 | ||
295 | function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME) | |
296 | local frame = IT("Frame") | |
297 | frame.BackgroundTransparency = TRANSPARENCY | |
298 | frame.BorderSizePixel = BORDERSIZEPIXEL | |
299 | frame.Position = POSITION | |
300 | frame.Size = SIZE | |
301 | frame.BackgroundColor3 = COLOR | |
302 | frame.BorderColor3 = BORDERCOLOR | |
303 | frame.Name = NAME | |
304 | frame.Parent = PARENT | |
305 | return frame | |
306 | end | |
307 | ||
308 | function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME) | |
309 | local label = IT("TextLabel") | |
310 | label.BackgroundTransparency = 1 | |
311 | label.Size = UD2(1, 0, 1, 0) | |
312 | label.Position = UD2(0, 0, 0, 0) | |
313 | label.TextColor3 = TEXTCOLOR | |
314 | label.TextStrokeTransparency = STROKETRANSPARENCY | |
315 | label.TextTransparency = TRANSPARENCY | |
316 | label.FontSize = TEXTFONTSIZE | |
317 | label.Font = TEXTFONT | |
318 | label.BorderSizePixel = BORDERSIZEPIXEL | |
319 | label.TextScaled = false | |
320 | label.Text = TEXT | |
321 | label.Name = NAME | |
322 | label.Parent = PARENT | |
323 | return label | |
324 | end | |
325 | ||
326 | function NoOutlines(PART) | |
327 | PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10 | |
328 | end | |
329 | ||
330 | function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1) | |
331 | local NEWWELD = IT(TYPE) | |
332 | NEWWELD.Part0 = PART0 | |
333 | NEWWELD.Part1 = PART1 | |
334 | NEWWELD.C0 = C0 | |
335 | NEWWELD.C1 = C1 | |
336 | NEWWELD.Parent = PARENT | |
337 | return NEWWELD | |
338 | end | |
339 | ||
340 | local S = IT("Sound") | |
341 | function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP) | |
342 | local NEWSOUND = nil | |
343 | coroutine.resume(coroutine.create(function() | |
344 | NEWSOUND = S:Clone() | |
345 | NEWSOUND.Parent = PARENT | |
346 | NEWSOUND.Volume = VOLUME | |
347 | NEWSOUND.Pitch = PITCH | |
348 | NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID | |
349 | NEWSOUND:play() | |
350 | if DOESLOOP == true then | |
351 | NEWSOUND.Looped = true | |
352 | else | |
353 | repeat wait(1) until NEWSOUND.Playing == false | |
354 | NEWSOUND:remove() | |
355 | end | |
356 | end)) | |
357 | return NEWSOUND | |
358 | end | |
359 | ||
360 | function MakeForm(PART,TYPE) | |
361 | if TYPE == "Cyl" then | |
362 | local MSH = IT("CylinderMesh",PART) | |
363 | elseif TYPE == "Ball" then | |
364 | local MSH = IT("SpecialMesh",PART) | |
365 | MSH.MeshType = "Sphere" | |
366 | elseif TYPE == "Wedge" then | |
367 | local MSH = IT("SpecialMesh",PART) | |
368 | MSH.MeshType = "Wedge" | |
369 | end | |
370 | end | |
371 | ||
372 | function CFrameFromTopBack(at, top, back) | |
373 | local right = top:Cross(back) | |
374 | 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) | |
375 | end | |
376 | ||
377 | function PuddleOfBlood(Position,MaxDrop,Model,MaxSize) | |
378 | local HITFLOOR, HITPOS, NORMAL = Raycast(Position, (CF(Position, Position + VT(0, -1, 0))).lookVector, MaxDrop, Model) | |
379 | if HITFLOOR ~= nil then | |
380 | if HITFLOOR.Parent ~= Weapon and HITFLOOR.Parent ~= Character then | |
381 | if HITFLOOR.Name == "BloodPuddle" then | |
382 | local DIST = (Position - HITFLOOR.Position).Magnitude | |
383 | 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 | |
384 | HITFLOOR.Size = HITFLOOR.Size + VT(0.1,0,0.1) | |
385 | end | |
386 | else | |
387 | if HITFLOOR.Anchored == true then | |
388 | local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(2,0,2)) | |
389 | BLOOD.CFrame = CF(HITPOS,HITPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0)) | |
390 | MakeForm(BLOOD,"Cyl") | |
391 | coroutine.resume(coroutine.create(function() | |
392 | Swait(75) | |
393 | while true do | |
394 | Swait() | |
395 | BLOOD.Size = BLOOD.Size - VT(0.02,0,0.02) | |
396 | if BLOOD.Size.Z < 0.051 then | |
397 | BLOOD:remove() | |
398 | break | |
399 | end | |
400 | end | |
401 | end)) | |
402 | end | |
403 | end | |
404 | end | |
405 | end | |
406 | end | |
407 | ||
408 | --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}) | |
409 | function WACKYEFFECT(Table) | |
410 | local TYPE = (Table.EffectType or "Sphere") | |
411 | local SIZE = (Table.Size or VT(1,1,1)) | |
412 | local ENDSIZE = (Table.Size2 or VT(0,0,0)) | |
413 | local TRANSPARENCY = (Table.Transparency or 0) | |
414 | local ENDTRANSPARENCY = (Table.Transparency2 or 1) | |
415 | local CFRAME = (Table.CFrame or Torso.CFrame) | |
416 | local MOVEDIRECTION = (Table.MoveToPos or nil) | |
417 | local ROTATION1 = (Table.RotationX or 0) | |
418 | local ROTATION2 = (Table.RotationY or 0) | |
419 | local ROTATION3 = (Table.RotationZ or 0) | |
420 | local MATERIAL = (Table.Material or "Neon") | |
421 | local COLOR = (Table.Color or C3(1,1,1)) | |
422 | local TIME = (Table.Time or 45) | |
423 | local SOUNDID = (Table.SoundID or nil) | |
424 | local SOUNDPITCH = (Table.SoundPitch or nil) | |
425 | local SOUNDVOLUME = (Table.SoundVolume or nil) | |
426 | coroutine.resume(coroutine.create(function() | |
427 | local PLAYSSOUND = false | |
428 | local SOUND = nil | |
429 | local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true) | |
430 | if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then | |
431 | PLAYSSOUND = true | |
432 | SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false) | |
433 | end | |
434 | EFFECT.Color = COLOR | |
435 | local MSH = nil | |
436 | if TYPE == "Sphere" then | |
437 | MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0)) | |
438 | elseif TYPE == "Block" or TYPE == "Box" then | |
439 | MSH = IT("BlockMesh",EFFECT) | |
440 | MSH.Scale = SIZE | |
441 | elseif TYPE == "Wave" then | |
442 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8)) | |
443 | elseif TYPE == "Ring" then | |
444 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0)) | |
445 | elseif TYPE == "Slash" then | |
446 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
447 | elseif TYPE == "Round Slash" then | |
448 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
449 | elseif TYPE == "Swirl" then | |
450 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0)) | |
451 | elseif TYPE == "Skull" then | |
452 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0)) | |
453 | elseif TYPE == "Crystal" then | |
454 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0)) | |
455 | end | |
456 | if MSH ~= nil then | |
457 | local MOVESPEED = nil | |
458 | if MOVEDIRECTION ~= nil then | |
459 | MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME | |
460 | end | |
461 | local GROWTH = SIZE - ENDSIZE | |
462 | local TRANS = TRANSPARENCY - ENDTRANSPARENCY | |
463 | if TYPE == "Block" then | |
464 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
465 | else | |
466 | EFFECT.CFrame = CFRAME | |
467 | end | |
468 | for LOOP = 1, TIME+1 do | |
469 | Swait() | |
470 | MSH.Scale = MSH.Scale - GROWTH/TIME | |
471 | if TYPE == "Wave" then | |
472 | MSH.Offset = VT(0,0,-MSH.Scale.X/8) | |
473 | end | |
474 | EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME | |
475 | if TYPE == "Block" then | |
476 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
477 | else | |
478 | EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3)) | |
479 | end | |
480 | if MOVEDIRECTION ~= nil then | |
481 | local ORI = EFFECT.Orientation | |
482 | EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED) | |
483 | EFFECT.Orientation = ORI | |
484 | end | |
485 | end | |
486 | if PLAYSSOUND == false then | |
487 | EFFECT:remove() | |
488 | else | |
489 | repeat wait(1) until SOUND.Playing == false | |
490 | EFFECT:remove() | |
491 | end | |
492 | else | |
493 | if PLAYSSOUND == false then | |
494 | EFFECT:remove() | |
495 | else | |
496 | repeat Swait() until SOUND.Playing == false | |
497 | EFFECT:remove() | |
498 | end | |
499 | end | |
500 | end)) | |
501 | end | |
502 | ||
503 | function SprayBlood(POSITION,DIRECTION,BloodSize) | |
504 | local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(0.3,0.3,0.3),false) | |
505 | BLOOD.CFrame = CF(POSITION) | |
506 | MakeForm(BLOOD,"Ball") | |
507 | local bv = Instance.new("BodyVelocity",BLOOD) | |
508 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
509 | bv.velocity = CF(POSITION,DIRECTION+VT(MRANDOM(-3,3)/30,MRANDOM(-3,3)/30,MRANDOM(-3,3)/30)).lookVector*75 | |
510 | bv.Name = "MOVE" | |
511 | Debris:AddItem(bv,0.05) | |
512 | coroutine.resume(coroutine.create(function() | |
513 | local HASTOUCHEDGROUND = false | |
514 | local HIT = BLOOD.Touched:Connect(function(hit) | |
515 | if hit.Anchored == true then | |
516 | HASTOUCHEDGROUND = true | |
517 | PuddleOfBlood(BLOOD.Position+VT(0,1,0),2,BLOOD,BloodSize) | |
518 | end | |
519 | end) | |
520 | wait(5) | |
521 | if HASTOUCHEDGROUND == false then | |
522 | BLOOD:remove() | |
523 | end | |
524 | end)) | |
525 | end | |
526 | ||
527 | Debris = game:GetService("Debris") | |
528 | ||
529 | function CastProperRay(StartPos, EndPos, Distance, Ignore) | |
530 | local DIRECTION = CF(StartPos,EndPos).lookVector | |
531 | return Raycast(StartPos, DIRECTION, Distance, Ignore) | |
532 | end | |
533 | ||
534 | function turnto(position) | |
535 | RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0) | |
536 | end | |
537 | ||
538 | function recurse(root,callback,i) | |
539 | i= i or 0 | |
540 | for _,v in pairs(root:GetChildren()) do | |
541 | i = i + 1 | |
542 | callback(i,v) | |
543 | ||
544 | if #v:GetChildren() > 0 then | |
545 | i = recurse(v,callback,i) | |
546 | end | |
547 | end | |
548 | ||
549 | return i | |
550 | end | |
551 | ||
552 | function ragdollJoint(character, part0, part1, attachmentName, className, properties) | |
553 | attachmentName = attachmentName.."RigAttachment" | |
554 | local constraint = Instance.new(className.."Constraint") | |
555 | constraint.Attachment0 = part0:FindFirstChild(attachmentName) | |
556 | constraint.Attachment1 = part1:FindFirstChild(attachmentName) | |
557 | constraint.Name = "RagdollConstraint"..part1.Name | |
558 | ||
559 | for _,propertyData in next,properties or {} do | |
560 | constraint[propertyData[1]] = propertyData[2] | |
561 | end | |
562 | ||
563 | constraint.Parent = character | |
564 | end | |
565 | ||
566 | function getAttachment0(character, attachmentName) | |
567 | for _,child in next,character:GetChildren() do | |
568 | local attachment = child:FindFirstChild(attachmentName) | |
569 | if attachment then | |
570 | return attachment | |
571 | end | |
572 | end | |
573 | end | |
574 | ||
575 | function R15Ragdoll(character) | |
576 | recurse(character, function(_,v) | |
577 | if v:IsA("Attachment") then | |
578 | v.Axis = Vector3.new(0, 1, 0) | |
579 | v.SecondaryAxis = Vector3.new(0, 0, 1) | |
580 | v.Rotation = Vector3.new(0, 0, 0) | |
581 | end | |
582 | end) | |
583 | for _,child in next,character:GetChildren() do | |
584 | if child:IsA("Accoutrement") then | |
585 | for _,part in next,child:GetChildren() do | |
586 | if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then | |
587 | local attachment1 = part:FindFirstChildOfClass("Attachment") | |
588 | local attachment0 = getAttachment0(character,attachment1.Name) | |
589 | if attachment0 and attachment1 then | |
590 | local constraint = Instance.new("HingeConstraint") | |
591 | constraint.Attachment0 = attachment0 | |
592 | constraint.Attachment1 = attachment1 | |
593 | constraint.LimitsEnabled = true | |
594 | constraint.UpperAngle = 0 | |
595 | constraint.LowerAngle = 0 | |
596 | constraint.Parent = character | |
597 | end | |
598 | elseif part.Name == "HumanoidRootPart" then | |
599 | part:remove() | |
600 | end | |
601 | end | |
602 | end | |
603 | end | |
604 | ||
605 | ragdollJoint(character,character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", { | |
606 | {"LimitsEnabled",true}; | |
607 | {"UpperAngle",5}; | |
608 | }) | |
609 | ragdollJoint(character,character.UpperTorso, character.Head, "Neck", "BallSocket", { | |
610 | {"LimitsEnabled",true}; | |
611 | {"UpperAngle",15}; | |
612 | }) | |
613 | ||
614 | local handProperties = { | |
615 | {"LimitsEnabled", true}; | |
616 | {"UpperAngle",0}; | |
617 | {"LowerAngle",0}; | |
618 | } | |
619 | ragdollJoint(character,character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties) | |
620 | ragdollJoint(character,character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties) | |
621 | ||
622 | local shinProperties = { | |
623 | {"LimitsEnabled", true}; | |
624 | {"UpperAngle", 0}; | |
625 | {"LowerAngle", -75}; | |
626 | } | |
627 | ragdollJoint(character,character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties) | |
628 | ragdollJoint(character,character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties) | |
629 | ||
630 | local footProperties = { | |
631 | {"LimitsEnabled", true}; | |
632 | {"UpperAngle", 15}; | |
633 | {"LowerAngle", -45}; | |
634 | } | |
635 | ragdollJoint(character,character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties) | |
636 | ragdollJoint(character,character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties) | |
637 | ||
638 | ragdollJoint(character,character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket") | |
639 | ragdollJoint(character,character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket") | |
640 | ragdollJoint(character,character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket") | |
641 | ragdollJoint(character,character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket") | |
642 | ragdollJoint(character,character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket") | |
643 | ragdollJoint(character,character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket") | |
644 | end | |
645 | ||
646 | function Ragdoll(Character2,CharTorso) | |
647 | Character2:BreakJoints() | |
648 | local hum = Character2:findFirstChild("Humanoid") | |
649 | hum:remove() | |
650 | local function Scan(ch) | |
651 | local e | |
652 | for e = 1,#ch do | |
653 | Scan(ch[e]:GetChildren()) | |
654 | if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then | |
655 | ch[e]:remove() | |
656 | end | |
657 | end | |
658 | end | |
659 | local NEWHUM = IT("Humanoid") | |
660 | NEWHUM.Name = "Corpse" | |
661 | NEWHUM.Health = 0 | |
662 | NEWHUM.MaxHealth = 0 | |
663 | NEWHUM.PlatformStand = true | |
664 | NEWHUM.Parent = Character2 | |
665 | NEWHUM.DisplayDistanceType = "None" | |
666 | ||
667 | local ch = Character2:GetChildren() | |
668 | local i | |
669 | for i = 1,#ch do | |
670 | if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then | |
671 | ch[i]:remove() | |
672 | end | |
673 | end | |
674 | ||
675 | local Torso2 = Character2.Torso | |
676 | local movevector = Vector3.new() | |
677 | ||
678 | if Torso2 then | |
679 | movevector = CFrame.new(CharTorso.Position,Torso2.Position).lookVector | |
680 | local Head = Character2:FindFirstChild("Head") | |
681 | if Head then | |
682 | local Neck = Instance.new("Weld") | |
683 | Neck.Name = "Neck" | |
684 | Neck.Part0 = Torso2 | |
685 | Neck.Part1 = Head | |
686 | Neck.C0 = CFrame.new(0, 1.5, 0) | |
687 | Neck.C1 = CFrame.new() | |
688 | Neck.Parent = Torso2 | |
689 | ||
690 | end | |
691 | local Limb = Character2:FindFirstChild("Right Arm") | |
692 | if Limb then | |
693 | ||
694 | Limb.CFrame = Torso2.CFrame * CFrame.new(1.5, 0, 0) | |
695 | local Joint = Instance.new("Glue") | |
696 | Joint.Name = "RightShoulder" | |
697 | Joint.Part0 = Torso2 | |
698 | Joint.Part1 = Limb | |
699 | Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
700 | Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
701 | Joint.Parent = Torso2 | |
702 | ||
703 | local B = Instance.new("Part") | |
704 | B.TopSurface = 0 | |
705 | B.BottomSurface = 0 | |
706 | B.formFactor = "Symmetric" | |
707 | B.Size = Vector3.new(1, 1, 1) | |
708 | B.Transparency = 1 | |
709 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
710 | B.Parent = Character2 | |
711 | local W = Instance.new("Weld") | |
712 | W.Part0 = Limb | |
713 | W.Part1 = B | |
714 | W.C0 = CFrame.new(0, -0.5, 0) | |
715 | W.Parent = Limb | |
716 | ||
717 | end | |
718 | local Limb = Character2:FindFirstChild("Left Arm") | |
719 | if Limb then | |
720 | ||
721 | Limb.CFrame = Torso2.CFrame * CFrame.new(-1.5, 0, 0) | |
722 | local Joint = Instance.new("Glue") | |
723 | Joint.Name = "LeftShoulder" | |
724 | Joint.Part0 = Torso2 | |
725 | Joint.Part1 = Limb | |
726 | Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
727 | Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
728 | Joint.Parent = Torso2 | |
729 | ||
730 | local B = Instance.new("Part") | |
731 | B.TopSurface = 0 | |
732 | B.BottomSurface = 0 | |
733 | B.formFactor = "Symmetric" | |
734 | B.Size = Vector3.new(1, 1, 1) | |
735 | B.Transparency = 1 | |
736 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
737 | B.Parent = Character2 | |
738 | local W = Instance.new("Weld") | |
739 | W.Part0 = Limb | |
740 | W.Part1 = B | |
741 | W.C0 = CFrame.new(0, -0.5, 0) | |
742 | W.Parent = Limb | |
743 | ||
744 | end | |
745 | local Limb = Character2:FindFirstChild("Right Leg") | |
746 | if Limb then | |
747 | ||
748 | Limb.CFrame = Torso2.CFrame * CFrame.new(0.5, -2, 0) | |
749 | local Joint = Instance.new("Glue") | |
750 | Joint.Name = "RightHip" | |
751 | Joint.Part0 = Torso2 | |
752 | Joint.Part1 = Limb | |
753 | Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
754 | Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
755 | Joint.Parent = Torso2 | |
756 | ||
757 | local B = Instance.new("Part") | |
758 | B.TopSurface = 0 | |
759 | B.BottomSurface = 0 | |
760 | B.formFactor = "Symmetric" | |
761 | B.Size = Vector3.new(1, 1, 1) | |
762 | B.Transparency = 1 | |
763 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
764 | B.Parent = Character2 | |
765 | local W = Instance.new("Weld") | |
766 | W.Part0 = Limb | |
767 | W.Part1 = B | |
768 | W.C0 = CFrame.new(0, -0.5, 0) | |
769 | W.Parent = Limb | |
770 | ||
771 | end | |
772 | local Limb = Character2:FindFirstChild("Left Leg") | |
773 | if Limb then | |
774 | ||
775 | Limb.CFrame = Torso2.CFrame * CFrame.new(-0.5, -2, 0) | |
776 | local Joint = Instance.new("Glue") | |
777 | Joint.Name = "LeftHip" | |
778 | Joint.Part0 = Torso2 | |
779 | Joint.Part1 = Limb | |
780 | Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
781 | Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
782 | Joint.Parent = Torso2 | |
783 | ||
784 | local B = Instance.new("Part") | |
785 | B.TopSurface = 0 | |
786 | B.BottomSurface = 0 | |
787 | B.formFactor = "Symmetric" | |
788 | B.Size = Vector3.new(1, 1, 1) | |
789 | B.Transparency = 1 | |
790 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
791 | B.Parent = Character2 | |
792 | local W = Instance.new("Weld") | |
793 | W.Part0 = Limb | |
794 | W.Part1 = B | |
795 | W.C0 = CFrame.new(0, -0.5, 0) | |
796 | W.Parent = Limb | |
797 | ||
798 | end | |
799 | --[ | |
800 | local Bar = Instance.new("Part") | |
801 | Bar.TopSurface = 0 | |
802 | Bar.BottomSurface = 0 | |
803 | Bar.formFactor = "Symmetric" | |
804 | Bar.Size = Vector3.new(1, 1, 1) | |
805 | Bar.Transparency = 1 | |
806 | Bar.CFrame = Torso2.CFrame * CFrame.new(0, 0.5, 0) | |
807 | Bar.Parent = Character2 | |
808 | local Weld = Instance.new("Weld") | |
809 | Weld.Part0 = Torso2 | |
810 | Weld.Part1 = Bar | |
811 | Weld.C0 = CFrame.new(0, 0.5, 0) | |
812 | Weld.Parent = Torso2 | |
813 | --]] | |
814 | end | |
815 | Character2.Parent = workspace | |
816 | Debris:AddItem(Character2,5) | |
817 | ||
818 | return Character2,Torso2 | |
819 | end | |
820 | ||
821 | --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}) | |
822 | function WACKYEFFECT(Table) | |
823 | local TYPE = (Table.EffectType or "Sphere") | |
824 | local SIZE = (Table.Size or VT(1,1,1)) | |
825 | local ENDSIZE = (Table.Size2 or VT(0,0,0)) | |
826 | local TRANSPARENCY = (Table.Transparency or 0) | |
827 | local ENDTRANSPARENCY = (Table.Transparency2 or 1) | |
828 | local CFRAME = (Table.CFrame or Torso.CFrame) | |
829 | local MOVEDIRECTION = (Table.MoveToPos or nil) | |
830 | local ROTATION1 = (Table.RotationX or 0) | |
831 | local ROTATION2 = (Table.RotationY or 0) | |
832 | local ROTATION3 = (Table.RotationZ or 0) | |
833 | local MATERIAL = (Table.Material or "Neon") | |
834 | local COLOR = (Table.Color or C3(1,1,1)) | |
835 | local TIME = (Table.Time or 45) | |
836 | local SOUNDID = (Table.SoundID or nil) | |
837 | local SOUNDPITCH = (Table.SoundPitch or nil) | |
838 | local SOUNDVOLUME = (Table.SoundVolume or nil) | |
839 | coroutine.resume(coroutine.create(function() | |
840 | local PLAYSSOUND = false | |
841 | local SOUND = nil | |
842 | local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true) | |
843 | if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then | |
844 | PLAYSSOUND = true | |
845 | SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false) | |
846 | end | |
847 | EFFECT.Color = COLOR | |
848 | local MSH = nil | |
849 | if TYPE == "Sphere" then | |
850 | MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0)) | |
851 | elseif TYPE == "Block" or TYPE == "Box" then | |
852 | MSH = IT("BlockMesh",EFFECT) | |
853 | MSH.Scale = SIZE | |
854 | elseif TYPE == "Wave" then | |
855 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8)) | |
856 | elseif TYPE == "Ring" then | |
857 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0)) | |
858 | elseif TYPE == "Slash" then | |
859 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
860 | elseif TYPE == "Round Slash" then | |
861 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0)) | |
862 | elseif TYPE == "Swirl" then | |
863 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0)) | |
864 | elseif TYPE == "Skull" then | |
865 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0)) | |
866 | elseif TYPE == "Crystal" then | |
867 | MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0)) | |
868 | end | |
869 | if MSH ~= nil then | |
870 | local MOVESPEED = nil | |
871 | if MOVEDIRECTION ~= nil then | |
872 | MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME | |
873 | end | |
874 | local GROWTH = SIZE - ENDSIZE | |
875 | local TRANS = TRANSPARENCY - ENDTRANSPARENCY | |
876 | if TYPE == "Block" then | |
877 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
878 | else | |
879 | EFFECT.CFrame = CFRAME | |
880 | end | |
881 | for LOOP = 1, TIME+1 do | |
882 | Swait() | |
883 | MSH.Scale = MSH.Scale - GROWTH/TIME | |
884 | if TYPE == "Wave" then | |
885 | MSH.Offset = VT(0,0,-MSH.Scale.X/8) | |
886 | end | |
887 | EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME | |
888 | if TYPE == "Block" then | |
889 | EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))) | |
890 | else | |
891 | EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3)) | |
892 | end | |
893 | if MOVEDIRECTION ~= nil then | |
894 | local ORI = EFFECT.Orientation | |
895 | EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED) | |
896 | EFFECT.Orientation = ORI | |
897 | end | |
898 | end | |
899 | if PLAYSSOUND == false then | |
900 | EFFECT:remove() | |
901 | else | |
902 | repeat Swait() until SOUND.Playing == false | |
903 | EFFECT:remove() | |
904 | end | |
905 | else | |
906 | if PLAYSSOUND == false then | |
907 | EFFECT:remove() | |
908 | else | |
909 | repeat Swait() until SOUND.Playing == false | |
910 | EFFECT:remove() | |
911 | end | |
912 | end | |
913 | end)) | |
914 | end | |
915 | ||
916 | --//=================================\\ | |
917 | --|| WEAPON CREATION | |
918 | --\\=================================// | |
919 | ||
920 | local BMUSIC = IT("Sound",RootPart) | |
921 | local VOLUME = 0.8 | |
922 | local PITCH = 0.8 | |
923 | local SONGID = 179185583 | |
924 | local A = IT("Attachment",Torso) | |
925 | ||
926 | local GUN = CreatePart(3, Weapon, "Neon", 0, 0, "Really black", "Gun", VT(1, 0.8, 3),false) | |
927 | CreateMesh("SpecialMesh", GUN, "FileMesh", "623102664", "623102879", VT(0.01, 0.01, 0.01), VT(0,0,0)) | |
928 | local GUNWELD = CreateWeldOrSnapOrMotor("Weld", GUN, Torso, GUN, CF(-1.1,-1.1,0) * ANGLES(RAD(0), RAD(90), RAD(-90)), CF(0, 0, 0)) | |
929 | ||
930 | local Knife = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.2,1.2,0.2),false) | |
931 | - | local Grip = CreateWeldOrSnapOrMotor("Weld", RightArm, RightArm, Knife, CF(0,-2.2, -0.5) * ANGLES(RAD(0), RAD(0), RAD(180)) * ANGLES(RAD(45), RAD(0), RAD(0)), CF(0, 0.3, 0)) |
931 | + | local Grip = CreateWeldOrSnapOrMotor("Weld", RightArm, RightArm, Knife, CF(0,-1.2, -0.5) * ANGLES(RAD(0), RAD(0), RAD(180)) * ANGLES(RAD(45), RAD(0), RAD(0)), CF(0, 0.3, 0)) |
932 | CreateMesh("SpecialMesh", Knife, "FileMesh", "470094777", "470149026", VT(0.2,0.2,0.2), VT(0,0,0)) | |
933 | local A = IT("Attachment",Knife) | |
934 | A.Position = VT(-0, 0.2, 0.136) | |
935 | local B = IT("Attachment",Knife) | |
936 | B.Position = VT(-0, -0.95, -0.982) | |
937 | local Trail = IT("Trail",Knife) | |
938 | Trail.Attachment0 = B | |
939 | Trail.Attachment1 = A | |
940 | Trail.Lifetime = 0.1 | |
941 | Trail.Transparency = NumberSequence.new(0.5, 1) | |
942 | Trail.Texture = "http://www.roblox.com/asset/?id=1472703539" | |
943 | Trail.Enabled = true | |
944 | Humanoid.DisplayDistanceType = "None" | |
945 | Humanoid.MaxHealth = 800 | |
946 | Humanoid.Health = 800 | |
947 | ||
948 | local STEP = CreateSound(131436155, Torso, 3, 1, true) | |
949 | STEP.Playing = false | |
950 | STEP.Looped = false | |
951 | local STEPPING = false | |
952 | Humanoid.Running:Connect(function(speed) | |
953 | if STEPPING == false then | |
954 | STEPPING = true | |
955 | repeat | |
956 | local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude | |
957 | wait(8/TORSOVELOCITY) | |
958 | local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character) | |
959 | if TORSOVELOCITY > 1 and Torso.Transparency ~= 1 and HITFLOOR ~= nil then | |
960 | STEP.Parent = Torso | |
961 | STEP.Pitch = MRANDOM(8,12)/10 | |
962 | STEP:Play() | |
963 | end | |
964 | until TORSOVELOCITY < 0.6 | |
965 | STEPPING = false | |
966 | end | |
967 | end) | |
968 | ||
969 | for _, c in pairs(Weapon:GetChildren()) do | |
970 | if c.ClassName == "Part" then | |
971 | c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0) | |
972 | end | |
973 | end | |
974 | ||
975 | local SKILLTEXTCOLOR = C3(0,0,0) | |
976 | local SKILLFONT = "SciFi" | |
977 | local SKILLTEXTSIZE = 7 | |
978 | ||
979 | Weapon.Parent = Character | |
980 | ||
981 | Humanoid.Died:connect(function() | |
982 | ATTACK = true | |
983 | end) | |
984 | ||
985 | --//=================================\\ | |
986 | --|| DAMAGE FUNCTIONS | |
987 | --\\=================================// | |
988 | ||
989 | function StatLabel(CFRAME, TEXT, COLOR) | |
990 | local STATPART = CreatePart(3, Effects, "SmoothPlastic", 0, 1, "Really black", "Effect", VT()) | |
991 | STATPART.CFrame = CF(CFRAME.p,CFRAME.p+VT(MRANDOM(-5,5),MRANDOM(0,5),MRANDOM(-5,5))) | |
992 | local BODYGYRO = IT("BodyGyro", STATPART) | |
993 | game:GetService("Debris"):AddItem(STATPART ,5) | |
994 | local BILLBOARDGUI = Instance.new("BillboardGui", STATPART) | |
995 | BILLBOARDGUI.Adornee = STATPART | |
996 | BILLBOARDGUI.Size = UD2(2.5, 0, 2.5 ,0) | |
997 | BILLBOARDGUI.StudsOffset = VT(-2, 2, 0) | |
998 | BILLBOARDGUI.AlwaysOnTop = false | |
999 | local TEXTLABEL = Instance.new("TextLabel", BILLBOARDGUI) | |
1000 | TEXTLABEL.BackgroundTransparency = 1 | |
1001 | TEXTLABEL.Size = UD2(2.5, 0, 2.5, 0) | |
1002 | TEXTLABEL.Text = TEXT | |
1003 | TEXTLABEL.Font = SKILLFONT | |
1004 | TEXTLABEL.FontSize="Size42" | |
1005 | TEXTLABEL.TextColor3 = COLOR | |
1006 | TEXTLABEL.TextStrokeTransparency = 0 | |
1007 | TEXTLABEL.TextScaled = true | |
1008 | TEXTLABEL.TextWrapped = true | |
1009 | coroutine.resume(coroutine.create(function(THEPART, THEBODYPOSITION, THETEXTLABEL) | |
1010 | for i = 1, 50 do | |
1011 | Swait() | |
1012 | STATPART.CFrame = STATPART.CFrame * CF(0,0,-0.2) | |
1013 | TEXTLABEL.TextTransparency = TEXTLABEL.TextTransparency + (1/50) | |
1014 | TEXTLABEL.TextStrokeTransparency = TEXTLABEL.TextTransparency | |
1015 | end | |
1016 | THEPART.Parent = nil | |
1017 | end),STATPART, TEXTLABEL) | |
1018 | end | |
1019 | ||
1020 | --//=================================\\ | |
1021 | --|| DAMAGING | |
1022 | --\\=================================// | |
1023 | ||
1024 | function CameraEnshaking(Length, Intensity) | |
1025 | coroutine.resume(coroutine.create(function() | |
1026 | local intensity = 1 * Intensity | |
1027 | local rotM = 0.01 * Intensity | |
1028 | for i = 0, Length, 0.1 do | |
1029 | Swait() | |
1030 | intensity = intensity - 0.05 * Intensity / Length | |
1031 | rotM = rotM - 5.0E-4 * Intensity / Length | |
1032 | hum.CameraOffset = Vector3.new(Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity))) | |
1033 | cam.CFrame = cam.CFrame * CF(Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity))) * Euler(Rad(Mrandom(-intensity, intensity)) * rotM, Rad(Mrandom(-intensity, intensity)) * rotM, Rad(Mrandom(-intensity, intensity)) * rotM) | |
1034 | end | |
1035 | hum.CameraOffset = Vector3.new(0, 0, 0) | |
1036 | end)) | |
1037 | end | |
1038 | ||
1039 | function ApplyDamage(Humanoid,Damage,TorsoPart) | |
1040 | local defence = Instance.new("BoolValue",Humanoid.Parent) | |
1041 | defence.Name = ("HitBy"..Player.Name) | |
1042 | game:GetService("Debris"):AddItem(defence, 0.001) | |
1043 | Damage = Damage * DAMAGEMULTIPLIER | |
1044 | if Humanoid.Health ~= 0 then | |
1045 | local CritChance = MRANDOM(1,100) | |
1046 | if Damage > Humanoid.Health then | |
1047 | Damage = math.ceil(Humanoid.Health) | |
1048 | if Damage == 0 then | |
1049 | Damage = 0.1 | |
1050 | end | |
1051 | end | |
1052 | Humanoid.Health = Humanoid.Health - Damage | |
1053 | StatLabel(TorsoPart.CFrame * CF(0, 0 + (TorsoPart.Size.z - 1), 0), Damage, C3(0, 0, 0)) | |
1054 | end | |
1055 | end | |
1056 | ||
1057 | function ApplyAoE(POSITION,RANGE,MINDMG,MAXDMG,FLING,INSTAKILL) | |
1058 | local CHILDREN = workspace:GetDescendants() | |
1059 | for index, CHILD in pairs(CHILDREN) do | |
1060 | if CHILD.ClassName == "Model" and CHILD ~= Character then | |
1061 | local HUM = CHILD:FindFirstChildOfClass("Humanoid") | |
1062 | if HUM then | |
1063 | local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso") | |
1064 | if TORSO then | |
1065 | if (TORSO.Position - POSITION).Magnitude <= RANGE then | |
1066 | if INSTAKILL == true then | |
1067 | CHILD:BreakJoints() | |
1068 | else | |
1069 | local DMG = MRANDOM(MINDMG,MAXDMG) | |
1070 | ApplyDamage(HUM,DMG,TORSO) | |
1071 | end | |
1072 | if FLING > 0 then | |
1073 | for _, c in pairs(CHILD:GetChildren()) do | |
1074 | if c:IsA("BasePart") then | |
1075 | local bv = Instance.new("BodyVelocity") | |
1076 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
1077 | bv.velocity = CF(POSITION,TORSO.Position).lookVector*FLING | |
1078 | bv.Parent = c | |
1079 | Debris:AddItem(bv,0.05) | |
1080 | end | |
1081 | end | |
1082 | end | |
1083 | end | |
1084 | end | |
1085 | end | |
1086 | end | |
1087 | end | |
1088 | end | |
1089 | ||
1090 | function ApplyDamages(Humanoid,Damage) | |
1091 | Damage = Damage * DAMAGEMULTIPLIER | |
1092 | local DEAD = false | |
1093 | if Humanoid.Health < 2000 then | |
1094 | if Humanoid.Health - Damage > 0 then | |
1095 | Humanoid.Health = Humanoid.Health - Damage | |
1096 | else | |
1097 | DEAD = true | |
1098 | Humanoid.Parent:BreakJoints() | |
1099 | end | |
1100 | else | |
1101 | DEAD = true | |
1102 | Humanoid.Parent:BreakJoints() | |
1103 | end | |
1104 | end | |
1105 | ||
1106 | --//=================================\\ | |
1107 | --|| ATTACK FUNCTIONS AND STUFF | |
1108 | --\\=================================// | |
1109 | ||
1110 | function Cloaked() | |
1111 | CLOAKED = true | |
1112 | Speed = 0 | |
1113 | local POS = RootPart.Position | |
1114 | local DISTANCE = 99999 | |
1115 | for i = 1, 15 do | |
1116 | wait() | |
1117 | for _, c in pairs(Character:GetChildren()) do | |
1118 | if c:IsA("BasePart") and c ~= RootPart then | |
1119 | c.Transparency = c.Transparency + 1/15 | |
1120 | elseif c.ClassName == "Accessory" then | |
1121 | c.Handle.Transparency = c.Handle.Transparency + 1/15 | |
1122 | end | |
1123 | end | |
1124 | Trail.Transparency = NumberSequence.new(0.5+((i/15)/2), 1) | |
1125 | Knife.Transparency = Knife.Transparency + 1/15 | |
1126 | end | |
1127 | Speed = 5 | |
1128 | repeat | |
1129 | wait() | |
1130 | DISTANCE = (RootPart.Position - POS).Magnitude | |
1131 | until DISTANCE > 45 or CLOAKED == false | |
1132 | Speed = 0 | |
1133 | for i = 1, 15 do | |
1134 | wait() | |
1135 | for _, c in pairs(Character:GetChildren()) do | |
1136 | if c:IsA("BasePart") and c ~= RootPart then | |
1137 | c.Transparency = 1 - i/15 | |
1138 | elseif c.ClassName == "Accessory" then | |
1139 | c.Handle.Transparency = 1 - i/15 | |
1140 | end | |
1141 | end | |
1142 | Trail.Transparency = NumberSequence.new(1-((0.5/15)*i), 1) | |
1143 | Knife.Transparency = 1 - i/15 | |
1144 | end | |
1145 | Speed = 12 | |
1146 | CLOAKED = false | |
1147 | end | |
1148 | ||
1149 | function Attack() | |
1150 | PLAYANIMS = false | |
1151 | ATTACK = true | |
1152 | Rooted = false | |
1153 | local TARGET = nil | |
1154 | Knife.CanCollide = true | |
1155 | local HUMAN = nil | |
1156 | local TORSOPART = nil | |
1157 | local HIT = Knife.Touched:Connect(function(hit) | |
1158 | if hit.Parent:FindFirstChildOfClass("Humanoid") then | |
1159 | local HITBODY = hit.Parent | |
1160 | local HUM = hit.Parent:FindFirstChildOfClass("Humanoid") | |
1161 | local TORSO = HITBODY:FindFirstChild("Torso") or HITBODY:FindFirstChild("UpperTorso") | |
1162 | if TORSO and HUM.Health > 0 then | |
1163 | TARGET = HITBODY | |
1164 | TORSOPART = TORSO | |
1165 | HUMAN = HUM | |
1166 | end | |
1167 | end | |
1168 | end) | |
1169 | for i=0, 0.4, 0.1 / Animation_Speed do | |
1170 | Swait() | |
1171 | if TARGET then | |
1172 | break | |
1173 | end | |
1174 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 1 / Animation_Speed) | |
1175 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(15)), 1 / Animation_Speed) | |
1176 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1177 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1178 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1179 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1180 | end | |
1181 | CreateSound(143501853,Knife,2,MRANDOM(8,13)/10,false) | |
1182 | for i=0, 0.5, 0.1 / Animation_Speed do | |
1183 | Swait() | |
1184 | if TARGET then | |
1185 | break | |
1186 | end | |
1187 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(35)), 1 / Animation_Speed) | |
1188 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(-35)), 1 / Animation_Speed) | |
1189 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.15, 0.5, -0.4) * ANGLES(RAD(90), RAD(0), RAD(35)) * ANGLES(RAD(0), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1190 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.5, -0.3) * ANGLES(RAD(90), RAD(0), RAD(35)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1191 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1192 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1193 | end | |
1194 | Knife.CanCollide = false | |
1195 | if TARGET then | |
1196 | CLOAKED = false | |
1197 | local DISPOSE = false | |
1198 | Rooted = true | |
1199 | coroutine.resume(coroutine.create(function() | |
1200 | repeat | |
1201 | Swait() | |
1202 | if TORSOPART then | |
1203 | TORSOPART.Anchored = true | |
1204 | TORSOPART.CFrame = RootPart.CFrame*CF(0,0,-2.2) | |
1205 | end | |
1206 | until DISPOSE == true | |
1207 | TORSOPART.Anchored = false | |
1208 | end)) | |
1209 | for i=0, 0.5, 0.1 / Animation_Speed do | |
1210 | Swait() | |
1211 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 1 / Animation_Speed) | |
1212 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(15)), 1 / Animation_Speed) | |
1213 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.15, 0.75, -1.3) * ANGLES(RAD(90), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1214 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1215 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1216 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1217 | end | |
1218 | CreateSound(28144268,Knife,2,MRANDOM(8,13)/10,false) | |
1219 | CreateSound(180083298,TORSOPART,5,MRANDOM(8,13)/10,false) | |
1220 | coroutine.resume(coroutine.create(function() | |
1221 | for i = 1, 750 do | |
1222 | Swait() | |
1223 | if HUMAN and TORSOPART then | |
1224 | if HUMAN.Health > 0 then | |
1225 | SprayBlood(TORSOPART.CFrame*CF(0,TORSOPART.Size.Y/2,-TORSOPART.Size.Z/2).p,TORSOPART.CFrame*CF(MRANDOM(-3,3)/15,TORSOPART.Size.Y+MRANDOM(-3,3)/35,-TORSOPART.Size.Z*MRANDOM(8,25)/10).p,MRANDOM(15,35)/10) | |
1226 | HUMAN.Health = HUMAN.Health - 1 | |
1227 | HUMAN.WalkSpeed = MRANDOM(5,45) | |
1228 | else | |
1229 | break | |
1230 | end | |
1231 | else | |
1232 | break | |
1233 | end | |
1234 | end | |
1235 | local SCREAMS = {160718677,337800380} | |
1236 | if HUMAN and TORSOPART then | |
1237 | if HUMAN.Health == 0 then | |
1238 | local HEAD = TORSOPART.Parent:FindFirstChild("Head") | |
1239 | if HEAD then | |
1240 | CreateSound(SCREAMS[MRANDOM(1,#SCREAMS)],HEAD,5,MRANDOM(13,15)/10,false) | |
1241 | local FACE = HEAD:FindFirstChild("face") | |
1242 | if FACE then | |
1243 | FACE.Texture = "http://www.roblox.com/asset/?id=1599849960" | |
1244 | end | |
1245 | end | |
1246 | if TORSOPART.Name == "Torso" then | |
1247 | Ragdoll(TORSOPART.Parent,Torso) | |
1248 | elseif TORSOPART.Name == "UpperTorso" then | |
1249 | R15Ragdoll(TORSOPART.Parent) | |
1250 | end | |
1251 | end | |
1252 | HUMAN.WalkSpeed = 16 | |
1253 | end | |
1254 | end)) | |
1255 | for i=0, 0.2, 0.1 / Animation_Speed do | |
1256 | Swait() | |
1257 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 1 / Animation_Speed) | |
1258 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(15)), 1 / Animation_Speed) | |
1259 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(2, 0.75, -1.3) * ANGLES(RAD(90), RAD(90), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1260 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1261 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1262 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1263 | end | |
1264 | DISPOSE = true | |
1265 | local bv = Instance.new("BodyVelocity") | |
1266 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
1267 | bv.velocity = CF(TORSOPART.Position,TORSOPART.CFrame*CF(0,5,-15).p).lookVector*75 | |
1268 | bv.Parent = TORSOPART | |
1269 | Debris:AddItem(bv,0.05) | |
1270 | for i=0, 0.5, 0.1 / Animation_Speed do | |
1271 | Swait() | |
1272 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-35)), 1 / Animation_Speed) | |
1273 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(35)), 1 / Animation_Speed) | |
1274 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(-25), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1275 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.15, 0.5, -0.5) * ANGLES(RAD(90), RAD(0), RAD(-35)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1276 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(110), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1277 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-65), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1278 | end | |
1279 | end | |
1280 | HIT:disconnect() | |
1281 | ATTACK = false | |
1282 | Rooted = false | |
1283 | PLAYANIMS = true | |
1284 | end | |
1285 | ||
1286 | function Taunt() | |
1287 | ATTACK = true | |
1288 | Rooted = true | |
1289 | PLAYANIMS = false | |
1290 | CreateSound(2062482384,Torso,5,MRANDOM(8,9)/10,false) | |
1291 | for i=0, 1.5, 0.1 / Animation_Speed do | |
1292 | Swait() | |
1293 | 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) | |
1294 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(35), RAD(0)), 1 / Animation_Speed) | |
1295 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(140)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1296 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-140)) * ANGLES(RAD(0), RAD(90), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1297 | 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) | |
1298 | 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) | |
1299 | end | |
1300 | PLAYANIMS = true | |
1301 | ATTACK = false | |
1302 | Rooted = false | |
1303 | end | |
1304 | ||
1305 | function Silence() | |
1306 | Speed = 6 | |
1307 | ATTACK = true | |
1308 | Rooted = false | |
1309 | local GYRO = IT("BodyGyro",RootPart) | |
1310 | GYRO.D = 2 | |
1311 | GYRO.P = 20000 | |
1312 | GYRO.MaxTorque = VT(0,4000000,0) | |
1313 | coroutine.resume(coroutine.create(function() | |
1314 | repeat | |
1315 | Swait() | |
1316 | GYRO.CFrame = CF(RootPart.Position,Mouse.Hit.p) | |
1317 | until ATTACK == false | |
1318 | GYRO:Remove() | |
1319 | end)) | |
1320 | for i=0, 0.2, 0.1 / Animation_Speed do | |
1321 | Swait() | |
1322 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1323 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(25), RAD(0), RAD(15)), 1 / Animation_Speed) | |
1324 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1325 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.525, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(5)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1326 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1327 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1328 | end | |
1329 | local AMMO = 6 | |
1330 | local FIRING = true | |
1331 | local SHOOTING = false | |
1332 | local TIMER = 70 | |
1333 | CreateSound(147722227, GUN, 6, 1.3, false) | |
1334 | GUNWELD.Part0 = LeftArm | |
1335 | GUNWELD.C0 = CF(0,-1.5,0) * ANGLES(RAD(0), RAD(90), RAD(-90)) | |
1336 | local MOUSE = Mouse.Button1Down:connect(function(NEWKEY) | |
1337 | if SHOOTING == false and AMMO > 0 then | |
1338 | SHOOTING = true | |
1339 | AMMO = AMMO - 1 | |
1340 | local GUNPOS = GUN.CFrame*CF(1.2, 0.5, 0).p | |
1341 | local HIT,POS = CastProperRay(GUNPOS,Mouse.Hit.p,1000,Character) | |
1342 | local DISTANCE = (POS - GUNPOS).Magnitude | |
1343 | if HIT then | |
1344 | if HIT.Parent:FindFirstChildOfClass("Humanoid") then | |
1345 | if HIT.Parent:FindFirstChildOfClass("Humanoid").Health > 0 then | |
1346 | CreateSound(160432334, HIT, 10, 1, false) | |
1347 | ApplyDamages(HIT.Parent:FindFirstChildOfClass("Humanoid"),35) | |
1348 | end | |
1349 | end | |
1350 | end | |
1351 | TIMER = 55 | |
1352 | WACKYEFFECT({Time = 15, EffectType = "Block", Size = VT(0,0,0), Size2 = VT(0.3,0.3,0.3), Transparency = 0, Transparency2 = 1, CFrame = CF(GUNPOS), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,0), SoundID = 330704232, SoundPitch = 1, SoundVolume = 4}) | |
1353 | WACKYEFFECT({Time = 6, EffectType = "Box", Size = VT(0,0,DISTANCE), Size2 = VT(0.1,0.1,DISTANCE), Transparency = 0, Transparency2 = 1, CFrame = CF(GUNPOS,POS)*CF(0,0,-DISTANCE/2), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,0), SoundID = nil, SoundPitch = nil, SoundVolume = nil}) | |
1354 | for i=0, 0.3, 0.1 / Animation_Speed do | |
1355 | Swait() | |
1356 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-45)), 1 / Animation_Speed) | |
1357 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(45)), 1 / Animation_Speed) | |
1358 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1359 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(100), RAD(0), RAD(-45)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1360 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1361 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.01) * ANGLES(RAD(0), RAD(-50), RAD(0)) * ANGLES(RAD(-1), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1362 | end | |
1363 | if AMMO <= 0 then | |
1364 | FIRING = false | |
1365 | end | |
1366 | SHOOTING = false | |
1367 | end | |
1368 | end) | |
1369 | repeat | |
1370 | Swait() | |
1371 | if SHOOTING == false then | |
1372 | TIMER = TIMER - 1 | |
1373 | if TIMER <= 0 then | |
1374 | FIRING = false | |
1375 | end | |
1376 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-45)), 1 / Animation_Speed) | |
1377 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(45)), 1 / Animation_Speed) | |
1378 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1379 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(-45)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1380 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1381 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.01) * ANGLES(RAD(0), RAD(-50), RAD(0)) * ANGLES(RAD(-1), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1382 | end | |
1383 | until FIRING == false and SHOOTING == false | |
1384 | MOUSE:Disconnect() | |
1385 | for i=0, 0.3, 0.1 / Animation_Speed do | |
1386 | Swait() | |
1387 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1388 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(25), RAD(0), RAD(15)), 1 / Animation_Speed) | |
1389 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1390 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.525, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(5)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1391 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1392 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1393 | end | |
1394 | GUNWELD.Part0 = Torso | |
1395 | GUNWELD.C0 = CF(-1.1,-1.1,0) * ANGLES(RAD(0), RAD(90), RAD(-90)) | |
1396 | Speed = 20 | |
1397 | ATTACK = false | |
1398 | Rooted = false | |
1399 | end | |
1400 | ||
1401 | function ee() | |
1402 | ATTACK = true | |
1403 | Rooted = true | |
1404 | for i=0, 1, 0.1 / Animation_Speed do | |
1405 | Swait() | |
1406 | 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) | |
1407 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1.25*SIZE) - 1)) * ANGLES(RAD(35), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1408 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.3*SIZE, 0.5*SIZE, 0) * ANGLES(RAD(0), RAD(0), RAD(200)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1409 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.3*SIZE, 0.5*SIZE, 0) * ANGLES(RAD(0), RAD(0), RAD(-200)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1410 | RightHip.C0 = Clerp(RightHip.C0, CF(1*SIZE, -1*SIZE - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1411 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1*SIZE, -1*SIZE - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1412 | end | |
1413 | CameraEnshaking(1,45) | |
1414 | CreateSound(363808674, Torso, 6, 1, false) | |
1415 | for i=0, 0.5, 0.1 / Animation_Speed do | |
1416 | Swait() | |
1417 | 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) | |
1418 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1.25*SIZE) - 1)) * ANGLES(RAD(35), RAD(0), RAD(25)), 1 / Animation_Speed) | |
1419 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.3*SIZE, 0.5*SIZE, 0) * ANGLES(RAD(-40), RAD(50), RAD(200)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1420 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.3*SIZE, 0.5*SIZE, 0) * ANGLES(RAD(40), RAD(50), RAD(-200)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1421 | RightHip.C0 = Clerp(RightHip.C0, CF(1*SIZE, -1*SIZE - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1422 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1*SIZE, -1*SIZE - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1423 | end | |
1424 | CameraEnshaking(1,45) | |
1425 | CreateSound(363808674, Torso, 6, 1, false) | |
1426 | for i=0, 0.5, 0.1 / Animation_Speed do | |
1427 | Swait() | |
1428 | 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) | |
1429 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1.25*SIZE) - 1)) * ANGLES(RAD(35), RAD(0), RAD(-25)), 1 / Animation_Speed) | |
1430 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.3*SIZE, 0.5*SIZE, 0) * ANGLES(RAD(40), RAD(-50), RAD(200)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1431 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.3*SIZE, 0.5*SIZE, 0) * ANGLES(RAD(-40), RAD(-50), RAD(-200)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1432 | RightHip.C0 = Clerp(RightHip.C0, CF(1*SIZE, -1*SIZE - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1433 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1*SIZE, -1*SIZE - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-83), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed) | |
1434 | end | |
1435 | ATTACK = false | |
1436 | Rooted = false | |
1437 | end | |
1438 | ||
1439 | --//=================================\\ | |
1440 | --|| ASSIGN THINGS TO KEYS | |
1441 | --\\=================================// | |
1442 | ||
1443 | function MouseDown(Mouse) | |
1444 | HOLD = true | |
1445 | if ATTACK == false then | |
1446 | Attack() | |
1447 | end | |
1448 | end | |
1449 | ||
1450 | function MouseUp(Mouse) | |
1451 | HOLD = false | |
1452 | end | |
1453 | ||
1454 | function KeyDown(Key) | |
1455 | KEYHOLD = true | |
1456 | if Key == "z" and ATTACK == false then | |
1457 | if CLOAKED == false then | |
1458 | Cloaked() | |
1459 | else | |
1460 | CLOAKED = false | |
1461 | end | |
1462 | end | |
1463 | ||
1464 | if Key == "t" and ATTACK == false then | |
1465 | Taunt() | |
1466 | end | |
1467 | ||
1468 | if Key == "y" and ATTACK == false then | |
1469 | ee() | |
1470 | end | |
1471 | ||
1472 | if Key == "q" and ATTACK == false then | |
1473 | Silence() | |
1474 | end | |
1475 | ||
1476 | if string.byte(Key) == 50 and ATTACK == false and CLOAKED == false then | |
1477 | if Speed == 12 then | |
1478 | Speed = 30 | |
1479 | elseif Speed == 30 then | |
1480 | Speed = 12 | |
1481 | end | |
1482 | end | |
1483 | end | |
1484 | ||
1485 | function KeyUp(Key) | |
1486 | KEYHOLD = false | |
1487 | end | |
1488 | ||
1489 | Mouse.Button1Down:connect(function(NEWKEY) | |
1490 | MouseDown(NEWKEY) | |
1491 | end) | |
1492 | Mouse.Button1Up:connect(function(NEWKEY) | |
1493 | MouseUp(NEWKEY) | |
1494 | end) | |
1495 | Mouse.KeyDown:connect(function(NEWKEY) | |
1496 | KeyDown(NEWKEY) | |
1497 | end) | |
1498 | Mouse.KeyUp:connect(function(NEWKEY) | |
1499 | KeyUp(NEWKEY) | |
1500 | end) | |
1501 | ||
1502 | --//=================================\\ | |
1503 | --\\=================================// | |
1504 | ||
1505 | function unanchor() | |
1506 | if UNANCHOR == true then | |
1507 | g = Character:GetChildren() | |
1508 | for i = 1, #g do | |
1509 | if g[i].ClassName == "Part" then | |
1510 | g[i].Anchored = false | |
1511 | end | |
1512 | end | |
1513 | end | |
1514 | end | |
1515 | ||
1516 | --//=================================\\ | |
1517 | --|| WRAP THE WHOLE SCRIPT UP | |
1518 | --\\=================================// | |
1519 | ||
1520 | Humanoid.Changed:connect(function(Jump) | |
1521 | if Jump == "Jump" and (Disable_Jump == true) then | |
1522 | Humanoid.Jump = false | |
1523 | end | |
1524 | end) | |
1525 | ||
1526 | while true do | |
1527 | Swait() | |
1528 | script.Parent = WEAPONGUI | |
1529 | ANIMATE.Parent = nil | |
1530 | for _,v in next, Humanoid:GetPlayingAnimationTracks() do | |
1531 | v:Stop(); | |
1532 | end | |
1533 | SINE = SINE + CHANGE | |
1534 | local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude | |
1535 | local TORSOVERTICALVELOCITY = RootPart.Velocity.y | |
1536 | local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character) | |
1537 | local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16) | |
1538 | if ANIM == "Walk" and TORSOVELOCITY > 1 then | |
1539 | 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) | |
1540 | 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) | |
1541 | 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.3 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1542 | 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.3 * (Humanoid.WalkSpeed / 16) / Animation_Speed) | |
1543 | elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then | |
1544 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1545 | 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) | |
1546 | 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) | |
1547 | 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) | |
1548 | end | |
1549 | if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then | |
1550 | ANIM = "Jump" | |
1551 | if PLAYANIMS == true then | |
1552 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1553 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1554 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(20)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
1555 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
1556 | 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) | |
1557 | 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) | |
1558 | end | |
1559 | elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then | |
1560 | ANIM = "Fall" | |
1561 | if PLAYANIMS == true then | |
1562 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1563 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1564 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(60)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
1565 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-60)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
1566 | 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) | |
1567 | 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) | |
1568 | end | |
1569 | elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then | |
1570 | ANIM = "Idle" | |
1571 | if PLAYANIMS == true then | |
1572 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1573 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1574 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(15), RAD(35), RAD(12)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed) | |
1575 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.15 / Animation_Speed) | |
1576 | 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)), 0.15 / Animation_Speed) | |
1577 | 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)), 0.15 / Animation_Speed) | |
1578 | end | |
1579 | elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then | |
1580 | ANIM = "Walk" | |
1581 | if PLAYANIMS == true then | |
1582 | if Humanoid.WalkSpeed <= 17 then | |
1583 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1584 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed) | |
1585 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(20 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(5)) * RIGHTSHOULDERC0, 0.35 / Animation_Speed) | |
1586 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-20 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(-5)) * LEFTSHOULDERC0, 0.35 / Animation_Speed) | |
1587 | RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 2 / Animation_Speed) | |
1588 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(15)), 2 / Animation_Speed) | |
1589 | else | |
1590 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1) * ANGLES(RAD(35), RAD(0), RAD(5 * SIN(SINE / (WALKSPEEDVALUE / 2)))), 0.15 / Animation_Speed) | |
1591 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-25 - 1 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(-5 * SIN(SINE / (WALKSPEEDVALUE / 2)))), 0.15 / Animation_Speed) | |
1592 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, -0.2) * ANGLES(RAD(0), RAD(35), RAD(0)) * ANGLES(RAD(35+20 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(5)) * RIGHTSHOULDERC0, 1 / Animation_Speed) | |
1593 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, -0.2) * ANGLES(RAD(0), RAD(-35), RAD(0)) * ANGLES(RAD(35-60 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(-5)) * LEFTSHOULDERC0, 1 / Animation_Speed) | |
1594 | RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(5)), 2 / Animation_Speed) | |
1595 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-5)), 2 / Animation_Speed) | |
1596 | end | |
1597 | end | |
1598 | end | |
1599 | BMUSIC.SoundId = "rbxassetid://"..SONGID | |
1600 | BMUSIC.Looped = true | |
1601 | BMUSIC.Pitch = PITCH | |
1602 | BMUSIC.Volume = VOLUME | |
1603 | BMUSIC.Playing = true | |
1604 | if BMUSIC.Parent ~= RootPart then | |
1605 | BMUSIC = IT("Sound",RootPart) | |
1606 | end | |
1607 | unanchor() | |
1608 | if Rooted == false then | |
1609 | Disable_Jump = false | |
1610 | Humanoid.WalkSpeed = Speed | |
1611 | elseif Rooted == true then | |
1612 | Disable_Jump = true | |
1613 | Humanoid.WalkSpeed = 0 | |
1614 | end | |
1615 | if Head:FindFirstChild("face") then | |
1616 | Head.face:remove() | |
1617 | elseif Head:FindFirstChildOfClass("Sound") then | |
1618 | Head:FindFirstChildOfClass("Sound"):remove() | |
1619 | end | |
1620 | Humanoid.Health = Humanoid.Health + 1 | |
1621 | end | |
1622 | ||
1623 | --//=================================\\ | |
1624 | --\\=================================// | |
1625 | ||
1626 | ||
1627 | ||
1628 | ||
1629 | ||
1630 | --//====================================================\\-- | |
1631 | --|| END OF SCRIPT | |
1632 | --\\====================================================//-- |