00fjg

Untitled

Jun 18th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.37 KB | None | 0 0
  1. --[[
  2. Notes:
  3.  
  4. Please excuse the horrible code and lack of indentation.
  5. This script is over about 3 years old now and I didn't use indentation back then,
  6. in fact, I didn't even use a fancy text editor, I just used notepad. (sublime text master race)
  7.  
  8. You have permission to change and use this in your game,
  9. I'd like to see some kind of credit towards me if you do so however.
  10.  
  11. Created by DoogleFox - 2011/2012
  12. --]]
  13.  
  14. local player = game:service("Players").LocalPlayer
  15. repeat wait() until player.Character;
  16. local mouse = player:GetMouse()
  17. local cam = workspace.CurrentCamera
  18. local char = player.Character
  19. local Torsoz = char:findFirstChild("Torso")
  20. local RA = char:findFirstChild("Right Arm")
  21. local LA = char:findFirstChild("Left Arm")
  22. local RL = char:findFirstChild("Right Leg")
  23. local LL = char:findFirstChild("Left Leg")
  24. local H = char:findFirstChild("Head")
  25. local Hu = char:findFirstChild("Humanoid")
  26. local RS = Torsoz:findFirstChild("Right Shoulder")
  27. local LS = Torsoz:findFirstChild("Left Shoulder")
  28. local RH = Torsoz:findFirstChild("Right Hip")
  29. local LH = Torsoz:findFirstChild("Left Hip")
  30. local N = Torsoz:findFirstChild("Neck")
  31. local NV = Vector3.new(0,0,0)
  32. local RightDagger
  33. local LeftDagger
  34. local RightHolder
  35. local LeftHolder
  36. local KnifeCuts = {}
  37. local Ctrl = false
  38. local Animating = false
  39. local Joint1 = Instance.new("Weld")
  40. Joint1.Name = "RightTop"
  41. local Joint2 = Instance.new("Weld")
  42. Joint2.Name = "LeftTop"
  43. local Joint3 = Instance.new("Weld")
  44. Joint3.Name = "RightBottom"
  45. local Joint4 = Instance.new("Weld")
  46. Joint4.Name = "LeftBottom"
  47. local Joint5 = Instance.new("Weld")
  48. Joint5.Name = "Top"
  49.  
  50. script.Name = "DaggerSkrip"
  51.  
  52. local colors = {"Navy blue", "Deep blue", "Earth green", "Dusty Rose", "Bright yellow", "Bright violet", "Bright orange"}
  53. local handlecolor = colors[math.random(1, #colors)]
  54.  
  55. local P = Instance.new("Part")
  56. P.Anchored = false
  57. P.CanCollide = false
  58. P.Name = "Part"
  59. P.formFactor = "Custom"
  60. P.Size = Vector3.new(0.2,0.2,0.2)
  61. P.Locked = true
  62. P.TopSurface = 0
  63. P.BottomSurface = 0
  64.  
  65. function GetWeld(weld)
  66. if weld:findFirstChild("XAngle") == nil then
  67. local a = Instance.new("NumberValue", weld)
  68. a.Name = "XAngle"
  69. end
  70. if weld:findFirstChild("YAngle") == nil then
  71. local a = Instance.new("NumberValue", weld)
  72. a.Name = "YAngle"
  73. end
  74. if weld:findFirstChild("ZAngle") == nil then
  75. local a = Instance.new("NumberValue", weld)
  76. a.Name = "ZAngle"
  77. end
  78. return weld.C0.p, Vector3.new(weld.XAngle.Value, weld.YAngle.Value, weld.ZAngle.Value)
  79. end
  80.  
  81. function SetWeld(weld, i, loops, origpos,origangle, nextpos,nextangle)
  82. if weld:findFirstChild("XAngle") == nil then
  83. local a = Instance.new("NumberValue", weld)
  84. a.Name = "XAngle"
  85. end
  86. if weld:findFirstChild("YAngle") == nil then
  87. local a = Instance.new("NumberValue", weld)
  88. a.Name = "YAngle"
  89. end
  90. if weld:findFirstChild("ZAngle") == nil then
  91. local a = Instance.new("NumberValue", weld)
  92. a.Name = "ZAngle"
  93. end
  94.  
  95. local tox,toy,toz = 0,0,0
  96. if origangle.x > nextangle.x then
  97. tox = -math.abs(origangle.x - nextangle.x) /loops*i
  98. else
  99. tox = math.abs(origangle.x - nextangle.x) /loops*i
  100. end
  101. if origangle.y > nextangle.y then
  102. toy = -math.abs(origangle.y - nextangle.y) /loops*i
  103. else
  104. toy = math.abs(origangle.y - nextangle.y) /loops*i
  105. end
  106. if origangle.z > nextangle.z then
  107. toz = -math.abs(origangle.z - nextangle.z) /loops*i
  108. else
  109. toz = math.abs(origangle.z - nextangle.z) /loops*i
  110. end
  111.  
  112. local tox2,toy2,toz2 = 0,0,0
  113. if origpos.x > nextpos.x then
  114. tox2 = -math.abs(origpos.x - nextpos.x) /loops*i
  115. else
  116. tox2 = math.abs(origpos.x - nextpos.x) /loops*i
  117. end
  118. if origpos.y > nextpos.y then
  119. toy2 = -math.abs(origpos.y - nextpos.y) /loops*i
  120. else
  121. toy2 = math.abs(origpos.y - nextpos.y) /loops*i
  122. end
  123. if origpos.z > nextpos.z then
  124. toz2 = -math.abs(origpos.z - nextpos.z) /loops*i
  125. else
  126. toz2 = math.abs(origpos.z - nextpos.z) /loops*i
  127. end
  128.  
  129. weld.XAngle.Value = origangle.x + tox
  130. weld.YAngle.Value = origangle.y + toy
  131. weld.ZAngle.Value = origangle.z + toz
  132. weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  133. end
  134.  
  135. function FindSurface(part, position)
  136. local obj = part.CFrame:pointToObjectSpace(position)
  137. local siz = part.Size/2
  138. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  139. local vec = Vector3.FromNormalId(v)
  140. local wvec = part.CFrame:vectorToWorldSpace(vec)
  141. local vz = (obj)/(siz*vec)
  142. if (math.abs(vz.X-1) < 0.01 or math.abs(vz.Y-1) < 0.01 or math.abs(vz.Z-1) < 0.01) then
  143. return wvec,vec
  144. end
  145. end
  146. if part.className == "WedgePart" then
  147. return part.CFrame:vectorToWorldSpace(Vector3.new(0,0.707,-0.707)), Vector3.new(0,0.707,-0.707)
  148. end
  149. end
  150.  
  151. function RAY(pos, dir, startpos, endpos, distleft, collidedlist)
  152. collidedlist = collidedlist or {char}
  153. startpos = startpos or pos
  154. distleft = distleft or dir.unit * dir.magnitude
  155. endpos = endpos or pos + distleft
  156. local ray = Ray.new(pos, distleft)
  157. local hitz,enz = workspace:FindPartOnRayWithIgnoreList(ray, collidedlist)
  158. if hitz ~= nil then
  159. if hitz.CanCollide == false then
  160. table.insert(collidedlist, hitz)
  161. local newpos = enz
  162. local newdistleft = distleft - (dir.unit * (pos - newpos).magnitude)
  163. if newdistleft ~= NV then
  164. return RAY(newpos-(dir*0.01), dir, startpos, endpos, newdistleft+(dir*0.01), collidedlist)
  165. end
  166. end
  167. end
  168. return hitz, enz, ray
  169. end
  170.  
  171. function Build()
  172. for i, v in pairs(char:children()) do
  173. if v.className == "Model" and v.Name == "ClimbingDaggers" then
  174. v:remove()
  175. end
  176. end
  177. local mdl = Instance.new("Model", char)
  178. mdl.Name = "ClimbingDaggers"
  179.  
  180. local b = P:Clone()
  181. b.Parent = mdl
  182. b.Name = "Belt"
  183. b.BrickColor = BrickColor.new("Brown")
  184. local mesh = Instance.new("BlockMesh", b)
  185. mesh.Scale = Vector3.new(2.05,0.2,1.05) *5
  186. local w = Instance.new("Weld", b)
  187. w.Part0 = Torsoz
  188. w.Part1 = b
  189. w.C0 = CFrame.new(0,-0.95,0)
  190.  
  191. local p = P:Clone()
  192. p.Parent = mdl
  193. p.Name = "Knot"
  194. p.BrickColor = BrickColor.new("Brown")
  195. local mesh = Instance.new("SpecialMesh", p)
  196. mesh.MeshType = "Sphere"
  197. mesh.Scale = Vector3.new(0.08,0.08,0.08) *5
  198. local w = Instance.new("Weld", p)
  199. w.Part0 = b
  200. w.Part1 = p
  201. w.C0 = CFrame.new(0,0.02,-0.525)
  202. for i = 1, 2 do
  203. local p = P:Clone()
  204. p.Parent = mdl
  205. p.Name = "KnotLoop"..i
  206. p.BrickColor = BrickColor.new("Brown")
  207. local mesh = Instance.new("SpecialMesh", p)
  208. mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  209. mesh.Scale = Vector3.new(0.4,0.16,0.16)
  210. local w = Instance.new("Weld", p)
  211. w.Part0 = b
  212. w.Part1 = p
  213. w.C0 = CFrame.new(0,0.02,-0.525)
  214. local p2 = P:Clone()
  215. p2.Parent = mdl
  216. p2.Name = "String"
  217. p2.BrickColor = BrickColor.new("Brown")
  218. local mesh = Instance.new("CylinderMesh", p2)
  219. mesh.Scale = Vector3.new(0.05,0.4,0.05) *5
  220. local w2 = Instance.new("Weld", p2)
  221. w2.Part0 = b
  222. w2.Part1 = p2
  223. w2.C0 = CFrame.new(0,0.02,-0.525)
  224. w2.C1 = CFrame.new(0,0.2,0)
  225. if i == 1 then
  226. w.C1 = CFrame.new(0.2,0,0)
  227. w.C0 = w.C0 * CFrame.Angles(-0.25,0,-math.pi/7)
  228. w2.C0 = w2.C0 * CFrame.Angles(0.12,0,-0.2)
  229. else
  230. w.C1 = CFrame.new(-0.2,0,0)
  231. w.C0 = w.C0 * CFrame.Angles(-0.25,0,math.pi/7)
  232. w2.C0 = w2.C0 * CFrame.Angles(0.12,0,0.2)
  233. end
  234. end
  235.  
  236. for i = 1, 2 do
  237. local p = P:Clone()
  238. p.Parent = mdl
  239. p.Name = "DaggerHolder"..i
  240. p.BrickColor = BrickColor.new("Brown")
  241. local mesh = Instance.new("BlockMesh", p)
  242. mesh.Scale = Vector3.new(0.15,0.8,0.3) *5
  243. local w = Instance.new("Weld", p)
  244. w.Part0 = b
  245. w.Part1 = p
  246. w.C1 = CFrame.new(0,0.1,0)
  247. local p2 = P:Clone()
  248. p2.Parent = mdl
  249. p2.Name = "DaggerHolderTip"..i
  250. p2.BrickColor = BrickColor.new("Brown")
  251. local mesh = Instance.new("SpecialMesh", p2)
  252. mesh.MeshType = "Wedge"
  253. mesh.Scale = Vector3.new(0.15,0.3,0.3) *5
  254. local ww = Instance.new("Weld", p2)
  255. ww.Part0 = p
  256. ww.Part1 = p2
  257. ww.C0 = CFrame.new(0,-0.55,0) * CFrame.Angles(-math.pi/2,0,0)
  258. if i == 1 then
  259. w.C0 = CFrame.new(1.06,0,-0.2) * CFrame.Angles(-math.pi/5,0,0)
  260. RightHolder = w
  261. else
  262. w.C0 = CFrame.new(-1.06,0,-0.2) * CFrame.Angles(-math.pi/5,0,0)
  263. LeftHolder = w
  264. end
  265. end
  266.  
  267. -------------------------- Daggers ------------------------------
  268. for i = 1, 2 do
  269. local h = P:Clone()
  270. h.Parent = mdl
  271. h.BrickColor = BrickColor.new(handlecolor)
  272. h.Name = "Handle"
  273. local mesh = Instance.new("BlockMesh", h)
  274. mesh.Scale = Vector3.new(0.14,0.8,0.3) *5
  275. local w = Instance.new("Weld", h)
  276. w.Part1 = h
  277. w.C0 = CFrame.new(0,0.87,0) * CFrame.Angles(math.pi,0,0)
  278. if i == 1 then
  279. w.Part0 = RightHolder.Parent
  280. RightDagger = w
  281. else
  282. w.Part0 = LeftHolder.Parent
  283. LeftDagger = w
  284. end
  285.  
  286. for o = 1, 2 do
  287. local p = P:Clone()
  288. p.Parent = mdl
  289. p.BrickColor = BrickColor.new("Dark stone grey")
  290. p.Name = "Guard"
  291. local mesh = Instance.new("BlockMesh", p)
  292. mesh.Scale = Vector3.new(0.2,0.15,0.35) *5
  293. local w = Instance.new("Weld", p)
  294. w.Part0 = h
  295. w.Part1 = p
  296. local g = P:Clone()
  297. g.Parent = mdl
  298. g.BrickColor = BrickColor.new("Dark stone grey")
  299. g.Name = "BottomGuard"
  300. local mesh = Instance.new("BlockMesh", g)
  301. mesh.Scale = Vector3.new(0.12,0.1,0.27) *5
  302. local w2 = Instance.new("Weld", g)
  303. w2.Part0 = p
  304. w2.Part1 = g
  305. if o == 1 then
  306. w.C0 = CFrame.new(0,0.4,0)
  307. w2.C0 = CFrame.new(0,0.075,0)
  308. else
  309. w.C0 = CFrame.new(0,-0.4,0)
  310. w2.C0 = CFrame.new(0,-0.075,0)
  311. end
  312. end
  313.  
  314. local bl = P:Clone()
  315. bl.Parent = mdl
  316. bl.BrickColor = BrickColor.new("Light stone grey")
  317. bl.Name = "Blade"
  318. bl.Reflectance = 0.7
  319. local mesh = Instance.new("BlockMesh", bl)
  320. mesh.Scale = Vector3.new(0.06,0.8,0.2) *5
  321. local w = Instance.new("Weld", bl)
  322. w.Part0 = h
  323. w.Part1 = bl
  324. w.C0 = CFrame.new(0,0.8,0)
  325. local t = P:Clone()
  326. t.Parent = mdl
  327. t.BrickColor = BrickColor.new("Light stone grey")
  328. t.Name = "BladeTip"
  329. t.Reflectance = 0.7
  330. local mesh = Instance.new("SpecialMesh", t)
  331. mesh.MeshType = "Wedge"
  332. mesh.Scale = Vector3.new(0.06,0.3,0.2) *5
  333. local w = Instance.new("Weld", bl)
  334. w.Part0 = bl
  335. w.Part1 = t
  336. w.C0 = CFrame.new(0,0.55,0) * CFrame.Angles(0,math.pi,0)
  337.  
  338. end --- end of dagger creation
  339.  
  340. end
  341. Build()
  342.  
  343. function B1D(mouse)
  344. end
  345.  
  346. function Climb(velo,part,pos, bg,bv)
  347. print("Climbing")
  348. RS.Part0 = nil
  349. LS.Part0 = nil
  350. RH.Part0 = nil
  351. LH.Part0 = nil
  352. N.Part0 = nil
  353. Joint1.Parent = Torsoz
  354. Joint1.Part0 = Torsoz
  355. Joint1.Part1 = RA
  356. Joint2.Parent = Torsoz
  357. Joint2.Part0 = Torsoz
  358. Joint2.Part1 = LA
  359. Joint3.Parent = Torsoz
  360. Joint3.Part0 = Torsoz
  361. Joint3.Part1 = RL
  362. Joint4.Parent = Torsoz
  363. Joint4.Part0 = Torsoz
  364. Joint4.Part1 = LL
  365. Joint5.Parent = Torsoz
  366. Joint5.Part0 = Torsoz
  367. Joint5.Part1 = H
  368. if bv == nil then
  369. SetWeld(Joint1,1,1, NV,NV,Vector3.new(1.5,0.5,0), Vector3.new(math.pi - 0.3,0,-0.18))
  370. SetWeld(Joint2,1,1, NV,NV,Vector3.new(-1.5,0.5,0), Vector3.new(math.pi - 0.3,0,0.18))
  371. SetWeld(Joint3,1,1, NV,NV,Vector3.new(0.5,-1,0), Vector3.new(math.pi/7,0,0.2))
  372. SetWeld(Joint4,1,1, NV,NV,Vector3.new(-0.5,-1,0), Vector3.new(math.pi/7,0,-0.2))
  373. RightDagger.Part0 = RA
  374. RightDagger.C0 = CFrame.new(0,-1,0) * CFrame.Angles(math.pi/2,0,0)
  375. LeftDagger.Part0 = LA
  376. LeftDagger.C0 = CFrame.new(0,-1,0) * CFrame.Angles(math.pi/2,0,0)
  377. end
  378. SetWeld(Joint5,1,1, NV,NV,Vector3.new(0,1,0), Vector3.new(-math.pi/8,0,0))
  379.  
  380. local dir,dir2 = FindSurface(part,pos)
  381. local downdir = (CFrame.new(NV,-dir) * CFrame.new(0,-1,0)).p.unit
  382. local bp = Instance.new("BodyPosition", Torsoz)
  383. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  384. bp.position = pos + (dir*1)
  385. local bppos = bp.position
  386. bp.D = 100
  387. bg = bg or Instance.new("BodyGyro", Torsoz)
  388. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  389. bg.D = 100
  390. bg.cframe = CFrame.new(NV,-dir)
  391. bv = bv or Instance.new("BodyVelocity")
  392. bv:remove()
  393. local i = 0
  394. local j1,j1a = GetWeld(Joint1)
  395. local j2,j2a = GetWeld(Joint2)
  396. local j3,j3a = GetWeld(Joint3)
  397. local j4,j4a = GetWeld(Joint4)
  398. local j5,j5a = GetWeld(Joint5)
  399. local herp1,lastpos1 = RAY(RightDagger.Parent.Position, -dir*1.6)
  400. local herp2,lastpos2 = RAY(LeftDagger.Parent.Position, -dir*1.6)
  401. local lastpos = pos
  402. local lastpart = part
  403. local lastpartcf = part.CFrame
  404. local offset = lastpartcf:pointToObjectSpace(lastpos+dir)
  405.  
  406. if velo < -10 then
  407. while velo < -1 and Ctrl do
  408. Hu.PlatformStand = true
  409.  
  410. i = i + 1
  411. if i <= 4 then
  412. SetWeld(Joint1,i,4, j1,j1a,j1, Vector3.new(math.pi - 0.3,0,-0.18))
  413. SetWeld(Joint2,i,4, j2,j2a,j2, Vector3.new(math.pi - 0.3,0,0.18))
  414. SetWeld(Joint3,i,4, j3,j3a,j3, Vector3.new(math.pi/7,0,0.2))
  415. SetWeld(Joint4,i,4, j4,j4a,j4, Vector3.new(math.pi/7,0,-0.2))
  416. end
  417. velo = velo + 0.4 + (-velo/14)
  418. bv.velocity = downdir*-velo
  419.  
  420. bp.position = bp.position + Vector3.new(0,velo/30,0)
  421. local hitz, enz = RAY(Torsoz.Position, ((Torsoz.CFrame * CFrame.new(0,-1,0)).p - Torsoz.Position).unit*3.4)
  422. if hitz ~= nil then
  423. velo = 0
  424. bp.position = Vector3.new(bp.position.x,enz.y+2.6,bp.position.z)
  425. end
  426.  
  427. -------- knife marks ----------------
  428. local herp1,newpos1 = RAY(RightDagger.Parent.Position, -dir*1.6)
  429. local herp2,newpos2 = RAY(LeftDagger.Parent.Position, -dir*1.6)
  430. if i > 3 then
  431. local p1 = P:Clone()
  432. p1.Parent = Torsoz
  433. p1.BrickColor = BrickColor.new("Really black")
  434. p1.Anchored = true
  435. p1.CFrame = CFrame.new((lastpos1 + newpos1)/2,newpos1)
  436. local mesh = Instance.new("BlockMesh", p1)
  437. mesh.Scale = Vector3.new(0.08,0.08,(lastpos1 - newpos1).magnitude) *5
  438. table.insert(KnifeCuts, p1)
  439. local p2 = P:Clone()
  440. p2.Parent = Torsoz
  441. p2.BrickColor = BrickColor.new("Really black")
  442. p2.Anchored = true
  443. p2.CFrame = CFrame.new((lastpos2 + newpos2)/2,newpos2)
  444. local mesh = Instance.new("BlockMesh", p2)
  445. mesh.Scale = Vector3.new(0.08,0.08,(lastpos2 - newpos2).magnitude) *5
  446. table.insert(KnifeCuts, p2)
  447. end
  448. lastpos1 = newpos1
  449. lastpos2 = newpos2
  450.  
  451. ----- moving on parts ----------
  452. local hitz, enz = RAY(bp.position, -dir*2.5)
  453. if hitz ~= nil and lastpart == part and lastpartcf ~= part.CFrame then
  454. local offset = lastpartcf:pointToObjectSpace(lastpos)
  455. local newposi = part.CFrame * CFrame.new(offset)
  456. dir, dir2 = FindSurface(hitz,enz)
  457. bg.cframe = CFrame.new(NV,-dir)
  458. --Torsoz.CFrame = CFrame.new(newposi.p, newposi.p - dir) + dir
  459. bp.position = Vector3.new(newposi.x+dir.x,bp.position.y,newposi.z+dir.z)
  460. elseif hitz == nil then
  461. Ctrl = false
  462. break
  463. end
  464.  
  465. hitz, enz = RAY(bp.position, -dir*2.5)
  466. lastpart = hitz
  467. lastpartcf = part.CFrame
  468. lastpos = enz
  469.  
  470. wait(0.02)
  471. end
  472. end
  473. bv:remove()
  474. --bp.position = bp.position + Vector3.new(0,Torsoz.Position.y-bp.position.y,0)
  475. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  476.  
  477. while Ctrl do
  478. if i <= 4 then
  479. SetWeld(Joint1,i,4, j1,j1a,j1, Vector3.new(math.pi - 0.3,0,-0.18))
  480. SetWeld(Joint2,i,4, j2,j2a,j2, Vector3.new(math.pi - 0.3,0,0.18))
  481. SetWeld(Joint3,i,4, j3,j3a,j3, Vector3.new(math.pi/7,0,0.2))
  482. SetWeld(Joint4,i,4, j4,j4a,j4, Vector3.new(math.pi/7,0,-0.2))
  483. i = i + 1
  484. end
  485.  
  486. ----- moving on parts ----------
  487. local hitz, enz = RAY(bp.position, -dir*2.5)
  488. if hitz ~= nil and lastpart == part and lastpartcf ~= part.CFrame then
  489. local offset = lastpartcf:pointToObjectSpace(lastpos)
  490. local newposi = part.CFrame * CFrame.new(offset)
  491. dir, dir2 = FindSurface(hitz,enz)
  492. bg.cframe = CFrame.new(NV,-dir)
  493. Torsoz.CFrame = CFrame.new(newposi.p, newposi.p - dir) + dir
  494. bp.position = newposi.p + dir
  495. elseif hitz == nil then
  496. Ctrl = false
  497. break
  498. end
  499.  
  500. hitz, enz = RAY(bp.position, -dir*2.5)
  501. lastpart = hitz
  502. lastpartcf = part.CFrame
  503. lastpos = enz
  504.  
  505. wait(0.02)
  506. end
  507. Torsoz.Anchored = false
  508. Hu.PlatformStand = false
  509. bp:remove()
  510. bg:remove()
  511. Unequip()
  512. end
  513.  
  514. function Jump()
  515. Animating = true
  516. local gravity = 0.83
  517. RS.Part0 = nil
  518. LS.Part0 = nil
  519. RH.Part0 = nil
  520. LH.Part0 = nil
  521. N.Part0 = nil
  522. Joint1.Parent = Torsoz
  523. Joint1.Part0 = Torsoz
  524. Joint1.Part1 = RA
  525. Joint1.C1 = CFrame.new(0,0.5,0)
  526. SetWeld(Joint1,1,1, NV,NV,Vector3.new(1.5,0.5,0),NV)
  527. Joint2.Parent = Torsoz
  528. Joint2.Part0 = Torsoz
  529. Joint2.Part1 = LA
  530. Joint2.C1 = CFrame.new(0,0.5,0)
  531. SetWeld(Joint2,1,1, NV,NV,Vector3.new(-1.5,0.5,0),NV)
  532. Joint3.Parent = Torsoz
  533. Joint3.Part0 = Torsoz
  534. Joint3.Part1 = RL
  535. Joint3.C1 = CFrame.new(0,1,0)
  536. SetWeld(Joint3,1,1, NV,NV,Vector3.new(0.5,-1,0),NV)
  537. Joint4.Parent = Torsoz
  538. Joint4.Part0 = Torsoz
  539. Joint4.Part1 = LL
  540. Joint4.C1 = CFrame.new(0,1,0)
  541. SetWeld(Joint4,1,1, NV,NV,Vector3.new(-0.5,-1,0),NV)
  542. Joint5.Parent = Torsoz
  543. Joint5.Part0 = Torsoz
  544. Joint5.Part1 = H
  545. Joint5.C1 = CFrame.new(0,-0.5,0)
  546. SetWeld(Joint5,1,1, NV,NV,Vector3.new(0,1,0),NV)
  547. local j1,j1a = GetWeld(Joint1)
  548. local j2,j2a = GetWeld(Joint2)
  549. local j3,j3a = GetWeld(Joint3)
  550. local j4,j4a = GetWeld(Joint4)
  551. local j5,j5a = GetWeld(Joint5)
  552. local thepart, thepos
  553.  
  554. local bv = Instance.new("BodyVelocity", Torsoz)
  555. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  556. local dir = cam.CoordinateFrame.lookVector
  557. dir = Vector3.new(dir.x,0,dir.z).unit
  558. local bg = Instance.new("BodyGyro", Torsoz)
  559. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  560. bg.D = 100
  561. bg.cframe = CFrame.new(NV,dir) * CFrame.Angles(-math.pi/8,0,0)
  562. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position + dir)
  563. local i = 0
  564. local state = "Jumping"
  565.  
  566. while Ctrl do
  567. i = i + 1
  568. if i <= 27 then
  569. SetWeld(Joint5,1,1, j5,j5a,j5, Vector3.new(((-math.pi/7)*((i-10)/20)) + (math.pi/8/2),0,0))
  570. end
  571. if i <= 3 then
  572. SetWeld(Joint1,i,3, j1,j1a,j1, Vector3.new(math.pi/4,0,-0.35))
  573. SetWeld(Joint2,i,3, j2,j2a,j2, Vector3.new(math.pi/4,0,0.35))
  574. if i == 3 then
  575. j1,j1a = GetWeld(Joint1)
  576. j2,j2a = GetWeld(Joint2)
  577. RightDagger.Part0 = RA
  578. RightDagger.C0 = CFrame.new(0,-1,0) * CFrame.Angles(math.pi/2,0,0)
  579. LeftDagger.Part0 = LA
  580. LeftDagger.C0 = CFrame.new(0,-1,0) * CFrame.Angles(math.pi/2,0,0)
  581. end
  582. elseif i <= 6 then
  583. SetWeld(Joint1,i-3,3, j1,j1a,j1, Vector3.new(math.pi+(math.pi/8),0,0.2))
  584. SetWeld(Joint2,i-3,3, j2,j2a,j2, Vector3.new(math.pi+(math.pi/8),0,-0.2))
  585. SetWeld(Joint3,i-3,3, j3,j3a,j3, Vector3.new(-0.5,0,0.12))
  586. SetWeld(Joint4,i-3,3, j4,j4a,j4, Vector3.new(-0.5,0,-0.12))
  587. end
  588.  
  589. bv.velocity = Vector3.new(dir.x,gravity,dir.z).unit * (Vector3.new(dir.x,gravity,dir.z).magnitude*36)
  590.  
  591. local hitz, enz = RAY(Torsoz.Position, dir*3)
  592. if hitz ~= nil then
  593. state = "Climbing"
  594. Climb(Torsoz.Velocity.y,hitz,enz, bg,bv)
  595. break
  596. end
  597.  
  598. if i > 3 then
  599. local hitz2,enz2 = RAY(Torsoz.Position, Vector3.new(0,-3.2,0))
  600. if hitz2 ~= nil then
  601. bg.cframe = CFrame.new(NV,dir)
  602. break
  603. end
  604. end
  605. if gravity > -100 then
  606. gravity = gravity - 0.08
  607. end
  608. wait(0.02)
  609. end --- end of jumping loop
  610. if state == "Jumping" then
  611. bv:remove()
  612. bg:remove()
  613. Unequip()
  614. end
  615. Animating = false
  616. end
  617.  
  618. function Unequip()
  619. Animating = true
  620. local j1,j1a = GetWeld(Joint1)
  621. local j2,j2a = GetWeld(Joint2)
  622. local j3,j3a = GetWeld(Joint3)
  623. local j4,j4a = GetWeld(Joint4)
  624. local j5,j5a = GetWeld(Joint5)
  625. for i = 1, 3 do
  626. SetWeld(Joint1,i,3, j1,j1a,j1, Vector3.new(math.pi/4,0,-0.35))
  627. SetWeld(Joint2,i,3, j2,j2a,j2, Vector3.new(math.pi/4,0,0.35))
  628. SetWeld(Joint3,i,3, j3,j3a,j3, NV)
  629. SetWeld(Joint4,i,3, j4,j4a,j4, NV)
  630. SetWeld(Joint5,i,3, j5,j5a,j5, NV)
  631. wait(0.02)
  632. end
  633. j1,j1a = GetWeld(Joint1)
  634. j2,j2a = GetWeld(Joint2)
  635. Build()
  636. for i = 1, 2 do
  637. SetWeld(Joint1,i,2, j1,j1a,j1, NV)
  638. SetWeld(Joint2,i,2, j2,j2a,j2, NV)
  639. wait(0.02)
  640. end
  641. for i = 1, 2 do
  642. Joint1.Parent = nil
  643. Joint2.Parent = nil
  644. Joint3.Parent = nil
  645. Joint4.Parent = nil
  646. Joint5.Parent = nil
  647. N.Parent = Torsoz
  648. N.Part0 = Torsoz
  649. N.Part1 = H
  650. RS.Parent = Torsoz
  651. RS.Part0 = Torsoz
  652. RS.Part1 = RA
  653. LS.Parent = Torsoz
  654. LS.Part0 = Torsoz
  655. LS.Part1 = LA
  656. RH.Parent = Torsoz
  657. RH.Part0 = Torsoz
  658. RH.Part1 = RL
  659. LH.Parent = Torsoz
  660. LH.Part0 = Torsoz
  661. LH.Part1 = LL
  662. wait(0.02)
  663. end
  664. Animating = false
  665. end
  666.  
  667. function KD(key, mouse)
  668. if key == string.char(50) then
  669. if Animating == false and Ctrl == false then
  670. Ctrl = true
  671. local hitz,enz = RAY(Torsoz.Position, Vector3.new(0,-4,0))
  672. local dir = cam.CoordinateFrame.lookVector
  673. dir = Vector3.new(dir.x,0,dir.z).unit
  674. local hitz2, enz2 = RAY(Torsoz.Position, dir*3)
  675. if hitz2 ~= nil then
  676. Climb(Torsoz.Velocity.y,hitz2,enz2)
  677. elseif hitz ~= nil then
  678. Jump()
  679. end
  680. end
  681. end
  682. end
  683.  
  684. function KU(key, mouse)
  685. if key == string.char(50) then
  686. Ctrl = false
  687. end
  688. end
  689.  
  690. mouse.Button1Down:connect(function() B1D(mouse) end)
  691. mouse.KeyDown:connect(function(key) KD(key, mouse) end)
  692. mouse.KeyUp:connect(function(key) KU(key, mouse) end)
  693.  
  694. local knifecutdeb = 1
  695. game:service("RunService").Stepped:connect(function()
  696. knifecutdeb = (knifecutdeb + 1)%2
  697. if knifecutdeb == 0 then
  698. for i,v in pairs(KnifeCuts) do
  699. if v.Transparency < 0.94 then
  700. v.Transparency = v.Transparency + 0.045
  701. else
  702. v:remove()
  703. table.remove(KnifeCuts,i)
  704. end
  705. end
  706. end
  707. end)
Add Comment
Please, Sign In to add comment