Advertisement
filipaopastebins2134

Mario

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