SHOW:
|
|
- or go back to the newest paste.
1 | ------------------------------ | |
2 | ||
3 | --Made by goodguyaiden-------- | |
4 | --Sassy Girl------------------ | |
5 | ||
6 | ------------------------------ | |
7 | ||
8 | wait(0.2) | |
9 | local Player = game:service'Players'.localPlayer | |
10 | local chara = Player.Character | |
11 | Player=game:GetService("Players").LocalPlayer | |
12 | Character=Player.Character | |
13 | PlayerGui=Player.PlayerGui | |
14 | Backpack=Player.Backpack | |
15 | Torso=Character.Torso | |
16 | Head=Character.Head | |
17 | Humanoid=Character.Humanoid | |
18 | m=Instance.new('Model',Character) | |
19 | LeftArm=Character["Left Arm"] | |
20 | LeftLeg=Character["Left Leg"] | |
21 | RightArm=Character["Right Arm"] | |
22 | RightLeg=Character["Right Leg"] | |
23 | LS=Torso["Left Shoulder"] | |
24 | LH=Torso["Left Hip"] | |
25 | RS=Torso["Right Shoulder"] | |
26 | RH=Torso["Right Hip"] | |
27 | Face = Head.face | |
28 | Neck=Torso.Neck | |
29 | it=Instance.new | |
30 | attacktype=1 | |
31 | vt=Vector3.new | |
32 | cf=CFrame.new | |
33 | cl3=Color3.new | |
34 | rgb=Color3.fromRGB | |
35 | bcn=BrickColor.new | |
36 | euler=CFrame.fromEulerAnglesXYZ | |
37 | angles=CFrame.Angles | |
38 | Humanoid.WalkSpeed = 16 | |
39 | Player = game:GetService("Players").LocalPlayer | |
40 | PlayerGui = Player.PlayerGui | |
41 | Cam = workspace.CurrentCamera | |
42 | Backpack = Player.Backpack | |
43 | Character = Player.Character | |
44 | Humanoid = Character.Humanoid | |
45 | Mouse = Player:GetMouse() | |
46 | RootPart = Character["HumanoidRootPart"] | |
47 | Torso = Character["Torso"] | |
48 | Head = Character["Head"] | |
49 | RightArm = Character["Right Arm"] | |
50 | LeftArm = Character["Left Arm"] | |
51 | RightLeg = Character["Right Leg"] | |
52 | LeftLeg = Character["Left Leg"] | |
53 | RootJoint = RootPart["RootJoint"] | |
54 | Neck = Torso["Neck"] | |
55 | RightShoulder = Torso["Right Shoulder"] | |
56 | LeftShoulder = Torso["Left Shoulder"] | |
57 | RightHip = Torso["Right Hip"] | |
58 | LeftHip = Torso["Left Hip"] | |
59 | local Player = game:service'Players'.localPlayer | |
60 | local chara = Player.Character | |
61 | ||
62 | - | shirt= Instance.new("Shirt", Character) |
62 | + | |
63 | - | shirt.Name = "Shirt" |
63 | + | |
64 | - | pants = Instance.new("Pants", Character) |
64 | + | |
65 | - | pants.Name = "Pants" |
65 | + | |
66 | - | chara.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=0" |
66 | + | |
67 | - | chara.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=405297110" |
67 | + | |
68 | IT = Instance.new | |
69 | CF = CFrame.new | |
70 | VT = Vector3.new | |
71 | RAD = math.rad | |
72 | C3 = Color3.new | |
73 | UD2 = UDim2.new | |
74 | BRICKC = BrickColor.new | |
75 | ANGLES = CFrame.Angles | |
76 | EULER = CFrame.fromEulerAnglesXYZ | |
77 | COS = math.cos | |
78 | ACOS = math.acos | |
79 | SIN = math.sin | |
80 | ASIN = math.asin | |
81 | ABS = math.abs | |
82 | MRANDOM = math.random | |
83 | FLOOR = math.floor | |
84 | Animation_Speed = 3 | |
85 | Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60) | |
86 | local Speed = 12 | |
87 | local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
88 | local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) | |
89 | local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) | |
90 | local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) | |
91 | local DAMAGEMULTIPLIER = 1 | |
92 | local ANIM = "Idle" | |
93 | local ATTACK = false | |
94 | local EQUIPPED = false | |
95 | local HOLD = false | |
96 | local COMBO = 1 | |
97 | local Rooted = false | |
98 | local SINE = 0 | |
99 | local KEYHOLD = false | |
100 | local CHANGE = 2 / Animation_Speed | |
101 | local WALKINGANIM = false | |
102 | local VALUE1 = false | |
103 | local VALUE2 = false | |
104 | local ROBLOXIDLEANIMATION = IT("Animation") | |
105 | ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation" | |
106 | ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571" | |
107 | --ROBLOXIDLEANIMATION.Parent = Humanoid | |
108 | local WEAPONGUI = IT("ScreenGui", PlayerGui) | |
109 | WEAPONGUI.Name = "Weapon GUI" | |
110 | local Weapon = IT("Model") | |
111 | Weapon.Name = "Adds" | |
112 | local Effects = IT("Folder", Weapon) | |
113 | Effects.Name = "Effects" | |
114 | local ANIMATOR = Humanoid.Animator | |
115 | local ANIMATE = Character.Animate | |
116 | local UNANCHOR = true | |
117 | local PLAYANIMS = true | |
118 | ArtificialHB = Instance.new("BindableEvent", script) | |
119 | ArtificialHB.Name = "ArtificialHB" | |
120 | ||
121 | script:WaitForChild("ArtificialHB") | |
122 | ||
123 | frame = Frame_Speed | |
124 | tf = 0 | |
125 | allowframeloss = false | |
126 | tossremainder = false | |
127 | lastframe = tick() | |
128 | script.ArtificialHB:Fire() | |
129 | ||
130 | function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS) | |
131 | return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS) | |
132 | end | |
133 | ||
134 | function PositiveAngle(NUMBER) | |
135 | if NUMBER >= 0 then | |
136 | NUMBER = 0 | |
137 | end | |
138 | return NUMBER | |
139 | end | |
140 | ||
141 | function NegativeAngle(NUMBER) | |
142 | if NUMBER <= 0 then | |
143 | NUMBER = 0 | |
144 | end | |
145 | return NUMBER | |
146 | end | |
147 | ||
148 | function Swait(NUMBER) | |
149 | if NUMBER == 0 or NUMBER == nil then | |
150 | ArtificialHB.Event:wait() | |
151 | else | |
152 | for i = 1, NUMBER do | |
153 | ArtificialHB.Event:wait() | |
154 | end | |
155 | end | |
156 | end | |
157 | ||
158 | function QuaternionFromCFrame(cf) | |
159 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
160 | local trace = m00 + m11 + m22 | |
161 | if trace > 0 then | |
162 | local s = math.sqrt(1 + trace) | |
163 | local recip = 0.5 / s | |
164 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
165 | else | |
166 | local i = 0 | |
167 | if m11 > m00 then | |
168 | i = 1 | |
169 | end | |
170 | if m22 > (i == 0 and m00 or m11) then | |
171 | i = 2 | |
172 | end | |
173 | if i == 0 then | |
174 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
175 | local recip = 0.5 / s | |
176 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
177 | elseif i == 1 then | |
178 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
179 | local recip = 0.5 / s | |
180 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
181 | elseif i == 2 then | |
182 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
183 | local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
184 | end | |
185 | end | |
186 | end | |
187 | ||
188 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
189 | local xs, ys, zs = x + x, y + y, z + z | |
190 | local wx, wy, wz = w * xs, w * ys, w * zs | |
191 | local xx = x * xs | |
192 | local xy = x * ys | |
193 | local xz = x * zs | |
194 | local yy = y * ys | |
195 | local yz = y * zs | |
196 | local zz = z * zs | |
197 | 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)) | |
198 | end | |
199 | ||
200 | function QuaternionSlerp(a, b, t) | |
201 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
202 | local startInterp, finishInterp; | |
203 | if cosTheta >= 0.0001 then | |
204 | if (1 - cosTheta) > 0.0001 then | |
205 | local theta = ACOS(cosTheta) | |
206 | local invSinTheta = 1 / SIN(theta) | |
207 | startInterp = SIN((1 - t) * theta) * invSinTheta | |
208 | finishInterp = SIN(t * theta) * invSinTheta | |
209 | else | |
210 | startInterp = 1 - t | |
211 | finishInterp = t | |
212 | end | |
213 | else | |
214 | if (1 + cosTheta) > 0.0001 then | |
215 | local theta = ACOS(-cosTheta) | |
216 | local invSinTheta = 1 / SIN(theta) | |
217 | startInterp = SIN((t - 1) * theta) * invSinTheta | |
218 | finishInterp = SIN(t * theta) * invSinTheta | |
219 | else | |
220 | startInterp = t - 1 | |
221 | finishInterp = t | |
222 | end | |
223 | end | |
224 | 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 | |
225 | end | |
226 | ||
227 | function Clerp(a, b, t) | |
228 | local qa = {QuaternionFromCFrame(a)} | |
229 | local qb = {QuaternionFromCFrame(b)} | |
230 | local ax, ay, az = a.x, a.y, a.z | |
231 | local bx, by, bz = b.x, b.y, b.z | |
232 | local _t = 1 - t | |
233 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
234 | end | |
235 | ||
236 | function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME) | |
237 | local frame = IT("Frame") | |
238 | frame.BackgroundTransparency = TRANSPARENCY | |
239 | frame.BorderSizePixel = BORDERSIZEPIXEL | |
240 | frame.Position = POSITION | |
241 | frame.Size = SIZE | |
242 | frame.BackgroundColor3 = COLOR | |
243 | frame.BorderColor3 = BORDERCOLOR | |
244 | frame.Name = NAME | |
245 | frame.Parent = PARENT | |
246 | return frame | |
247 | end | |
248 | ||
249 | function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME) | |
250 | local label = IT("TextLabel") | |
251 | label.BackgroundTransparency = 1 | |
252 | label.Size = UD2(1, 0, 1, 0) | |
253 | label.Position = UD2(0, 0, 0, 0) | |
254 | label.TextColor3 = TEXTCOLOR | |
255 | label.TextStrokeTransparency = STROKETRANSPARENCY | |
256 | label.TextTransparency = TRANSPARENCY | |
257 | label.FontSize = TEXTFONTSIZE | |
258 | label.Font = TEXTFONT | |
259 | label.BorderSizePixel = BORDERSIZEPIXEL | |
260 | label.TextScaled = false | |
261 | label.Text = TEXT | |
262 | label.Name = NAME | |
263 | label.Parent = PARENT | |
264 | return label | |
265 | end | |
266 | ||
267 | function NoOutlines(PART) | |
268 | PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10 | |
269 | end | |
270 | ||
271 | ||
272 | function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1) | |
273 | local NEWWELD = IT(TYPE) | |
274 | NEWWELD.Part0 = PART0 | |
275 | NEWWELD.Part1 = PART1 | |
276 | NEWWELD.C0 = C0 | |
277 | NEWWELD.C1 = C1 | |
278 | NEWWELD.Parent = PARENT | |
279 | return NEWWELD | |
280 | end | |
281 | ||
282 | local S = IT("Sound") | |
283 | ||
284 | function CreateSound(ID, PARENT, VOLUME, PITCH) | |
285 | local NEWSOUND = nil | |
286 | coroutine.resume(coroutine.create(function() | |
287 | NEWSOUND = S:Clone() | |
288 | NEWSOUND.Parent = PARENT | |
289 | NEWSOUND.Volume = VOLUME | |
290 | NEWSOUND.Pitch = PITCH | |
291 | NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID | |
292 | Swait() | |
293 | NEWSOUND:play() | |
294 | game:GetService("Debris"):AddItem(NEWSOUND, 10) | |
295 | end)) | |
296 | return NEWSOUND | |
297 | end | |
298 | ||
299 | function CFrameFromTopBack(at, top, back) | |
300 | local right = top:Cross(back) | |
301 | 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) | |
302 | end | |
303 | ||
304 | function CreateWave(SIZE,WAIT,CFRAME,DOESROT,ROT,COLOR,GROW) | |
305 | local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(0,0,0)) | |
306 | local mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8)) | |
307 | wave.CFrame = CFRAME | |
308 | coroutine.resume(coroutine.create(function(PART) | |
309 | for i = 1, WAIT do | |
310 | Swait() | |
311 | mesh.Scale = mesh.Scale + GROW | |
312 | mesh.Offset = VT(0,0,-(mesh.Scale.X/8)) | |
313 | if DOESROT == true then | |
314 | wave.CFrame = wave.CFrame * CFrame.fromEulerAnglesXYZ(0,ROT,0) | |
315 | end | |
316 | wave.Transparency = wave.Transparency + (0.5/WAIT) | |
317 | if wave.Transparency > 0.99 then | |
318 | wave:remove() | |
319 | end | |
320 | end | |
321 | end)) | |
322 | end | |
323 | ||
324 | function CreateRing(SIZE,DOESROT,ROT,WAIT,CFRAME,COLOR,GROW) | |
325 | local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(0,0,0)) | |
326 | local mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "559831844", "", SIZE, VT(0,0,0)) | |
327 | wave.CFrame = CFRAME | |
328 | coroutine.resume(coroutine.create(function(PART) | |
329 | for i = 1, WAIT do | |
330 | Swait() | |
331 | mesh.Scale = mesh.Scale + GROW | |
332 | if DOESROT == true then | |
333 | wave.CFrame = wave.CFrame * CFrame.fromEulerAnglesXYZ(0,ROT,0) | |
334 | end | |
335 | wave.Transparency = wave.Transparency + (0.5/WAIT) | |
336 | if wave.Transparency > 0.99 then | |
337 | wave:remove() | |
338 | end | |
339 | end | |
340 | end)) | |
341 | end | |
342 | ||
343 | function MagicSphere(SIZE,WAIT,CFRAME,COLOR,GROW) | |
344 | local wave = CreatePart(3, Effects, "Neon", 0, 0, BRICKC(COLOR), "Effect", VT(1,1,1), true) | |
345 | local mesh = CreateMesh("SpecialMesh", wave, "Sphere", "", "", SIZE, VT(0,0,0)) | |
346 | wave.CFrame = CFRAME | |
347 | coroutine.resume(coroutine.create(function(PART) | |
348 | for i = 1, WAIT do | |
349 | Swait() | |
350 | mesh.Scale = mesh.Scale + GROW | |
351 | wave.Transparency = wave.Transparency + (1/WAIT) | |
352 | if wave.Transparency > 0.99 then | |
353 | wave:remove() | |
354 | end | |
355 | end | |
356 | end)) | |
357 | end | |
358 | ||
359 | function Slice(KIND,SIZE,WAIT,CFRAME,COLOR,GROW) | |
360 | local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(1,1,1), true) | |
361 | local mesh = nil | |
362 | if KIND == "Base" then | |
363 | mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "448386996", "", VT(0,SIZE/10,SIZE/10), VT(0,0,0)) | |
364 | elseif KIND == "Thin" then | |
365 | mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "662586858", "", VT(SIZE/10,0,SIZE/10), VT(0,0,0)) | |
366 | elseif KIND == "Round" then | |
367 | mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "662585058", "", VT(SIZE/10,0,SIZE/10), VT(0,0,0)) | |
368 | end | |
369 | wave.CFrame = CFRAME | |
370 | coroutine.resume(coroutine.create(function(PART) | |
371 | for i = 1, WAIT do | |
372 | Swait() | |
373 | mesh.Scale = mesh.Scale + GROW/10 | |
374 | wave.Transparency = wave.Transparency + (0.5/WAIT) | |
375 | if wave.Transparency > 0.99 then | |
376 | wave:remove() | |
377 | end | |
378 | end | |
379 | end)) | |
380 | end | |
381 | ||
382 | function MakeForm(PART,TYPE) | |
383 | if TYPE == "Cyl" then | |
384 | local MSH = IT("CylinderMesh",PART) | |
385 | elseif TYPE == "Ball" then | |
386 | local MSH = IT("SpecialMesh",PART) | |
387 | MSH.MeshType = "Sphere" | |
388 | elseif TYPE == "Wedge" then | |
389 | local MSH = IT("SpecialMesh",PART) | |
390 | MSH.MeshType = "Wedge" | |
391 | end | |
392 | end | |
393 | ||
394 | ||
395 | function CheckTableForString(Table, String) | |
396 | for i, v in pairs(Table) do | |
397 | if string.find(string.lower(String), string.lower(v)) then | |
398 | return true | |
399 | end | |
400 | end | |
401 | return false | |
402 | end | |
403 | ||
404 | function CheckIntangible(Hit) | |
405 | local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Lightning", "Bullet"} | |
406 | if Hit and Hit.Parent then | |
407 | if ((not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then | |
408 | return true | |
409 | end | |
410 | end | |
411 | return false | |
412 | end | |
413 | ||
414 | Debris = game:GetService("Debris") | |
415 | ||
416 | function CastZapRay(StartPos, Vec, Length, Ignore, DelayIfHit) | |
417 | local Direction = CFrame.new(StartPos, Vec).lookVector | |
418 | local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore}) | |
419 | local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Direction * Length), Ignore) | |
420 | if RayHit and CheckIntangible(RayHit) then | |
421 | if DelayIfHit then | |
422 | wait() | |
423 | end | |
424 | RayHit, RayPos, RayNormal = CastZapRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit) | |
425 | end | |
426 | return RayHit, RayPos, RayNormal | |
427 | end | |
428 | ||
429 | function turnto(position) | |
430 | RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0) | |
431 | end | |
432 | ||
433 | ||
434 | ||
435 | game:GetService("RunService").Heartbeat:connect(function(s, p) | |
436 | tf = tf + s | |
437 | if tf >= frame then | |
438 | if allowframeloss then | |
439 | script.ArtificialHB:Fire() | |
440 | lastframe = tick() | |
441 | else | |
442 | for i = 1, math.floor(tf / frame) do | |
443 | script.ArtificialHB:Fire() | |
444 | end | |
445 | lastframe = tick() | |
446 | end | |
447 | if tossremainder then | |
448 | tf = 0 | |
449 | else | |
450 | tf = tf - frame * math.floor(tf / frame) | |
451 | end | |
452 | end | |
453 | end) | |
454 | function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS) | |
455 | return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS) | |
456 | end | |
457 | ||
458 | function PositiveAngle(NUMBER) | |
459 | if NUMBER >= 0 then | |
460 | NUMBER = 0 | |
461 | end | |
462 | return NUMBER | |
463 | end | |
464 | ||
465 | function NegativeAngle(NUMBER) | |
466 | if NUMBER <= 0 then | |
467 | NUMBER = 0 | |
468 | end | |
469 | return NUMBER | |
470 | end | |
471 | ||
472 | function Swait(NUMBER) | |
473 | if NUMBER == 0 or NUMBER == nil then | |
474 | ArtificialHB.Event:wait() | |
475 | else | |
476 | for i = 1, NUMBER do | |
477 | ArtificialHB.Event:wait() | |
478 | end | |
479 | end | |
480 | end | |
481 | ||
482 | function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET) | |
483 | local NEWMESH = IT(MESH) | |
484 | if MESH == "SpecialMesh" then | |
485 | NEWMESH.MeshType = MESHTYPE | |
486 | if MESHID ~= "nil" and MESHID ~= "" then | |
487 | NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID | |
488 | end | |
489 | if TEXTUREID ~= "nil" and TEXTUREID ~= "" then | |
490 | NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID | |
491 | end | |
492 | end | |
493 | NEWMESH.Offset = OFFSET or VT(0, 0, 0) | |
494 | NEWMESH.Scale = SCALE | |
495 | NEWMESH.Parent = PARENT | |
496 | return NEWMESH | |
497 | end | |
498 | ||
499 | function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR) | |
500 | local NEWPART = IT("Part") | |
501 | NEWPART.formFactor = FORMFACTOR | |
502 | NEWPART.Reflectance = REFLECTANCE | |
503 | NEWPART.Transparency = TRANSPARENCY | |
504 | NEWPART.CanCollide = false | |
505 | NEWPART.Locked = true | |
506 | NEWPART.Anchored = true | |
507 | if ANCHOR == false then | |
508 | NEWPART.Anchored = false | |
509 | end | |
510 | NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR)) | |
511 | NEWPART.Name = NAME | |
512 | NEWPART.Size = SIZE | |
513 | NEWPART.Position = Torso.Position | |
514 | NEWPART.Material = MATERIAL | |
515 | NEWPART:BreakJoints() | |
516 | NEWPART.Parent = PARENT | |
517 | return NEWPART | |
518 | end | |
519 | ||
520 | local function weldBetween(a, b) | |
521 | local weldd = Instance.new("ManualWeld") | |
522 | weldd.Part0 = a | |
523 | weldd.Part1 = b | |
524 | weldd.C0 = CFrame.new() | |
525 | weldd.C1 = b.CFrame:inverse() * a.CFrame | |
526 | weldd.Parent = a | |
527 | return weldd | |
528 | end | |
529 | ||
530 | ||
531 | function QuaternionFromCFrame(cf) | |
532 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
533 | local trace = m00 + m11 + m22 | |
534 | if trace > 0 then | |
535 | local s = math.sqrt(1 + trace) | |
536 | local recip = 0.5 / s | |
537 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
538 | else | |
539 | local i = 0 | |
540 | if m11 > m00 then | |
541 | i = 1 | |
542 | end | |
543 | if m22 > (i == 0 and m00 or m11) then | |
544 | i = 2 | |
545 | end | |
546 | if i == 0 then | |
547 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
548 | local recip = 0.5 / s | |
549 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
550 | elseif i == 1 then | |
551 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
552 | local recip = 0.5 / s | |
553 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
554 | elseif i == 2 then | |
555 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
556 | local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
557 | end | |
558 | end | |
559 | end | |
560 | ||
561 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
562 | local xs, ys, zs = x + x, y + y, z + z | |
563 | local wx, wy, wz = w * xs, w * ys, w * zs | |
564 | local xx = x * xs | |
565 | local xy = x * ys | |
566 | local xz = x * zs | |
567 | local yy = y * ys | |
568 | local yz = y * zs | |
569 | local zz = z * zs | |
570 | 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)) | |
571 | end | |
572 | ||
573 | function QuaternionSlerp(a, b, t) | |
574 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
575 | local startInterp, finishInterp; | |
576 | if cosTheta >= 0.0001 then | |
577 | if (1 - cosTheta) > 0.0001 then | |
578 | local theta = ACOS(cosTheta) | |
579 | local invSinTheta = 1 / SIN(theta) | |
580 | startInterp = SIN((1 - t) * theta) * invSinTheta | |
581 | finishInterp = SIN(t * theta) * invSinTheta | |
582 | else | |
583 | startInterp = 1 - t | |
584 | finishInterp = t | |
585 | end | |
586 | else | |
587 | if (1 + cosTheta) > 0.0001 then | |
588 | local theta = ACOS(-cosTheta) | |
589 | local invSinTheta = 1 / SIN(theta) | |
590 | startInterp = SIN((t - 1) * theta) * invSinTheta | |
591 | finishInterp = SIN(t * theta) * invSinTheta | |
592 | else | |
593 | startInterp = t - 1 | |
594 | finishInterp = t | |
595 | end | |
596 | end | |
597 | 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 | |
598 | end | |
599 | ||
600 | function Clerp(a, b, t) | |
601 | local qa = {QuaternionFromCFrame(a)} | |
602 | local qb = {QuaternionFromCFrame(b)} | |
603 | local ax, ay, az = a.x, a.y, a.z | |
604 | local bx, by, bz = b.x, b.y, b.z | |
605 | local _t = 1 - t | |
606 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
607 | end | |
608 | ||
609 | function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME) | |
610 | local frame = IT("Frame") | |
611 | frame.BackgroundTransparency = TRANSPARENCY | |
612 | frame.BorderSizePixel = BORDERSIZEPIXEL | |
613 | frame.Position = POSITION | |
614 | frame.Size = SIZE | |
615 | frame.BackgroundColor3 = COLOR | |
616 | frame.BorderColor3 = BORDERCOLOR | |
617 | frame.Name = NAME | |
618 | frame.Parent = PARENT | |
619 | return frame | |
620 | end | |
621 | ||
622 | function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME) | |
623 | local label = IT("TextLabel") | |
624 | label.BackgroundTransparency = 1 | |
625 | label.Size = UD2(1, 0, 1, 0) | |
626 | label.Position = UD2(0, 0, 0, 0) | |
627 | label.TextColor3 = TEXTCOLOR | |
628 | label.TextStrokeTransparency = STROKETRANSPARENCY | |
629 | label.TextTransparency = TRANSPARENCY | |
630 | label.FontSize = TEXTFONTSIZE | |
631 | label.Font = TEXTFONT | |
632 | label.BorderSizePixel = BORDERSIZEPIXEL | |
633 | label.TextScaled = false | |
634 | label.Text = TEXT | |
635 | label.Name = NAME | |
636 | label.Parent = PARENT | |
637 | return label | |
638 | end | |
639 | ||
640 | function NoOutlines(PART) | |
641 | PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10 | |
642 | end | |
643 | ||
644 | function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1) | |
645 | local NEWWELD = IT(TYPE) | |
646 | NEWWELD.Part0 = PART0 | |
647 | NEWWELD.Part1 = PART1 | |
648 | NEWWELD.C0 = C0 | |
649 | NEWWELD.C1 = C1 | |
650 | NEWWELD.Parent = PARENT | |
651 | return NEWWELD | |
652 | end | |
653 | ||
654 | local S = IT("Sound") | |
655 | function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP) | |
656 | local NEWSOUND = nil | |
657 | coroutine.resume(coroutine.create(function() | |
658 | NEWSOUND = S:Clone() | |
659 | NEWSOUND.Parent = PARENT | |
660 | NEWSOUND.Volume = VOLUME | |
661 | NEWSOUND.Pitch = PITCH | |
662 | NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID | |
663 | NEWSOUND:play() | |
664 | if DOESLOOP == true then | |
665 | NEWSOUND.Looped = true | |
666 | else | |
667 | repeat wait(1) until NEWSOUND.Playing == false | |
668 | NEWSOUND:remove() | |
669 | end | |
670 | end)) | |
671 | return NEWSOUND | |
672 | end | |
673 | ||
674 | function MakeForm(PART,TYPE) | |
675 | if TYPE == "Cyl" then | |
676 | local MSH = IT("CylinderMesh",PART) | |
677 | elseif TYPE == "Ball" then | |
678 | local MSH = IT("SpecialMesh",PART) | |
679 | MSH.MeshType = "Sphere" | |
680 | elseif TYPE == "Wedge" then | |
681 | local MSH = IT("SpecialMesh",PART) | |
682 | MSH.MeshType = "Wedge" | |
683 | end | |
684 | end | |
685 | ||
686 | function CFrameFromTopBack(at, top, back) | |
687 | local right = top:Cross(back) | |
688 | 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) | |
689 | end | |
690 | ||
691 | function PuddleOfBlood(Position,MaxDrop,Model,MaxSize) | |
692 | local HITFLOOR, HITPOS, NORMAL = Raycast(Position, (CF(Position, Position + VT(0, -1, 0))).lookVector, MaxDrop, Model) | |
693 | if HITFLOOR ~= nil then | |
694 | if HITFLOOR.Parent ~= Weapon and HITFLOOR.Parent ~= Character then | |
695 | if HITFLOOR.Name == "BloodPuddle" then | |
696 | local DIST = (Position - HITFLOOR.Position).Magnitude | |
697 | 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 | |
698 | HITFLOOR.Size = HITFLOOR.Size + VT(0.1,0,0.1) | |
699 | end | |
700 | else | |
701 | if HITFLOOR.Anchored == true then | |
702 | local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(2,0,2)) | |
703 | BLOOD.CFrame = CF(HITPOS,HITPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0)) | |
704 | MakeForm(BLOOD,"Cyl") | |
705 | coroutine.resume(coroutine.create(function() | |
706 | Swait(75) | |
707 | while true do | |
708 | Swait() | |
709 | BLOOD.Size = BLOOD.Size - VT(0.02,0,0.02) | |
710 | if BLOOD.Size.Z < 0.051 then | |
711 | BLOOD:remove() | |
712 | break | |
713 | end | |
714 | end | |
715 | end)) | |
716 | end | |
717 | end | |
718 | end | |
719 | end | |
720 | end | |
721 | ||
722 | function SprayBlood(POSITION,DIRECTION,BloodSize) | |
723 | local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(0.3,0.3,0.3),false) | |
724 | BLOOD.CFrame = CF(POSITION) | |
725 | MakeForm(BLOOD,"Ball") | |
726 | local bv = Instance.new("BodyVelocity",BLOOD) | |
727 | bv.maxForce = Vector3.new(1e9, 1e9, 1e9) | |
728 | bv.velocity = CF(POSITION,DIRECTION+VT(MRANDOM(-3,3)/30,MRANDOM(-3,3)/30,MRANDOM(-3,3)/30)).lookVector*75 | |
729 | bv.Name = "MOVE" | |
730 | Debris:AddItem(bv,0.05) | |
731 | coroutine.resume(coroutine.create(function() | |
732 | local HASTOUCHEDGROUND = false | |
733 | local HIT = BLOOD.Touched:Connect(function(hit) | |
734 | if hit.Anchored == true then | |
735 | HASTOUCHEDGROUND = true | |
736 | PuddleOfBlood(BLOOD.Position+VT(0,1,0),2,BLOOD,BloodSize) | |
737 | end | |
738 | end) | |
739 | wait(5) | |
740 | if HASTOUCHEDGROUND == false then | |
741 | BLOOD:remove() | |
742 | end | |
743 | end)) | |
744 | end | |
745 | ||
746 | Debris = game:GetService("Debris") | |
747 | ||
748 | function CastProperRay(StartPos, EndPos, Distance, Ignore) | |
749 | local DIRECTION = CF(StartPos,EndPos).lookVector | |
750 | return Raycast(StartPos, DIRECTION, Distance, Ignore) | |
751 | end | |
752 | ||
753 | function turnto(position) | |
754 | RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0) | |
755 | end | |
756 | ||
757 | function recurse(root,callback,i) | |
758 | i= i or 0 | |
759 | for _,v in pairs(root:GetChildren()) do | |
760 | i = i + 1 | |
761 | callback(i,v) | |
762 | ||
763 | if #v:GetChildren() > 0 then | |
764 | i = recurse(v,callback,i) | |
765 | end | |
766 | end | |
767 | ||
768 | return i | |
769 | end | |
770 | ||
771 | function ragdollJoint(character, part0, part1, attachmentName, className, properties) | |
772 | attachmentName = attachmentName.."RigAttachment" | |
773 | local constraint = Instance.new(className.."Constraint") | |
774 | constraint.Attachment0 = part0:FindFirstChild(attachmentName) | |
775 | constraint.Attachment1 = part1:FindFirstChild(attachmentName) | |
776 | constraint.Name = "RagdollConstraint"..part1.Name | |
777 | ||
778 | for _,propertyData in next,properties or {} do | |
779 | constraint[propertyData[1]] = propertyData[2] | |
780 | end | |
781 | ||
782 | constraint.Parent = character | |
783 | end | |
784 | ||
785 | function getAttachment0(character, attachmentName) | |
786 | for _,child in next,character:GetChildren() do | |
787 | local attachment = child:FindFirstChild(attachmentName) | |
788 | if attachment then | |
789 | return attachment | |
790 | end | |
791 | end | |
792 | end | |
793 | ||
794 | function R15Ragdoll(character) | |
795 | recurse(character, function(_,v) | |
796 | if v:IsA("Attachment") then | |
797 | v.Axis = Vector3.new(0, 1, 0) | |
798 | v.SecondaryAxis = Vector3.new(0, 0, 1) | |
799 | v.Rotation = Vector3.new(0, 0, 0) | |
800 | end | |
801 | end) | |
802 | for _,child in next,character:GetChildren() do | |
803 | if child:IsA("Accoutrement") then | |
804 | for _,part in next,child:GetChildren() do | |
805 | if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then | |
806 | local attachment1 = part:FindFirstChildOfClass("Attachment") | |
807 | local attachment0 = getAttachment0(character,attachment1.Name) | |
808 | if attachment0 and attachment1 then | |
809 | local constraint = Instance.new("HingeConstraint") | |
810 | constraint.Attachment0 = attachment0 | |
811 | constraint.Attachment1 = attachment1 | |
812 | constraint.LimitsEnabled = true | |
813 | constraint.UpperAngle = 0 | |
814 | constraint.LowerAngle = 0 | |
815 | constraint.Parent = character | |
816 | end | |
817 | elseif part.Name == "HumanoidRootPart" then | |
818 | part:remove() | |
819 | end | |
820 | end | |
821 | end | |
822 | end | |
823 | ||
824 | ragdollJoint(character,character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", { | |
825 | {"LimitsEnabled",true}; | |
826 | {"UpperAngle",5}; | |
827 | }) | |
828 | ragdollJoint(character,character.UpperTorso, character.Head, "Neck", "BallSocket", { | |
829 | {"LimitsEnabled",true}; | |
830 | {"UpperAngle",15}; | |
831 | }) | |
832 | ||
833 | local handProperties = { | |
834 | {"LimitsEnabled", true}; | |
835 | {"UpperAngle",0}; | |
836 | {"LowerAngle",0}; | |
837 | } | |
838 | ragdollJoint(character,character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties) | |
839 | ragdollJoint(character,character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties) | |
840 | ||
841 | local shinProperties = { | |
842 | {"LimitsEnabled", true}; | |
843 | {"UpperAngle", 0}; | |
844 | {"LowerAngle", -75}; | |
845 | } | |
846 | ragdollJoint(character,character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties) | |
847 | ragdollJoint(character,character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties) | |
848 | ||
849 | local footProperties = { | |
850 | {"LimitsEnabled", true}; | |
851 | {"UpperAngle", 15}; | |
852 | {"LowerAngle", -45}; | |
853 | } | |
854 | ragdollJoint(character,character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties) | |
855 | ragdollJoint(character,character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties) | |
856 | ||
857 | ragdollJoint(character,character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket") | |
858 | ragdollJoint(character,character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket") | |
859 | ragdollJoint(character,character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket") | |
860 | ragdollJoint(character,character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket") | |
861 | ragdollJoint(character,character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket") | |
862 | ragdollJoint(character,character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket") | |
863 | end | |
864 | ||
865 | function Ragdoll(Character2,CharTorso) | |
866 | Character2:BreakJoints() | |
867 | local hum = Character2:findFirstChild("Humanoid") | |
868 | hum:remove() | |
869 | local function Scan(ch) | |
870 | local e | |
871 | for e = 1,#ch do | |
872 | Scan(ch[e]:GetChildren()) | |
873 | if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then | |
874 | ch[e]:remove() | |
875 | end | |
876 | end | |
877 | end | |
878 | local NEWHUM = IT("Humanoid") | |
879 | NEWHUM.Name = "Corpse" | |
880 | NEWHUM.Health = 0 | |
881 | NEWHUM.MaxHealth = 0 | |
882 | NEWHUM.PlatformStand = true | |
883 | NEWHUM.Parent = Character2 | |
884 | NEWHUM.DisplayDistanceType = "None" | |
885 | ||
886 | local ch = Character2:GetChildren() | |
887 | local i | |
888 | for i = 1,#ch do | |
889 | if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then | |
890 | ch[i]:remove() | |
891 | end | |
892 | end | |
893 | ||
894 | local Torso2 = Character2.Torso | |
895 | local movevector = Vector3.new() | |
896 | ||
897 | if Torso2 then | |
898 | movevector = CFrame.new(CharTorso.Position,Torso2.Position).lookVector | |
899 | local Head = Character2:FindFirstChild("Head") | |
900 | if Head then | |
901 | local Neck = Instance.new("Weld") | |
902 | Neck.Name = "Neck" | |
903 | Neck.Part0 = Torso2 | |
904 | Neck.Part1 = Head | |
905 | Neck.C0 = CFrame.new(0, 1.5, 0) | |
906 | Neck.C1 = CFrame.new() | |
907 | Neck.Parent = Torso2 | |
908 | ||
909 | end | |
910 | local Limb = Character2:FindFirstChild("Right Arm") | |
911 | if Limb then | |
912 | ||
913 | Limb.CFrame = Torso2.CFrame * CFrame.new(1.5, 0, 0) | |
914 | local Joint = Instance.new("Glue") | |
915 | Joint.Name = "RightShoulder" | |
916 | Joint.Part0 = Torso2 | |
917 | Joint.Part1 = Limb | |
918 | Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
919 | Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
920 | Joint.Parent = Torso2 | |
921 | ||
922 | local B = Instance.new("Part") | |
923 | B.TopSurface = 0 | |
924 | B.BottomSurface = 0 | |
925 | B.formFactor = "Symmetric" | |
926 | B.Size = Vector3.new(1, 1, 1) | |
927 | B.Transparency = 1 | |
928 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
929 | B.Parent = Character2 | |
930 | local W = Instance.new("Weld") | |
931 | W.Part0 = Limb | |
932 | W.Part1 = B | |
933 | W.C0 = CFrame.new(0, -0.5, 0) | |
934 | W.Parent = Limb | |
935 | ||
936 | end | |
937 | local Limb = Character2:FindFirstChild("Left Arm") | |
938 | if Limb then | |
939 | ||
940 | Limb.CFrame = Torso2.CFrame * CFrame.new(-1.5, 0, 0) | |
941 | local Joint = Instance.new("Glue") | |
942 | Joint.Name = "LeftShoulder" | |
943 | Joint.Part0 = Torso2 | |
944 | Joint.Part1 = Limb | |
945 | Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
946 | Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
947 | Joint.Parent = Torso2 | |
948 | ||
949 | local B = Instance.new("Part") | |
950 | B.TopSurface = 0 | |
951 | B.BottomSurface = 0 | |
952 | B.formFactor = "Symmetric" | |
953 | B.Size = Vector3.new(1, 1, 1) | |
954 | B.Transparency = 1 | |
955 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
956 | B.Parent = Character2 | |
957 | local W = Instance.new("Weld") | |
958 | W.Part0 = Limb | |
959 | W.Part1 = B | |
960 | W.C0 = CFrame.new(0, -0.5, 0) | |
961 | W.Parent = Limb | |
962 | ||
963 | end | |
964 | local Limb = Character2:FindFirstChild("Right Leg") | |
965 | if Limb then | |
966 | ||
967 | Limb.CFrame = Torso2.CFrame * CFrame.new(0.5, -2, 0) | |
968 | local Joint = Instance.new("Glue") | |
969 | Joint.Name = "RightHip" | |
970 | Joint.Part0 = Torso2 | |
971 | Joint.Part1 = Limb | |
972 | Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
973 | Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
974 | Joint.Parent = Torso2 | |
975 | ||
976 | local B = Instance.new("Part") | |
977 | B.TopSurface = 0 | |
978 | B.BottomSurface = 0 | |
979 | B.formFactor = "Symmetric" | |
980 | B.Size = Vector3.new(1, 1, 1) | |
981 | B.Transparency = 1 | |
982 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
983 | B.Parent = Character2 | |
984 | local W = Instance.new("Weld") | |
985 | W.Part0 = Limb | |
986 | W.Part1 = B | |
987 | W.C0 = CFrame.new(0, -0.5, 0) | |
988 | W.Parent = Limb | |
989 | ||
990 | end | |
991 | local Limb = Character2:FindFirstChild("Left Leg") | |
992 | if Limb then | |
993 | ||
994 | Limb.CFrame = Torso2.CFrame * CFrame.new(-0.5, -2, 0) | |
995 | local Joint = Instance.new("Glue") | |
996 | Joint.Name = "LeftHip" | |
997 | Joint.Part0 = Torso2 | |
998 | Joint.Part1 = Limb | |
999 | Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
1000 | Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
1001 | Joint.Parent = Torso2 | |
1002 | ||
1003 | local B = Instance.new("Part") | |
1004 | B.TopSurface = 0 | |
1005 | B.BottomSurface = 0 | |
1006 | B.formFactor = "Symmetric" | |
1007 | B.Size = Vector3.new(1, 1, 1) | |
1008 | B.Transparency = 1 | |
1009 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
1010 | B.Parent = Character2 | |
1011 | local W = Instance.new("Weld") | |
1012 | W.Part0 = Limb | |
1013 | W.Part1 = B | |
1014 | W.C0 = CFrame.new(0, -0.5, 0) | |
1015 | W.Parent = Limb | |
1016 | ||
1017 | end | |
1018 | --[ | |
1019 | local Bar = Instance.new("Part") | |
1020 | Bar.TopSurface = 0 | |
1021 | Bar.BottomSurface = 0 | |
1022 | Bar.formFactor = "Symmetric" | |
1023 | Bar.Size = Vector3.new(1, 1, 1) | |
1024 | Bar.Transparency = 1 | |
1025 | Bar.CFrame = Torso2.CFrame * CFrame.new(0, 0.5, 0) | |
1026 | Bar.Parent = Character2 | |
1027 | local Weld = Instance.new("Weld") | |
1028 | Weld.Part0 = Torso2 | |
1029 | Weld.Part1 = Bar | |
1030 | Weld.C0 = CFrame.new(0, 0.5, 0) | |
1031 | Weld.Parent = Torso2 | |
1032 | --]] | |
1033 | end | |
1034 | Character2.Parent = workspace | |
1035 | Debris:AddItem(Character2,5) | |
1036 | ||
1037 | return Character2,Torso2 | |
1038 | end | |
1039 | ||
1040 | we = true | |
1041 | ||
1042 | local le = CreatePart(3, Character, "SmoothPlastic", 0, 0, "Really black", "le", VT(0, 0, 0),false) | |
1043 | local HandleMesh = CreateMesh("SpecialMesh", le, "FileMesh", "746694198", "0", VT(1,1,1), VT(0,0, 0)) | |
1044 | local Weld = CreateWeldOrSnapOrMotor("Weld", le, LeftArm, le, CF(0, -1.8, -0.2) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0)) | |
1045 | ||
1046 | local txt = Instance.new("BillboardGui", chara) | |
1047 | CV="Lime green" | |
1048 | txt.Adornee = chara.Head | |
1049 | txt.Name = "_status" | |
1050 | txt.Size = UDim2.new(2, 0, 1.2, 0) | |
1051 | txt.StudsOffset = Vector3.new(-9, 8, 0) | |
1052 | local text = Instance.new("TextLabel", txt) | |
1053 | text.Size = UDim2.new(10, 0, 7, 0) | |
1054 | text.FontSize = "Size24" | |
1055 | text.TextScaled = true | |
1056 | text.TextTransparency = 0 | |
1057 | text.BackgroundTransparency = 1 | |
1058 | text.TextTransparency = 0 | |
1059 | text.TextStrokeTransparency = 0 | |
1060 | text.Font = "Bodoni" | |
1061 | text.TextStrokeColor3 = BrickColor.new("Carnation pink").Color | |
1062 | text.TextColor3 = BrickColor.new("Light reddish violet").Color | |
1063 | text.Text = "" | |
1064 | ||
1065 | ||
1066 | function EW() | |
1067 | text.Text = "Ew" | |
1068 | we = true | |
1069 | ATTACK = true | |
1070 | Rooted = true | |
1071 | CreateSound("838721484", Head, 10, 1) | |
1072 | game.Players.LocalPlayer.Character["le"].Touched:connect(function(hit) | |
1073 | local humanoid = hit.Parent:findFirstChild("Humanoid") | |
1074 | if we == true then | |
1075 | humanoid:TakeDamage(10) | |
1076 | end | |
1077 | end) | |
1078 | for i=0, 1, 0.1 / Animation_Speed do | |
1079 | Swait() | |
1080 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.5 / Animation_Speed) | |
1081 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(12), RAD(0), RAD(20)), 0.5 / Animation_Speed) | |
1082 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.55, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed) | |
1083 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.55, 0) * ANGLES(RAD(150), RAD(0), RAD(40)) * LEFTSHOULDERC0, 0.5 / Animation_Speed) | |
1084 | RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed) | |
1085 | LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed) | |
1086 | end | |
1087 | wait(1) | |
1088 | we = false | |
1089 | text.Text = "" | |
1090 | ATTACK = false | |
1091 | Rooted = false | |
1092 | end | |
1093 | ||
1094 | ||
1095 | ||
1096 | function MouseDown(Mouse) | |
1097 | end | |
1098 | ||
1099 | function MouseUp(Mouse) | |
1100 | HOLD = false | |
1101 | end | |
1102 | ||
1103 | function KeyDown(Key) | |
1104 | KEYHOLD = true | |
1105 | if Key == "q" and ATTACK == false then | |
1106 | EW() | |
1107 | ||
1108 | end | |
1109 | end | |
1110 | ||
1111 | function KeyUp(Key) | |
1112 | KEYHOLD = false | |
1113 | end | |
1114 | ||
1115 | Mouse.Button1Down:connect(function(NEWKEY) | |
1116 | MouseDown(NEWKEY) | |
1117 | end) | |
1118 | Mouse.Button1Up:connect(function(NEWKEY) | |
1119 | MouseUp(NEWKEY) | |
1120 | end) | |
1121 | Mouse.KeyDown:connect(function(NEWKEY) | |
1122 | KeyDown(NEWKEY) | |
1123 | end) | |
1124 | Mouse.KeyUp:connect(function(NEWKEY) | |
1125 | KeyUp(NEWKEY) | |
1126 | end) | |
1127 | ||
1128 | ||
1129 | Humanoid.Changed:connect(function(Jump) | |
1130 | if Jump == "Jump" and (Disable_Jump == true) then | |
1131 | Humanoid.Jump = false | |
1132 | end | |
1133 | end) | |
1134 | ||
1135 | while true do | |
1136 | Swait() | |
1137 | script.Parent = WEAPONGUI | |
1138 | ANIMATE.Parent = nil | |
1139 | for _,v in next, Humanoid:GetPlayingAnimationTracks() do | |
1140 | v:Stop(); | |
1141 | end | |
1142 | SINE = SINE + CHANGE | |
1143 | local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude | |
1144 | local TORSOVERTICALVELOCITY = RootPart.Velocity.y | |
1145 | local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character) | |
1146 | local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16) | |
1147 | if ANIM == "Walk" and TORSOVELOCITY > 1 then | |
1148 | 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) | |
1149 | 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) | |
1150 | 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) | |
1151 | 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) | |
1152 | elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then | |
1153 | RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1154 | 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) | |
1155 | 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) | |
1156 | 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) | |
1157 | end | |
1158 | if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then | |
1159 | ANIM = "Jump" | |
1160 | if PLAYANIMS == true then | |
1161 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1162 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1163 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(20)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
1164 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
1165 | 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) | |
1166 | 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) | |
1167 | end | |
1168 | elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then | |
1169 | ANIM = "Fall" | |
1170 | if PLAYANIMS == true then | |
1171 | RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1172 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed) | |
1173 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(100), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed) | |
1174 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-100), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.2 / Animation_Speed) | |
1175 | 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) | |
1176 | 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) | |
1177 | end | |
1178 | elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then | |
1179 | ANIM = "Idle" | |
1180 | if PLAYANIMS == true then | |
1181 | RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(4 - 6 * SIN(SINE / 12)), RAD(0)), 0.15 / Animation_Speed) | |
1182 | Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(10 - 20 * SIN(SINE / 12))), 0.15 / Animation_Speed) | |
1183 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-30)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed) | |
1184 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-30)) * LEFTSHOULDERC0, 0.15 / Animation_Speed) | |
1185 | RightHip.C0 = Clerp(RightHip.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)), 0.15 / Animation_Speed) | |
1186 | 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)), 0.15 / Animation_Speed) | |
1187 | end | |
1188 | elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then | |
1189 | ANIM = "Walk" | |
1190 | if PLAYANIMS == true then | |
1191 | 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) | |
1192 | 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) | |
1193 | RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-30)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed) | |
1194 | LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-30)) * LEFTSHOULDERC0, 0.15 / Animation_Speed) | |
1195 | RightHip.C0 = Clerp(RightHip.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)), 0.15 / Animation_Speed) | |
1196 | 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)), 0.15 / Animation_Speed) | |
1197 | end | |
1198 | end | |
1199 | end | |
1200 | if Rooted == false then | |
1201 | Disable_Jump = false | |
1202 | Humanoid.WalkSpeed = Speed | |
1203 | elseif Rooted == true then | |
1204 | Disable_Jump = true | |
1205 | Humanoid.WalkSpeed = 0 | |
1206 | end | |
1207 | ||
1208 | Humanoid.Health = Humanoid.Health + 1 |