Advertisement
Pap_Pap_The_Mouse

abc

Jul 16th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.76 KB | None | 0 0
  1. wait(0.8)
  2. local Player = game:service'Players'.localPlayer
  3. local chara = Player.Character
  4. Player=game:GetService("Players").LocalPlayer
  5. Character=Player.Character
  6. PlayerGui=Player.PlayerGui
  7. Backpack=Player.Backpack
  8. Torso=Character.Torso
  9. Head=Character.Head
  10. Humanoid=Character.Humanoid
  11. m=Instance.new('Model',Character)
  12. LeftArm=Character["Left Arm"]
  13. LeftLeg=Character["Left Leg"]
  14. RightArm=Character["Right Arm"]
  15. RightLeg=Character["Right Leg"]
  16. LS=Torso["Left Shoulder"]
  17. LH=Torso["Left Hip"]
  18. RS=Torso["Right Shoulder"]
  19. RH=Torso["Right Hip"]
  20. Face = Head.face
  21. Neck=Torso.Neck
  22. it=Instance.new
  23. attacktype=1
  24. vt=Vector3.new
  25. cf=CFrame.new
  26. cl3=Color3.new
  27. rgb=Color3.fromRGB
  28. bcn=BrickColor.new
  29. euler=CFrame.fromEulerAnglesXYZ
  30. angles=CFrame.Angles
  31. Humanoid.WalkSpeed = 25
  32. Player = game:GetService("Players").LocalPlayer
  33. PlayerGui = Player.PlayerGui
  34. Cam = workspace.CurrentCamera
  35. Backpack = Player.Backpack
  36. Character = Player.Character
  37. Humanoid = Character.Humanoid
  38. Mouse = Player:GetMouse()
  39. RootPart = Character["HumanoidRootPart"]
  40. Torso = Character["Torso"]
  41. Head = Character["Head"]
  42. RightArm = Character["Right Arm"]
  43. LeftArm = Character["Left Arm"]
  44. RightLeg = Character["Right Leg"]
  45. LeftLeg = Character["Left Leg"]
  46. RootJoint = RootPart["RootJoint"]
  47. Neck = Torso["Neck"]
  48. RightShoulder = Torso["Right Shoulder"]
  49. LeftShoulder = Torso["Left Shoulder"]
  50. RightHip = Torso["Right Hip"]
  51. LeftHip = Torso["Left Hip"]
  52. IT = Instance.new
  53. CF = CFrame.new
  54. VT = Vector3.new
  55. RAD = math.rad
  56. C3 = Color3.new
  57. UD2 = UDim2.new
  58. BRICKC = BrickColor.new
  59. ANGLES = CFrame.Angles
  60. EULER = CFrame.fromEulerAnglesXYZ
  61. COS = math.cos
  62. ACOS = math.acos
  63. SIN = math.sin
  64. ASIN = math.asin
  65. ABS = math.abs
  66. MRANDOM = math.random
  67. FLOOR = math.floor
  68. Animation_Speed = 3
  69. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  70. local Speed = 12
  71. local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  72. local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  73. local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
  74. local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
  75. local DAMAGEMULTIPLIER = 1
  76. local ANIM = "Idle"
  77. local ATTACK = false
  78. local EQUIPPED = false
  79. local HOLD = false
  80. local COMBO = 1
  81. local Rooted = false
  82. local SINE = 0
  83. local KEYHOLD = false
  84. local CHANGE = 2 / Animation_Speed
  85. local WALKINGANIM = false
  86. local VALUE1 = false
  87. local VALUE2 = false
  88. local ROBLOXIDLEANIMATION = IT("Animation")
  89. ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
  90. ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  91. --ROBLOXIDLEANIMATION.Parent = Humanoid
  92. local WEAPONGUI = IT("ScreenGui", PlayerGui)
  93. WEAPONGUI.Name = "Weapon GUI"
  94. local Weapon = IT("Model")
  95. Weapon.Name = "Adds"
  96. local Effects = IT("Folder", Weapon)
  97. Effects.Name = "Effects"
  98. local ANIMATOR = Humanoid.Animator
  99. local ANIMATE = Character.Animate
  100. local UNANCHOR = true
  101. local PLAYANIMS = true
  102.  
  103.  
  104.  
  105. ArtificialHB = Instance.new("BindableEvent", script)
  106. ArtificialHB.Name = "ArtificialHB"
  107.  
  108. script:WaitForChild("ArtificialHB")
  109.  
  110. frame = Frame_Speed
  111. tf = 0
  112. allowframeloss = false
  113. tossremainder = false
  114. lastframe = tick()
  115. script.ArtificialHB:Fire()
  116.  
  117. game:GetService("RunService").Heartbeat:connect(function(s, p)
  118. tf = tf + s
  119. if tf >= frame then
  120. if allowframeloss then
  121. script.ArtificialHB:Fire()
  122. lastframe = tick()
  123. else
  124. for i = 1, math.floor(tf / frame) do
  125. script.ArtificialHB:Fire()
  126. end
  127. lastframe = tick()
  128. end
  129. if tossremainder then
  130. tf = 0
  131. else
  132. tf = tf - frame * math.floor(tf / frame)
  133. end
  134. end
  135. end)
  136. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  137. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  138. end
  139.  
  140. function PositiveAngle(NUMBER)
  141. if NUMBER >= 0 then
  142. NUMBER = 0
  143. end
  144. return NUMBER
  145. end
  146.  
  147. function NegativeAngle(NUMBER)
  148. if NUMBER <= 0 then
  149. NUMBER = 0
  150. end
  151. return NUMBER
  152. end
  153.  
  154. function Swait(NUMBER)
  155. if NUMBER == 0 or NUMBER == nil then
  156. ArtificialHB.Event:wait()
  157. else
  158. for i = 1, NUMBER do
  159. ArtificialHB.Event:wait()
  160. end
  161. end
  162. end
  163.  
  164. function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  165. local NEWMESH = IT(MESH)
  166. if MESH == "SpecialMesh" then
  167. NEWMESH.MeshType = MESHTYPE
  168. if MESHID ~= "nil" and MESHID ~= "" then
  169. NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
  170. end
  171. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  172. NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
  173. end
  174. end
  175. NEWMESH.Offset = OFFSET or VT(0, 0, 0)
  176. NEWMESH.Scale = SCALE
  177. NEWMESH.Parent = PARENT
  178. return NEWMESH
  179. end
  180.  
  181. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  182. local NEWPART = IT("Part")
  183. NEWPART.formFactor = FORMFACTOR
  184. NEWPART.Reflectance = REFLECTANCE
  185. NEWPART.Transparency = TRANSPARENCY
  186. NEWPART.CanCollide = false
  187. NEWPART.Locked = true
  188. NEWPART.Anchored = true
  189. if ANCHOR == false then
  190. NEWPART.Anchored = false
  191. end
  192. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  193. NEWPART.Name = NAME
  194. NEWPART.Size = SIZE
  195. NEWPART.Position = Torso.Position
  196. NEWPART.Material = MATERIAL
  197. NEWPART:BreakJoints()
  198. NEWPART.Parent = PARENT
  199. return NEWPART
  200. end
  201.  
  202. local function weldBetween(a, b)
  203. local weldd = Instance.new("ManualWeld")
  204. weldd.Part0 = a
  205. weldd.Part1 = b
  206. weldd.C0 = CFrame.new()
  207. weldd.C1 = b.CFrame:inverse() * a.CFrame
  208. weldd.Parent = a
  209. return weldd
  210. end
  211.  
  212.  
  213. function QuaternionFromCFrame(cf)
  214. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  215. local trace = m00 + m11 + m22
  216. if trace > 0 then
  217. local s = math.sqrt(1 + trace)
  218. local recip = 0.5 / s
  219. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  220. else
  221. local i = 0
  222. if m11 > m00 then
  223. i = 1
  224. end
  225. if m22 > (i == 0 and m00 or m11) then
  226. i = 2
  227. end
  228. if i == 0 then
  229. local s = math.sqrt(m00 - m11 - m22 + 1)
  230. local recip = 0.5 / s
  231. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  232. elseif i == 1 then
  233. local s = math.sqrt(m11 - m22 - m00 + 1)
  234. local recip = 0.5 / s
  235. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  236. elseif i == 2 then
  237. local s = math.sqrt(m22 - m00 - m11 + 1)
  238. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  239. end
  240. end
  241. end
  242.  
  243. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  244. local xs, ys, zs = x + x, y + y, z + z
  245. local wx, wy, wz = w * xs, w * ys, w * zs
  246. local xx = x * xs
  247. local xy = x * ys
  248. local xz = x * zs
  249. local yy = y * ys
  250. local yz = y * zs
  251. local zz = z * zs
  252. 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))
  253. end
  254.  
  255. function QuaternionSlerp(a, b, t)
  256. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  257. local startInterp, finishInterp;
  258. if cosTheta >= 0.0001 then
  259. if (1 - cosTheta) > 0.0001 then
  260. local theta = ACOS(cosTheta)
  261. local invSinTheta = 1 / SIN(theta)
  262. startInterp = SIN((1 - t) * theta) * invSinTheta
  263. finishInterp = SIN(t * theta) * invSinTheta
  264. else
  265. startInterp = 1 - t
  266. finishInterp = t
  267. end
  268. else
  269. if (1 + cosTheta) > 0.0001 then
  270. local theta = ACOS(-cosTheta)
  271. local invSinTheta = 1 / SIN(theta)
  272. startInterp = SIN((t - 1) * theta) * invSinTheta
  273. finishInterp = SIN(t * theta) * invSinTheta
  274. else
  275. startInterp = t - 1
  276. finishInterp = t
  277. end
  278. end
  279. 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
  280. end
  281.  
  282. function Clerp(a, b, t)
  283. local qa = {QuaternionFromCFrame(a)}
  284. local qb = {QuaternionFromCFrame(b)}
  285. local ax, ay, az = a.x, a.y, a.z
  286. local bx, by, bz = b.x, b.y, b.z
  287. local _t = 1 - t
  288. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  289. end
  290.  
  291. function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
  292. local frame = IT("Frame")
  293. frame.BackgroundTransparency = TRANSPARENCY
  294. frame.BorderSizePixel = BORDERSIZEPIXEL
  295. frame.Position = POSITION
  296. frame.Size = SIZE
  297. frame.BackgroundColor3 = COLOR
  298. frame.BorderColor3 = BORDERCOLOR
  299. frame.Name = NAME
  300. frame.Parent = PARENT
  301. return frame
  302. end
  303.  
  304. function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
  305. local label = IT("TextLabel")
  306. label.BackgroundTransparency = 1
  307. label.Size = UD2(1, 0, 1, 0)
  308. label.Position = UD2(0, 0, 0, 0)
  309. label.TextColor3 = TEXTCOLOR
  310. label.TextStrokeTransparency = STROKETRANSPARENCY
  311. label.TextTransparency = TRANSPARENCY
  312. label.FontSize = TEXTFONTSIZE
  313. label.Font = TEXTFONT
  314. label.BorderSizePixel = BORDERSIZEPIXEL
  315. label.TextScaled = false
  316. label.Text = TEXT
  317. label.Name = NAME
  318. label.Parent = PARENT
  319. return label
  320. end
  321.  
  322. function NoOutlines(PART)
  323. PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
  324. end
  325.  
  326. function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
  327. local NEWWELD = IT(TYPE)
  328. NEWWELD.Part0 = PART0
  329. NEWWELD.Part1 = PART1
  330. NEWWELD.C0 = C0
  331. NEWWELD.C1 = C1
  332. NEWWELD.Parent = PARENT
  333. return NEWWELD
  334. end
  335.  
  336. local S = IT("Sound")
  337. function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
  338. local NEWSOUND = nil
  339. coroutine.resume(coroutine.create(function()
  340. NEWSOUND = S:Clone()
  341. NEWSOUND.Parent = PARENT
  342. NEWSOUND.Volume = VOLUME
  343. NEWSOUND.Pitch = PITCH
  344. NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  345. NEWSOUND:play()
  346. if DOESLOOP == true then
  347. NEWSOUND.Looped = true
  348. else
  349. repeat wait(1) until NEWSOUND.Playing == false
  350. NEWSOUND:remove()
  351. end
  352. end))
  353. return NEWSOUND
  354. end
  355.  
  356. function MakeForm(PART,TYPE)
  357. if TYPE == "Cyl" then
  358. local MSH = IT("CylinderMesh",PART)
  359. elseif TYPE == "Ball" then
  360. local MSH = IT("SpecialMesh",PART)
  361. MSH.MeshType = "Sphere"
  362. elseif TYPE == "Wedge" then
  363. local MSH = IT("SpecialMesh",PART)
  364. MSH.MeshType = "Wedge"
  365. end
  366. end
  367.  
  368. function CFrameFromTopBack(at, top, back)
  369. local right = top:Cross(back)
  370. 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)
  371. end
  372.  
  373. function PuddleOfBlood(Position,MaxDrop,Model,MaxSize)
  374. local HITFLOOR, HITPOS, NORMAL = Raycast(Position, (CF(Position, Position + VT(0, -1, 0))).lookVector, MaxDrop, Model)
  375. if HITFLOOR ~= nil then
  376. if HITFLOOR.Parent ~= Weapon and HITFLOOR.Parent ~= Character then
  377. if HITFLOOR.Name == "BloodPuddle" then
  378. local DIST = (Position - HITFLOOR.Position).Magnitude
  379. 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
  380. HITFLOOR.Size = HITFLOOR.Size + VT(0.1,0,0.1)
  381. end
  382. else
  383. if HITFLOOR.Anchored == true then
  384. local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(2,0,2))
  385. BLOOD.CFrame = CF(HITPOS,HITPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0))
  386. MakeForm(BLOOD,"Cyl")
  387. coroutine.resume(coroutine.create(function()
  388. Swait(75)
  389. while true do
  390. Swait()
  391. BLOOD.Size = BLOOD.Size - VT(0.02,0,0.02)
  392. if BLOOD.Size.Z < 0.051 then
  393. BLOOD:remove()
  394. break
  395. end
  396. end
  397. end))
  398. end
  399. end
  400. end
  401. end
  402. end
  403.  
  404. function SprayBlood(POSITION,DIRECTION,BloodSize)
  405. local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(0.3,0.3,0.3),false)
  406. BLOOD.CFrame = CF(POSITION)
  407. MakeForm(BLOOD,"Ball")
  408. local bv = Instance.new("BodyVelocity",BLOOD)
  409. bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
  410. bv.velocity = CF(POSITION,DIRECTION+VT(MRANDOM(-3,3)/30,MRANDOM(-3,3)/30,MRANDOM(-3,3)/30)).lookVector*75
  411. bv.Name = "MOVE"
  412. Debris:AddItem(bv,0.05)
  413. coroutine.resume(coroutine.create(function()
  414. local HASTOUCHEDGROUND = false
  415. local HIT = BLOOD.Touched:Connect(function(hit)
  416. if hit.Anchored == true then
  417. HASTOUCHEDGROUND = true
  418. PuddleOfBlood(BLOOD.Position+VT(0,1,0),2,BLOOD,BloodSize)
  419. end
  420. end)
  421. wait(5)
  422. if HASTOUCHEDGROUND == false then
  423. BLOOD:remove()
  424. end
  425. end))
  426. end
  427.  
  428. Debris = game:GetService("Debris")
  429.  
  430. function CastProperRay(StartPos, EndPos, Distance, Ignore)
  431. local DIRECTION = CF(StartPos,EndPos).lookVector
  432. return Raycast(StartPos, DIRECTION, Distance, Ignore)
  433. end
  434.  
  435. function turnto(position)
  436. RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
  437. end
  438.  
  439. function recurse(root,callback,i)
  440. i= i or 0
  441. for _,v in pairs(root:GetChildren()) do
  442. i = i + 1
  443. callback(i,v)
  444.  
  445. if #v:GetChildren() > 0 then
  446. i = recurse(v,callback,i)
  447. end
  448. end
  449.  
  450. return i
  451. end
  452.  
  453. function ragdollJoint(character, part0, part1, attachmentName, className, properties)
  454. attachmentName = attachmentName.."RigAttachment"
  455. local constraint = Instance.new(className.."Constraint")
  456. constraint.Attachment0 = part0:FindFirstChild(attachmentName)
  457. constraint.Attachment1 = part1:FindFirstChild(attachmentName)
  458. constraint.Name = "RagdollConstraint"..part1.Name
  459.  
  460. for _,propertyData in next,properties or {} do
  461. constraint[propertyData[1]] = propertyData[2]
  462. end
  463.  
  464. constraint.Parent = character
  465. end
  466.  
  467. function getAttachment0(character, attachmentName)
  468. for _,child in next,character:GetChildren() do
  469. local attachment = child:FindFirstChild(attachmentName)
  470. if attachment then
  471. return attachment
  472. end
  473. end
  474. end
  475.  
  476. function R15Ragdoll(character)
  477. recurse(character, function(_,v)
  478. if v:IsA("Attachment") then
  479. v.Axis = Vector3.new(0, 1, 0)
  480. v.SecondaryAxis = Vector3.new(0, 0, 1)
  481. v.Rotation = Vector3.new(0, 0, 0)
  482. end
  483. end)
  484. for _,child in next,character:GetChildren() do
  485. if child:IsA("Accoutrement") then
  486. for _,part in next,child:GetChildren() do
  487. if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
  488. local attachment1 = part:FindFirstChildOfClass("Attachment")
  489. local attachment0 = getAttachment0(character,attachment1.Name)
  490. if attachment0 and attachment1 then
  491. local constraint = Instance.new("HingeConstraint")
  492. constraint.Attachment0 = attachment0
  493. constraint.Attachment1 = attachment1
  494. constraint.LimitsEnabled = true
  495. constraint.UpperAngle = 0
  496. constraint.LowerAngle = 0
  497. constraint.Parent = character
  498. end
  499. elseif part.Name == "HumanoidRootPart" then
  500. part:remove()
  501. end
  502. end
  503. end
  504. end
  505.  
  506. ragdollJoint(character,character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", {
  507. {"LimitsEnabled",true};
  508. {"UpperAngle",5};
  509. })
  510. ragdollJoint(character,character.UpperTorso, character.Head, "Neck", "BallSocket", {
  511. {"LimitsEnabled",true};
  512. {"UpperAngle",15};
  513. })
  514.  
  515. local handProperties = {
  516. {"LimitsEnabled", true};
  517. {"UpperAngle",0};
  518. {"LowerAngle",0};
  519. }
  520. ragdollJoint(character,character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties)
  521. ragdollJoint(character,character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties)
  522.  
  523. local shinProperties = {
  524. {"LimitsEnabled", true};
  525. {"UpperAngle", 0};
  526. {"LowerAngle", -75};
  527. }
  528. ragdollJoint(character,character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties)
  529. ragdollJoint(character,character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties)
  530.  
  531. local footProperties = {
  532. {"LimitsEnabled", true};
  533. {"UpperAngle", 15};
  534. {"LowerAngle", -45};
  535. }
  536. ragdollJoint(character,character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties)
  537. ragdollJoint(character,character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties)
  538.  
  539. ragdollJoint(character,character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket")
  540. ragdollJoint(character,character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket")
  541. ragdollJoint(character,character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket")
  542. ragdollJoint(character,character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket")
  543. ragdollJoint(character,character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket")
  544. ragdollJoint(character,character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket")
  545. end
  546.  
  547. function Ragdoll(Character2,CharTorso)
  548. Character2:BreakJoints()
  549. local hum = Character2:findFirstChild("Humanoid")
  550. hum:remove()
  551. local function Scan(ch)
  552. local e
  553. for e = 1,#ch do
  554. Scan(ch[e]:GetChildren())
  555. if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
  556. ch[e]:remove()
  557. end
  558. end
  559. end
  560. local NEWHUM = IT("Humanoid")
  561. NEWHUM.Name = "Corpse"
  562. NEWHUM.Health = 0
  563. NEWHUM.MaxHealth = 0
  564. NEWHUM.PlatformStand = true
  565. NEWHUM.Parent = Character2
  566. NEWHUM.DisplayDistanceType = "None"
  567.  
  568. local ch = Character2:GetChildren()
  569. local i
  570. for i = 1,#ch do
  571. if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
  572. ch[i]:remove()
  573. end
  574. end
  575.  
  576. local Torso2 = Character2.Torso
  577. local movevector = Vector3.new()
  578.  
  579. if Torso2 then
  580. movevector = CFrame.new(CharTorso.Position,Torso2.Position).lookVector
  581. local Head = Character2:FindFirstChild("Head")
  582. if Head then
  583. local Neck = Instance.new("Weld")
  584. Neck.Name = "Neck"
  585. Neck.Part0 = Torso2
  586. Neck.Part1 = Head
  587. Neck.C0 = CFrame.new(0, 1.5, 0)
  588. Neck.C1 = CFrame.new()
  589. Neck.Parent = Torso2
  590.  
  591. end
  592. local Limb = Character2:FindFirstChild("Right Arm")
  593. if Limb then
  594.  
  595. Limb.CFrame = Torso2.CFrame * CFrame.new(1.5, 0, 0)
  596. local Joint = Instance.new("Glue")
  597. Joint.Name = "RightShoulder"
  598. Joint.Part0 = Torso2
  599. Joint.Part1 = Limb
  600. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  601. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  602. Joint.Parent = Torso2
  603.  
  604. local B = Instance.new("Part")
  605. B.TopSurface = 0
  606. B.BottomSurface = 0
  607. B.formFactor = "Symmetric"
  608. B.Size = Vector3.new(1, 1, 1)
  609. B.Transparency = 1
  610. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  611. B.Parent = Character2
  612. local W = Instance.new("Weld")
  613. W.Part0 = Limb
  614. W.Part1 = B
  615. W.C0 = CFrame.new(0, -0.5, 0)
  616. W.Parent = Limb
  617.  
  618. end
  619. local Limb = Character2:FindFirstChild("Left Arm")
  620. if Limb then
  621.  
  622. Limb.CFrame = Torso2.CFrame * CFrame.new(-1.5, 0, 0)
  623. local Joint = Instance.new("Glue")
  624. Joint.Name = "LeftShoulder"
  625. Joint.Part0 = Torso2
  626. Joint.Part1 = Limb
  627. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  628. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  629. Joint.Parent = Torso2
  630.  
  631. local B = Instance.new("Part")
  632. B.TopSurface = 0
  633. B.BottomSurface = 0
  634. B.formFactor = "Symmetric"
  635. B.Size = Vector3.new(1, 1, 1)
  636. B.Transparency = 1
  637. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  638. B.Parent = Character2
  639. local W = Instance.new("Weld")
  640. W.Part0 = Limb
  641. W.Part1 = B
  642. W.C0 = CFrame.new(0, -0.5, 0)
  643. W.Parent = Limb
  644.  
  645. end
  646. local Limb = Character2:FindFirstChild("Right Leg")
  647. if Limb then
  648.  
  649. Limb.CFrame = Torso2.CFrame * CFrame.new(0.5, -2, 0)
  650. local Joint = Instance.new("Glue")
  651. Joint.Name = "RightHip"
  652. Joint.Part0 = Torso2
  653. Joint.Part1 = Limb
  654. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  655. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  656. Joint.Parent = Torso2
  657.  
  658. local B = Instance.new("Part")
  659. B.TopSurface = 0
  660. B.BottomSurface = 0
  661. B.formFactor = "Symmetric"
  662. B.Size = Vector3.new(1, 1, 1)
  663. B.Transparency = 1
  664. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  665. B.Parent = Character2
  666. local W = Instance.new("Weld")
  667. W.Part0 = Limb
  668. W.Part1 = B
  669. W.C0 = CFrame.new(0, -0.5, 0)
  670. W.Parent = Limb
  671.  
  672. end
  673. local Limb = Character2:FindFirstChild("Left Leg")
  674. if Limb then
  675.  
  676. Limb.CFrame = Torso2.CFrame * CFrame.new(-0.5, -2, 0)
  677. local Joint = Instance.new("Glue")
  678. Joint.Name = "LeftHip"
  679. Joint.Part0 = Torso2
  680. Joint.Part1 = Limb
  681. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  682. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  683. Joint.Parent = Torso2
  684.  
  685. local B = Instance.new("Part")
  686. B.TopSurface = 0
  687. B.BottomSurface = 0
  688. B.formFactor = "Symmetric"
  689. B.Size = Vector3.new(1, 1, 1)
  690. B.Transparency = 1
  691. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  692. B.Parent = Character2
  693. local W = Instance.new("Weld")
  694. W.Part0 = Limb
  695. W.Part1 = B
  696. W.C0 = CFrame.new(0, -0.5, 0)
  697. W.Parent = Limb
  698.  
  699. end
  700. --[
  701. local Bar = Instance.new("Part")
  702. Bar.TopSurface = 0
  703. Bar.BottomSurface = 0
  704. Bar.formFactor = "Symmetric"
  705. Bar.Size = Vector3.new(1, 1, 1)
  706. Bar.Transparency = 1
  707. Bar.CFrame = Torso2.CFrame * CFrame.new(0, 0.5, 0)
  708. Bar.Parent = Character2
  709. local Weld = Instance.new("Weld")
  710. Weld.Part0 = Torso2
  711. Weld.Part1 = Bar
  712. Weld.C0 = CFrame.new(0, 0.5, 0)
  713. Weld.Parent = Torso2
  714. --]]
  715. end
  716. Character2.Parent = workspace
  717. Debris:AddItem(Character2,5)
  718.  
  719. return Character2,Torso2
  720. end
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729. Humanoid.Changed:connect(function(Jump)
  730. if Jump == "Jump" and (Disable_Jump == true) then
  731. Humanoid.Jump = false
  732. end
  733. end)
  734.  
  735. while true do
  736. Swait()
  737. script.Parent = WEAPONGUI
  738. ANIMATE.Parent = nil
  739. for _,v in next, Humanoid:GetPlayingAnimationTracks() do
  740. v:Stop();
  741. end
  742. SINE = SINE + CHANGE
  743. local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude
  744. local TORSOVERTICALVELOCITY = RootPart.Velocity.y
  745. local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character)
  746. local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16)
  747. if ANIM == "Walk" and TORSOVELOCITY > 1 then
  748. 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)
  749. 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)
  750. 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)
  751. 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)
  752. elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then
  753. RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  754. 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)
  755. 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)
  756. 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)
  757. end
  758. if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then
  759. ANIM = "Jump"
  760. if PLAYANIMS == true then
  761. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  762. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  763. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(20)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed)
  764. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
  765. 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)
  766. 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)
  767. end
  768. elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then
  769. ANIM = "Fall"
  770. if PLAYANIMS == true then
  771. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  772. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(20), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  773. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(60)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed)
  774. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-60)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
  775. 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)
  776. 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)
  777. end
  778. elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then
  779. ANIM = "Idle"
  780. if PLAYANIMS == true then
  781. 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)
  782. 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)
  783. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed)
  784. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.15 / Animation_Speed)
  785. 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)
  786. 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)
  787. end
  788. elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then
  789. ANIM = "Walk"
  790. if PLAYANIMS == true then
  791. 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)
  792. 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)
  793. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.582951069, 0.773288727, 1, 0, 0, 0, -0.601970971, 0.798518002, 0, -0.798518002, -0.601970971) * ANGLES(RAD(0), RAD(0), RAD(0)) * ANGLES(RAD(35+35 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(0)) * RIGHTSHOULDERC0,0.15/Animation_Speed)
  794. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.582951069, 0.773288727, 1, 0, 0, 0, -0.601970971, 0.798518002, 0, -0.798518002, -0.601970971) * ANGLES(RAD(0), RAD(0), RAD(0)) * ANGLES(RAD(35-35 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.15 / Animation_Speed)
  795. RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(5)), 0.15 / Animation_Speed)
  796. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-5)), 0.15 / Animation_Speed)
  797. end
  798. end
  799. end
  800. unanchor()
  801. if Rooted == false then
  802. Disable_Jump = false
  803. Humanoid.WalkSpeed = Speed
  804. elseif Rooted == true then
  805. Disable_Jump = true
  806. Humanoid.WalkSpeed = 0
  807. end
  808. Character.Head.face.Texture = "rbxassetid://104824599"
  809. Humanoid.Health = Humanoid.Health + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement