Advertisement
mathmasterphil

Fenrier Scripts

Feb 27th, 2015
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.75 KB | None | 0 0
  1. -- v1.9
  2. --[[
  3. - In This Version:
  4. --]]--
  5.  
  6. --[[
  7. - Bugs you might experience:
  8. - No movement when spawning. (Just reset if this happens)
  9. --]]--
  10.  
  11. --[[
  12. - {todo}
  13. - Climb (Getting up walls near edges).
  14. - Aerodynamic controls.
  15. - Wallrun
  16. --]]--
  17.  
  18. function clerp(c1,c2,al)
  19. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  20. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  21. for i,v in pairs(com1) do
  22. com1[i] = v+(com2[i]-v)*al
  23. end
  24. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  25. end
  26.  
  27. local max_sprint_time = 250
  28. local sprint_time = 250
  29. local rolling = false
  30.  
  31. plr = game:service'Players'.LocalPlayer
  32. char = plr.Character
  33. mouse = plr:GetMouse()
  34. humanoid = char:findFirstChild("Humanoid")
  35. torso = char:findFirstChild("Torso")
  36. head = char.Head
  37. ra = char:findFirstChild("Right Arm")
  38. la = char:findFirstChild("Left Arm")
  39. rl = char:findFirstChild("Right Leg")
  40. ll = char:findFirstChild("Left Leg")
  41. rs = torso:findFirstChild("Right Shoulder")
  42. ls = torso:findFirstChild("Left Shoulder")
  43. rh = torso:findFirstChild("Right Hip")
  44. lh = torso:findFirstChild("Left Hip")
  45. neck = torso:findFirstChild("Neck")
  46. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  47. anim = char:findFirstChild("Animate")
  48. rootpart = char:findFirstChild("HumanoidRootPart")
  49. camera = workspace.CurrentCamera
  50. divingnotallowed = false
  51.  
  52. do --Gui
  53. plrgui = game:service'Players'.LocalPlayer:findFirstChild("PlayerGui")
  54. function cmsg(text)
  55. coroutine.wrap(function()
  56. if plrgui then
  57. local gui = Instance.new("ScreenGui", plrgui)
  58. local label = Instance.new("TextLabel", gui)
  59. label.Text = tostring(text)
  60. label.BackgroundTransparency = 1
  61. label.FontSize = "Size24"
  62. label.Size = UDim2.new(1, 0, 0.5, 0)
  63. label.Position = UDim2.new(0, 0, 0.5, 0)
  64. label.TextColor3 = Color3.new(1,1,1)
  65. label.TextStrokeTransparency = 0.75
  66. for i = 1, 0, -0.25 do
  67. label.TextTransparency = i
  68. wait()
  69. end
  70. game:service'Debris':AddItem(gui, 2)
  71. end
  72. end)()
  73. end
  74.  
  75. local statusgui = Instance.new("ScreenGui", plrgui)
  76. local frame = Instance.new("Frame", statusgui)
  77. frame.Size = UDim2.new(.55, 0, 0, 40)
  78. frame.Position = UDim2.new(.225, 0, .84, 0)
  79. frame.BackgroundColor3 = Color3.new()
  80. frame.BorderSizePixel = 0
  81. frame.BackgroundTransparency = 0.25
  82. frame.Style = 2
  83. local frame2 = Instance.new("Frame", frame)
  84. frame2.Size = UDim2.new(.45, 0, 0, 10)
  85. frame2.Position = UDim2.new(.025, 0, 0, 15)
  86. frame2.BackgroundColor3 = Color3.new(1,1,1)
  87. frame2.BorderSizePixel = 0
  88. frame2.ZIndex = 2
  89. frame2.ClipsDescendants = true
  90. game:service'RunService'.Stepped:connect(function()
  91. frame2.Size = UDim2.new(.45*humanoid.Health/humanoid.MaxHealth, 0, 0, 10)
  92. end)
  93. local frame2_1 = Instance.new("Frame", frame)
  94. frame2_1.Size = UDim2.new(.45, 0, 0, 10)
  95. frame2_1.Position = UDim2.new(.025, 0, 0, 15)
  96. frame2_1.BackgroundColor3 = Color3.new(.5,.5,.5)
  97. frame2_1.BorderSizePixel = 0
  98. local frame2_2 = Instance.new("TextLabel", frame)
  99. frame2_2.Size = UDim2.new(.45, 0, 0, 15)
  100. frame2_2.Position = UDim2.new(.025, 0, 0, 0)
  101. frame2_2.ZIndex = 2
  102. frame2_2.BackgroundTransparency = 1
  103. frame2_2.Text = "Health"
  104. frame2_2.Font = "SourceSansBold"
  105. frame2_2.TextXAlignment = "Left"
  106. frame2_2.TextScaled = true
  107. frame2_2.TextColor3 = Color3.new(1,1,1)
  108. local frame3 = Instance.new("Frame", frame)
  109. frame3.Size = UDim2.new(.45, 0, 0, 10)
  110. game:service'RunService'.Stepped:connect(function()
  111. frame3.Size = UDim2.new(.45*sprint_time/250, 0, 0, 10)
  112. end)
  113. frame3.Position = UDim2.new(.525, 0, 0, 15)
  114. frame3.BackgroundColor3 = Color3.new(1,1,1)
  115. frame3.BorderSizePixel = 0
  116. frame3.ZIndex = 2
  117. local frame3_1 = Instance.new("Frame", frame)
  118. frame3_1.Size = UDim2.new(.45, 0, 0, 10)
  119. frame3_1.Position = UDim2.new(.525, 0, 0, 15)
  120. frame3_1.BackgroundColor3 = Color3.new(.5,.5,.5)
  121. frame3_1.BorderSizePixel = 0
  122. local frame3_2 = Instance.new("TextLabel", frame)
  123. frame3_2.Size = UDim2.new(.45, 0, 0, 15)
  124. frame3_2.Position = UDim2.new(.525, 0, 0, 0)
  125. frame3_2.ZIndex = 2
  126. frame3_2.BackgroundTransparency = 1
  127. frame3_2.Text = "Stamina"
  128. frame3_2.Font = "SourceSansBold"
  129. frame3_2.TextXAlignment = "Left"
  130. frame3_2.TextScaled = true
  131. frame3_2.TextColor3 = Color3.new(1,1,1)
  132.  
  133. game:service'StarterGui':SetCoreGuiEnabled(1, false)
  134. end
  135. do --the animating
  136. if anim then
  137. anim:Destroy()
  138. end
  139.  
  140.  
  141.  
  142. local rm = Instance.new("Motor", torso)
  143. rm.C0 = CFrame.new(1.5, 0.5, 0)
  144. rm.C1 = CFrame.new(0, 0.5, 0)
  145. rm.Part0 = torso
  146. rm.Part1 = ra
  147. rm.Name = "Right Shoulder"
  148. local lm = Instance.new("Motor", torso)
  149. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  150. lm.C1 = CFrame.new(0, 0.5, 0)
  151. lm.Part0 = torso
  152. lm.Part1 = la
  153. lm.Name = "Left Shoulder"
  154.  
  155. local rlegm = Instance.new("Motor", torso)
  156. rlegm.C0 = CFrame.new(0.5, -1, 0)
  157. rlegm.C1 = CFrame.new(0, 1, 0)
  158. rlegm.Part0 = torso
  159. rlegm.Part1 = rl
  160. rlegm.Name = "Right Hip"
  161. local llegm = Instance.new("Motor", torso)
  162. llegm.C0 = CFrame.new(-0.5, -1, 0)
  163. llegm.C1 = CFrame.new(0, 1, 0)
  164. llegm.Part0 = torso
  165. llegm.Part1 = ll
  166. llegm.Name = "Left Hip"
  167.  
  168. neck.C0 = CFrame.new(0, 1, 0)
  169. neck.C1 = CFrame.new(0, -0.5, 0)
  170.  
  171.  
  172. rj.C0 = CFrame.new(0, -1, 0)
  173. rj.C1 = CFrame.new(0, -1, 0)
  174.  
  175. local speed = 0.3
  176. local angle = 0
  177. local sitting = false
  178. local anglespeed = 1
  179. local action = "None"
  180. local lastaction = "None"
  181. local jumptime = 0
  182. rsc0 = rm.C0
  183. lsc0 = lm.C0
  184. llc0 = llegm.C0
  185. rlc0 = rlegm.C0
  186. neckc0 = neck.C0
  187. rootc0 = rj.C0
  188.  
  189. Personality = "Brave"
  190. --[[
  191. Brave,Shy,Agile
  192. ]]
  193.  
  194.  
  195.  
  196.  
  197. BodyVelo = Instance.new("BodyVelocity", nil)
  198. BodyVelo.maxForce = Vector3.new(1,1,1)*math.huge
  199. BodyGyro = Instance.new("BodyGyro", nil)
  200. BodyGyro.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  201.  
  202.  
  203. ControllerService = game:GetService("ControllerService")
  204. Controllers = ControllerService:GetChildren()[1]
  205.  
  206.  
  207.  
  208. humanoid.Swimming:connect(function(speed)
  209. if speed > 0 then
  210. action = "Swimming"
  211. BodyGyro.Parent = torso
  212. else
  213. action = "None"
  214. end
  215. end)
  216.  
  217. humanoid.Climbing:connect(function(speed)
  218. if speed > 4 then
  219. action = "Climbing"
  220. BodyGyro.Parent = torso
  221. BodyGyro.maxTorque = Vector3.new(0, 4e+005, 0)*math.huge
  222. humanoid.WalkSpeed = 8
  223. else
  224. BodyGyro.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  225. humanoid.WalkSpeed = 16
  226. action = "None"
  227. end
  228. end)
  229. humanoid.Changed:connect(function()
  230. if action ~= "None" or ctrl then
  231. humanoid.Jump = false
  232. end
  233. end)
  234.  
  235. local sprinting = false
  236. local jump2 = false
  237. lastjump = 0
  238. thisjumpused = false
  239.  
  240. mouse.KeyDown:connect(function(k)
  241. if died then return end
  242. if string.byte(k) == 48 then
  243. if ctrl then return end
  244. if sprint_time <= 30 then return end
  245. if action == "Sliding" then return end
  246. humanoid.WalkSpeed = 28
  247. sprinting = true
  248. for camerazoom = camera.FieldOfView, 75, 1 do
  249. camera.FieldOfView = camerazoom
  250. wait()
  251. end
  252. camera.FieldOfView = 75
  253. end
  254. if string.byte(k) == 52 then
  255. if action == "None" then
  256. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 2 then
  257. action = "Sliding"
  258. end
  259. end
  260. end
  261. if string.byte(k) == 32 then
  262. if divingnotallowed then return end
  263. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
  264. if not thisjumpused then
  265. lastjump = tick()
  266. thisjumpused = true
  267. else
  268. if (tick()-lastjump) < .5 then
  269. action = "Diving"
  270. diving = true
  271. end
  272. lastjump = 0
  273. thisjumpused = false
  274. end
  275. end
  276. end
  277. if string.byte(k) == 50 then
  278. ctrl = not ctrl
  279. if ctrl then
  280. humanoid.WalkSpeed = 8
  281. else
  282. humanoid.WalkSpeed = 16
  283. end
  284. end
  285. end)
  286.  
  287.  
  288. mouse.KeyUp:connect(function(k)
  289. if died then return end
  290. if string.byte(k) == 52 then
  291. action = "None"
  292. Controllers.Parent = ControllerService
  293. if ctrl then
  294. humanoid.WalkSpeed = 8
  295. else
  296. humanoid.WalkSpeed = 16
  297. end
  298. if sprinting then
  299. humanoid.WalkSpeed = 28
  300. end
  301. end
  302. if string.byte(k) == 48 then
  303. if ctrl then return end
  304. if action == "Sliding" then return end
  305. if action == "Jumping" then
  306. repeat wait() until rayHit == true
  307. end
  308. sprinting = false
  309. humanoid.WalkSpeed = 16
  310. for camerazoom = camera.FieldOfView, 70, -1 do
  311. camera.FieldOfView = camerazoom
  312. wait()
  313. end
  314. camera.FieldOfView = 70
  315. end
  316. end)
  317.  
  318. game:service'RunService'.Stepped:connect(function()
  319. if ctrl or action == "Sliding" then
  320. rootpart.CanCollide = false
  321. end
  322. end)
  323.  
  324. function Ragdoll()
  325. died = true
  326. wait(1/60)
  327. if torso then
  328. torso.CFrame = torso.CFrame * CFrame.new(0, 5, 0)
  329. local Head = char:FindFirstChild("Head")
  330. if Head then
  331. local Neck = Instance.new("Weld")
  332. Neck.Name = "Neck"
  333. Neck.Part0 = torso
  334. Neck.Part1 = Head
  335. Neck.C0 = CFrame.new(0, 1.5, 0)
  336. Neck.C1 = CFrame.new()
  337. Neck.Parent = torso
  338. end
  339. local Limb = char:FindFirstChild("Right Arm")
  340. if Limb then
  341.  
  342. Limb.CFrame = torso.CFrame * CFrame.new(1.5, 0, 0)
  343. local Joint = Instance.new("Glue")
  344. Joint.Name = "RightShoulder"
  345. Joint.Part0 = torso
  346. Joint.Part1 = Limb
  347. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  348. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  349. Joint.Parent = torso
  350.  
  351. local B = Instance.new("Part")
  352. B.TopSurface = 0
  353. B.BottomSurface = 0
  354. B.formFactor = "Symmetric"
  355. B.Size = Vector3.new(1, 1, 1)
  356. B.Transparency = 1
  357. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  358. B.Parent = char
  359. B.CanCollide = false
  360. local W = Instance.new("Weld")
  361. W.Part0 = Limb
  362. W.Part1 = B
  363. W.C0 = CFrame.new(0, -0.5, 0)
  364. W.Parent = Limb
  365.  
  366. end
  367. local Limb = char:FindFirstChild("Left Arm")
  368. if Limb then
  369.  
  370. Limb.CFrame = torso.CFrame * CFrame.new(-1.5, 0, 0)
  371. local Joint = Instance.new("Glue")
  372. Joint.Name = "LeftShoulder"
  373. Joint.Part0 = torso
  374. Joint.Part1 = Limb
  375. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  376. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  377. Joint.Parent = torso
  378.  
  379. local B = Instance.new("Part")
  380. B.TopSurface = 0
  381. B.BottomSurface = 0
  382. B.formFactor = "Symmetric"
  383. B.Size = Vector3.new(1, 1, 1)
  384. B.Transparency = 1
  385. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  386. B.Parent = char
  387. B.CanCollide = false
  388. local W = Instance.new("Weld")
  389. W.Part0 = Limb
  390. W.Part1 = B
  391. W.C0 = CFrame.new(0, -0.5, 0)
  392. W.Parent = Limb
  393.  
  394. end
  395. local Limb = char:FindFirstChild("Right Leg")
  396. if Limb then
  397.  
  398. Limb.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
  399. local Joint = Instance.new("Glue")
  400. Joint.Name = "RightHip"
  401. Joint.Part0 = torso
  402. Joint.Part1 = Limb
  403. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  404. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  405. Joint.Parent = torso
  406.  
  407. local B = Instance.new("Part")
  408. B.TopSurface = 0
  409. B.BottomSurface = 0
  410. B.formFactor = "Symmetric"
  411. B.Size = Vector3.new(1, 1, 1)
  412. B.Transparency = 1
  413. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  414. B.Parent = char
  415. B.CanCollide = false
  416. local W = Instance.new("Weld")
  417. W.Part0 = Limb
  418. W.Part1 = B
  419. W.C0 = CFrame.new(0, -0.5, 0)
  420. W.Parent = Limb
  421.  
  422. end
  423. local Limb = char:FindFirstChild("Left Leg")
  424. if Limb then
  425.  
  426. Limb.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
  427. local Joint = Instance.new("Glue")
  428. Joint.Name = "LeftHip"
  429. Joint.Part0 = torso
  430. Joint.Part1 = Limb
  431. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  432. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  433. Joint.Parent = torso
  434.  
  435. local B = Instance.new("Part")
  436. B.TopSurface = 0
  437. B.BottomSurface = 0
  438. B.formFactor = "Symmetric"
  439. B.Size = Vector3.new(1, 1, 1)
  440. B.Transparency = 1
  441. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  442. B.Parent = char
  443. B.CanCollide = false
  444. local W = Instance.new("Weld")
  445. W.Part0 = Limb
  446. W.Part1 = B
  447. W.C0 = CFrame.new(0, -0.5, 0)
  448. W.Parent = Limb
  449. end
  450. rm:Destroy()
  451. lm:Destroy()
  452. llegm:Destroy()
  453. rlegm:Destroy()
  454. end
  455. end
  456.  
  457. plr.Chatted:connect(function(msg)
  458. if action == "None" then
  459. if msg == "/e dance" or msg == "/emote dance" then
  460. action = "Dancing"
  461. end
  462. if msg == "/e dance2" or msg == "/emote dance2" then
  463. action = "Dancing2"
  464. end
  465. if msg == "/e dance3" or msg == "/emote dance3" then
  466. action = "Dancing3"
  467. end
  468. end
  469. if msg == "ragdoll/" then
  470. Ragdoll()
  471. end
  472. end)
  473.  
  474.  
  475. humanoid.Jumping:connect(function()
  476. if died then return end
  477. if action == "Diving" or diving then return end
  478. action = "Jumping"
  479. Controllers.Parent = nil
  480. end)
  481.  
  482. humanoid.Died:connect(function()
  483. died = true
  484. deathpos = torso.Position
  485. WorkModel = Instance.new("Model", workspace)
  486. WorkModel.Name = " "
  487. wait(1/60)
  488. humanoid.Parent = nil
  489. if torso then
  490. local Head = char:FindFirstChild("Head")
  491. if Head then
  492. local Neck = Instance.new("Weld")
  493. Neck.Name = "Neck"
  494. Neck.Part0 = torso
  495. Neck.Part1 = Head
  496. Neck.C0 = CFrame.new(0, 1.5, 0)
  497. Neck.C1 = CFrame.new()
  498. Neck.Parent = torso
  499. end
  500. local Limb = char:FindFirstChild("Right Arm")
  501. if Limb then
  502.  
  503. Limb.CFrame = torso.CFrame * CFrame.new(1.5, 0, 0)
  504. local Joint = Instance.new("Glue")
  505. Joint.Name = "RightShoulder"
  506. Joint.Part0 = torso
  507. Joint.Part1 = Limb
  508. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  509. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  510. Joint.Parent = torso
  511.  
  512. local B = Instance.new("Part")
  513. B.TopSurface = 0
  514. B.BottomSurface = 0
  515. B.formFactor = "Symmetric"
  516. B.Size = Vector3.new(1, 1, 1)
  517. B.Transparency = 1
  518. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  519. B.Parent = char
  520. B.CanCollide = false
  521. local W = Instance.new("Weld")
  522. W.Part0 = Limb
  523. W.Part1 = B
  524. W.C0 = CFrame.new(0, -0.5, 0)
  525. W.Parent = Limb
  526.  
  527. end
  528. local Limb = char:FindFirstChild("Left Arm")
  529. if Limb then
  530.  
  531. Limb.CFrame = torso.CFrame * CFrame.new(-1.5, 0, 0)
  532. local Joint = Instance.new("Glue")
  533. Joint.Name = "LeftShoulder"
  534. Joint.Part0 = torso
  535. Joint.Part1 = Limb
  536. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  537. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  538. Joint.Parent = torso
  539.  
  540. local B = Instance.new("Part")
  541. B.TopSurface = 0
  542. B.BottomSurface = 0
  543. B.formFactor = "Symmetric"
  544. B.Size = Vector3.new(1, 1, 1)
  545. B.Transparency = 1
  546. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  547. B.Parent = char
  548. B.CanCollide = false
  549. local W = Instance.new("Weld")
  550. W.Part0 = Limb
  551. W.Part1 = B
  552. W.C0 = CFrame.new(0, -0.5, 0)
  553. W.Parent = Limb
  554.  
  555. end
  556. local Limb = char:FindFirstChild("Right Leg")
  557. if Limb then
  558.  
  559. Limb.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
  560. local Joint = Instance.new("Glue")
  561. Joint.Name = "RightHip"
  562. Joint.Part0 = torso
  563. Joint.Part1 = Limb
  564. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  565. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  566. Joint.Parent = torso
  567.  
  568. local B = Instance.new("Part")
  569. B.TopSurface = 0
  570. B.BottomSurface = 0
  571. B.formFactor = "Symmetric"
  572. B.Size = Vector3.new(1, 1, 1)
  573. B.Transparency = 1
  574. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  575. B.Parent = char
  576. B.CanCollide = false
  577. local W = Instance.new("Weld")
  578. W.Part0 = Limb
  579. W.Part1 = B
  580. W.C0 = CFrame.new(0, -0.5, 0)
  581. W.Parent = Limb
  582.  
  583. end
  584. local Limb = char:FindFirstChild("Left Leg")
  585. if Limb then
  586.  
  587. Limb.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
  588. local Joint = Instance.new("Glue")
  589. Joint.Name = "LeftHip"
  590. Joint.Part0 = torso
  591. Joint.Part1 = Limb
  592. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  593. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  594. Joint.Parent = torso
  595.  
  596. local B = Instance.new("Part")
  597. B.TopSurface = 0
  598. B.BottomSurface = 0
  599. B.formFactor = "Symmetric"
  600. B.Size = Vector3.new(1, 1, 1)
  601. B.Transparency = 1
  602. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  603. B.Parent = char
  604. B.CanCollide = false
  605. local W = Instance.new("Weld")
  606. W.Part0 = Limb
  607. W.Part1 = B
  608. W.C0 = CFrame.new(0, -0.5, 0)
  609. W.Parent = Limb
  610. end
  611. for blood = 0, 6 do
  612. local blood = Instance.new("Part", workspace)
  613. blood.BrickColor = BrickColor.Red()
  614. blood.FormFactor = "Custom"
  615. blood.Size = Vector3.new(.2,.2,.2)
  616. blood.Anchored = true
  617. blood.TopSurface = "Smooth"
  618. blood.BackSurface = "Smooth"
  619. local bloodmesh = Instance.new("CylinderMesh", blood)
  620. bloodmesh.Scale = Vector3.new(3, 0, 3)
  621. local rayzb = Ray.new(torso.Position, Vector3.new(0, -50, 0) + Vector3.new(math.random(-6, 6), 0, math.random(-6, 6)))
  622. local hitzb, hitposb = workspace:findPartOnRay(rayzb, char)
  623. if hitzb then
  624. blood.CFrame = CFrame.new(hitposb.x,hitposb.y,hitposb.z)
  625. blood.CFrame = blood.CFrame * CFrame.new(0, .05, 0)
  626. coroutine.wrap(function()
  627. for cframe = 0, math.random(16, 34) do
  628. bloodmesh.Scale = bloodmesh.Scale + Vector3.new(.45, 0, .45)
  629. wait()
  630. end
  631. end)()
  632. else
  633. blood:Destroy()
  634. end
  635. end
  636. local BP = Instance.new("BodyPosition", torso)
  637. BP.maxForce = Vector3.new(1,1,1)/0
  638. BP.position = deathpos
  639. for i,v in pairs(char:children()) do
  640. if v:IsA("Part") then v.Parent = WorkModel end
  641. end
  642. wait(.3)
  643. BP:Destroy()
  644. end
  645. end)
  646.  
  647. coroutine.wrap(function()
  648. while wait() do
  649. if divingnotallowed then
  650. wait(.35)
  651. divingnotallowed = false
  652. end
  653. end
  654. end)()
  655.  
  656.  
  657. local debounce = false
  658. local tool = false
  659. local dancing1 = false
  660. while game:service'RunService'.Stepped:wait() do
  661. if died then Controllers.Parent = ControllerService return end
  662. angle = (angle % 100) + anglespeed/10
  663. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*20))
  664. local rscf = rsc0
  665. local lscf = lsc0
  666. local rlcf = rlc0
  667. local llcf = llc0
  668. local rjcf = rootc0
  669. local ncf = neckc0
  670. local rayz = Ray.new(rootpart.Position, Vector3.new(0, -3.95, 0))
  671. local hitz, enz = workspace:findPartOnRay(rayz, char)
  672. local rayz1 = Ray.new(rootpart.Position, Vector3.new(-.5, -3.95, 0))
  673. local hitz1, enz1 = workspace:findPartOnRay(rayz1, char)
  674. local rayz2 = Ray.new(rootpart.Position, Vector3.new(.5, -3.95, 0))
  675. local hitz2, enz2 = workspace:findPartOnRay(rayz2, char)
  676. local rayz3 = Ray.new(rootpart.Position, Vector3.new(0, -3.95, -.5))
  677. local hitz3, enz3 = workspace:findPartOnRay(rayz3, char)
  678. local rayz4 = Ray.new(rootpart.Position, Vector3.new(0, -3.95, .5))
  679. local hitz4, enz4 = workspace:findPartOnRay(rayz4, char)
  680. if hitz or hitz1 or hitz2 or hitz3 or hitz4 and rayHit == false then
  681. rayHit = true
  682. Controllers.Parent = ControllerService
  683. end
  684. if diving then
  685. action = "Diving"
  686. end
  687. for i,object in pairs(char:children()) do
  688. if object:IsA("Tool") then
  689. if not wldunknown then
  690. wldunknown = Instance.new("Weld", rarm)
  691. wldunknown.Name = "RightGrip"
  692. wldunknown.Part0 = rarm
  693. if object:findFirstChild("Handle") then
  694. wldunknown.Part1 = object:findFirstChild("Handle")
  695. end
  696. end
  697. tool = true
  698. if not debounce then
  699. for x,value in pairs(object:children()) do
  700. if value:IsA("StringValue") and value.Name == "toolanim" and value.Value == "Slash" then
  701. debounce = true
  702. coroutine.wrap(function()
  703. slashing = true
  704. wait(.25)
  705. slashing = false
  706. debounce = false
  707. end)()
  708. value:Destroy()
  709. end
  710. end
  711. end
  712. elseif not object:IsA("Tool") then
  713. if tool then
  714. pcall(function()
  715. wldunknown:Destroy()
  716. wldunknown:Destroy()
  717. end)
  718. end
  719. tool = false
  720. end
  721. end
  722. if action == "Diving" then
  723. anglespeed = 4
  724. speed = 0.175
  725. BodyGyro.Parent = nil
  726. Controllers.Parent = nil
  727. diving = true
  728. ncf = neckc0 * CFrame.Angles(-math.rad(30) - math.rad(torso.Velocity.y)*1.2, 0, 0)
  729. rjcf = rootc0 * CFrame.Angles(-math.rad(155), 0, 0)
  730. rscf = rsc0 * CFrame.Angles(math.pi-math.rad(25), 0, 0)
  731. lscf = lsc0 * CFrame.Angles(math.pi-math.rad(25), 0, 0)
  732. rlcf = rlc0 * CFrame.Angles(0, 0, 0)
  733. llcf = llc0 * CFrame.Angles(0, 0, 0)
  734. if hitz and hitz1 and hitz2 and hitz3 and hitz4 then
  735. action = "Rolling"
  736. diving = false
  737. end
  738. elseif action == "Rolling" then
  739. anglespeed = 3
  740. speed = 0.2
  741. BodyGyro.Parent = nil
  742. Controllers.Parent = nil
  743. for roll = 165, 360, 30 do
  744. BodyVelo.Parent = torso
  745. BodyVelo.velocity = rootpart.CFrame.lookVector * 50
  746. Controllers.Parent = nil
  747. ncf = neckc0 * CFrame.Angles(-math.pi/1.85, 0, 0)
  748. rjcf = rootc0 * CFrame.new(0, -1.8, 0) * CFrame.Angles(-math.rad(roll), 0, 0)
  749. rscf = rsc0 * CFrame.Angles(math.pi/2.5, 0, -math.rad(30))
  750. lscf = lsc0 * CFrame.Angles(math.pi/2.5, 0, math.rad(30))
  751. rlcf = rlc0 * CFrame.new(0, .6, -.75) * CFrame.Angles(-math.pi/2.5, 0, 0)
  752. llcf = llc0 * CFrame.new(0, .6, -.75) * CFrame.Angles(-math.pi/2.5, 0, 0)
  753. rm.C0 = clerp(rm.C0,rscf,speed)
  754. lm.C0 = clerp(lm.C0,lscf,speed)
  755. rj.C0 = clerp(rj.C0,rjcf,speed)
  756. neck.C0 = clerp(neck.C0,ncf,speed)
  757. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  758. llegm.C0 = clerp(llegm.C0,llcf,speed)
  759. wait()
  760. end
  761. BodyVelo.Parent = nil
  762. action = "None"
  763. Controllers.Parent = ControllerService
  764. divingnotallowed = true
  765. elseif action == "Dancing" then
  766. if not dancing1 == true then
  767. dancing1 = true
  768. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 2 then action = "None" end
  769. anglespeed = 4
  770. speed = 0.3
  771. BodyGyro.Parent = nil
  772. for waiting = 0, 35, 1 do
  773. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 2 then action = "None" return end
  774. local angle = (angle % 100) + anglespeed/10
  775. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  776. rjcf = rootc0 * CFrame.Angles(0, math.rad(45), 0)
  777. rscf = rsc0 * CFrame.Angles(math.pi/2.5+math.sin(waiting)*.5, 0, math.rad(2))
  778. lscf = lsc0 * CFrame.Angles(math.pi/2.5+math.sin(waiting)*.5, 0, -math.rad(2))
  779. rlcf = rlc0 * CFrame.Angles(math.pi/18, 0, math.rad(5))
  780. llcf = llc0 * CFrame.Angles(-math.pi/14, 0, -math.rad(5))
  781. rm.C0 = clerp(rm.C0,rscf,speed)
  782. lm.C0 = clerp(lm.C0,lscf,speed)
  783. rj.C0 = clerp(rj.C0,rjcf,speed)
  784. neck.C0 = clerp(neck.C0,ncf,speed)
  785. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  786. llegm.C0 = clerp(llegm.C0,llcf,speed)
  787. wait()
  788. end
  789. for waiting = 0, 35, 1 do
  790. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 2 then action = "None" return end
  791. local angle = (angle % 100) + anglespeed/10
  792. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  793. rjcf = rootc0 * CFrame.Angles(0, -math.rad(45), 0)
  794. rscf = rsc0 * CFrame.Angles(math.pi/2.5+math.sin(waiting)*.5, 0, math.rad(2))
  795. lscf = lsc0 * CFrame.Angles(math.pi/2.5+math.sin(waiting)*.5, 0, -math.rad(2))
  796. rlcf = rlc0 * CFrame.Angles(math.pi/18, 0, math.rad(5))
  797. llcf = llc0 * CFrame.Angles(-math.pi/14, 0, -math.rad(5))
  798. rm.C0 = clerp(rm.C0,rscf,speed)
  799. lm.C0 = clerp(lm.C0,lscf,speed)
  800. rj.C0 = clerp(rj.C0,rjcf,speed)
  801. neck.C0 = clerp(neck.C0,ncf,speed)
  802. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  803. llegm.C0 = clerp(llegm.C0,llcf,speed)
  804. wait()
  805. end
  806. for jumping = 0, 5, 1 do
  807. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 2 then action = "None" return end
  808. local angle = (angle % 100) + anglespeed/10
  809. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  810. rjcf = rootc0 *CFrame.new(0, 2, 0) * CFrame.Angles(0, 0, 0)
  811. rscf = rsc0 * CFrame.Angles(math.pi/1, 0, -math.rad(10))
  812. lscf = lsc0 * CFrame.Angles(math.pi/1, 0, math.rad(10))
  813. rlcf = rlc0 * CFrame.new(0, .25, -.15) * CFrame.Angles(-math.pi/22, 0, -math.rad(5))
  814. llcf = llc0 * CFrame.Angles(math.pi/22, 0, -math.rad(5))
  815. rm.C0 = clerp(rm.C0,rscf,speed)
  816. lm.C0 = clerp(lm.C0,lscf,speed)
  817. rj.C0 = clerp(rj.C0,rjcf,speed)
  818. neck.C0 = clerp(neck.C0,ncf,speed)
  819. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  820. llegm.C0 = clerp(llegm.C0,llcf,speed)
  821. wait()
  822. end
  823. dancing1 = false
  824. end
  825. elseif action == "Dancing2" then
  826. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 2 then
  827. camera.CameraType = 5
  828. action = "None"
  829. end
  830. anglespeed = 1
  831. speed = 0.2
  832. BodyGyro.Parent = nil
  833. camera.CameraType = 6
  834. camera:SetRoll(math.sin(angle)*.1)
  835. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  836. rjcf = rootc0 * CFrame.new(0, 0.75 + -math.abs(math.sin(angle)), 0) * CFrame.Angles(0, 0, math.sin(angle)*.1)
  837. rscf = rsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.5, 0, math.rad(2))
  838. lscf = lsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.5, 0, -math.rad(2))
  839. rlcf = rlc0 * CFrame.Angles(math.sin(angle)*.25, 0, math.rad(5))
  840. llcf = llc0 * CFrame.Angles(-math.sin(angle)*.25, 0, -math.rad(5))
  841. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 2 then
  842. camera.CameraType = 5
  843. end
  844. elseif action == "Dancing3" then
  845. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 2 then action = "None" end
  846. anglespeed = .9
  847. BodyGyro.Parent = nil
  848. speed = 0.2
  849. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  850. rjcf = rootc0 * CFrame.Angles(math.pi, angle*3.6/2, 0)
  851. rscf = rsc0 * CFrame.Angles(math.sin(angle)*.5, 0, math.rad(65))
  852. lscf = lsc0 * CFrame.Angles(math.sin(angle)*.5, 0, -math.rad(65))
  853. rlcf = rlc0 * CFrame.Angles(math.sin(angle)*.25, 0, math.rad(15))
  854. llcf = llc0 * CFrame.Angles(-math.sin(angle)*.25, 0, -math.rad(15))
  855. elseif action == "Jumping" then
  856. if diving then action = "Diving" end
  857. anglespeed = 1
  858. speed = 0.175
  859. BodyGyro.Parent = nil
  860. rayHit = false
  861. for waiting = 0, 8 do
  862. rjcf = rootc0 * CFrame.Angles(0, 0, 0)
  863. rscf = rsc0 * CFrame.Angles(-math.pi/10, 0, 0)
  864. lscf = lsc0 * CFrame.Angles(-math.pi/10, 0, 0)
  865. rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) * CFrame.Angles(-math.pi/14, 0, 0)
  866. llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0)
  867. rm.C0 = clerp(rm.C0,rscf,speed)
  868. lm.C0 = clerp(lm.C0,lscf,speed)
  869. rj.C0 = clerp(rj.C0,rjcf,speed)
  870. neck.C0 = clerp(neck.C0,ncf,speed)
  871. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  872. llegm.C0 = clerp(llegm.C0,llcf,speed)
  873. wait()
  874. end
  875. action = "None"
  876. elseif action == "Climbing" then
  877. anglespeed = 4
  878. speed = 0.1
  879. BodyGyro.cframe = torso.CFrame
  880. ncf = neckc0 * CFrame.Angles(math.pi/3, 0, 0)
  881. rjcf = rootc0
  882. rscf = rsc0 * CFrame.new(0, -0.2 + -mvmnt*0.2, 0.45) * CFrame.Angles(math.pi/1.5, 0, -math.abs(mvmnt)*0.025)
  883. lscf = lsc0 * CFrame.new(0, -0.2 + mvmnt*0.2, 0.45) * CFrame.Angles(math.pi/1.5, 0, math.abs(mvmnt)*0.025)
  884. rlcf = rlc0 * CFrame.new(0, 0.3 + mvmnt*0.2, 0) * CFrame.Angles(math.pi/14, 0, 0)
  885. llcf = llc0 * CFrame.new(0, 0.3 + -mvmnt*0.2, 0) * CFrame.Angles(math.pi/14, 0, 0)
  886. elseif action == "Sliding" then
  887. Controllers.Parent = nil
  888. BodyGyro.Parent = nil
  889. speed = 0.1
  890. humanoid.WalkSpeed = humanoid.WalkSpeed - 0.4
  891. ncf = neckc0 * CFrame.Angles(-math.pi/7, 0, 0)
  892. rjcf = rootc0 * CFrame.new(0, -1.5, 0) * CFrame.Angles(math.pi/2.35, math.rad(10), 0)
  893. rscf = rsc0 * CFrame.Angles(-math.pi/2.5, 0, math.rad(5))
  894. lscf = lsc0 * CFrame.Angles(-math.pi/1.25, 0, -math.rad(5))
  895. rlcf = rlc0 * CFrame.Angles(-math.pi/25.5, 0, -math.rad(10))
  896. llcf = llc0 * CFrame.new(0, .3, -.35) * CFrame.Angles(-math.pi/24.5, 0, 0)
  897. if humanoid.WalkSpeed <= 1 then
  898. action = "None"
  899. if ctrl then
  900. humanoid.WalkSpeed = 8
  901. elseif not ctrl then
  902. humanoid.WalkSpeed = 16
  903. end
  904. if sprinting then
  905. humanoid.WalkSpeed = 28
  906. end
  907. Controllers.Parent = ControllerService
  908. end
  909. elseif action == "Swimming" then
  910. anglespeed = 1/6
  911. speed = 0.1
  912.  
  913. local rotpos = Vector3.new(camera.CoordinateFrame.x, camera.CoordinateFrame.y, camera.CoordinateFrame.z)
  914. BodyGyro.cframe = CFrame.new(torso.Position,rotpos) * CFrame.Angles(math.pi/2.7, math.pi, 0)
  915. ncf = neckc0 * CFrame.Angles(math.pi/2.7, 0, 0)
  916. rjcf = rootc0
  917. rscf = rsc0 * CFrame.Angles(math.pi, 0, math.abs(mvmnt)*0.25)
  918. lscf = lsc0 * CFrame.Angles(math.pi, 0, -math.abs(mvmnt)*0.25)
  919. rlcf = rlc0 * CFrame.new(0, 0.3-math.abs(mvmnt)*0.075, 0) * CFrame.Angles(-math.sin(angle)*0.25, 0, 0)
  920. llcf = llc0 * CFrame.new(0, 0.3-math.abs(-mvmnt)*0.075, 0) * CFrame.Angles(math.sin(angle)*0.25, 0, 0)
  921. elseif not hitz and not hitz1 and not hitz2 and not hitz3 and not hitz4 then
  922. if action == "None" then
  923. rayHit = false
  924. BodyGyro.Parent = nil
  925. Controllers.Parent = nil
  926. speed = 0.1
  927. anglespeed = 1/2
  928. rjcf = rootc0 * CFrame.Angles(math.pi/18, 0, 0)
  929. rscf = rsc0 * CFrame.Angles(0, 0, math.rad(165))
  930. lscf = lsc0 * CFrame.Angles(0, 0, -math.rad(165))
  931. rlcf = rlc0 * CFrame.new(0, 0.4, -0.3) * CFrame.Angles(-math.pi/14, 0, 0)
  932. llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0)
  933. end
  934. elseif humanoid.Sit then
  935. speed = 0.1
  936. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  937. rjcf = rootc0 * CFrame.new(0, -.2, 0)
  938. rscf = rsc0 * CFrame.Angles(math.pi/2, 0, math.rad(5))
  939. lscf = lsc0 * CFrame.Angles(math.pi/2, 0, -math.rad(5))
  940. rlcf = rlc0 * CFrame.Angles(math.pi/2, 0, math.rad(7.5))
  941. llcf = llc0 * CFrame.Angles(math.pi/2, 0, -math.rad(7.5))
  942. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  943. if action == "None" then
  944. BodyGyro.Parent = nil
  945. speed = 0.3
  946. anglespeed = .15
  947. if ctrl then
  948. ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.075, 0, 0)
  949. rjcf = rootc0 * CFrame.new(0, -1.25, 0)
  950. rscf = rsc0 * CFrame.Angles(-math.pi/24+math.sin(-angle)*0.05, 0, math.rad(5))
  951. lscf = lsc0 * CFrame.Angles(-math.pi/24+math.sin(-angle)*0.05, 0, -math.rad(5))
  952. rlcf = rlc0 * CFrame.new(0, 1.25, -.85) * CFrame.Angles(0, 0, math.rad(2.5))
  953. llcf = llc0 * CFrame.new(0, -.25, -.45) * CFrame.Angles(-math.pi/2, 0, -math.rad(2.5))
  954. else
  955. if Personality == "Agile" then
  956. ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.075, 0, 0)
  957. rjcf = rootc0
  958. rscf = rsc0 * CFrame.Angles(-math.pi/24+math.sin(-angle)*0.05, 0, math.rad(5))
  959. lscf = lsc0 * CFrame.Angles(-math.pi/24+math.sin(-angle)*0.05, 0, -math.rad(5))
  960. rlcf = rlc0 * CFrame.Angles(-math.rad(2.5), 0, math.rad(2.5))
  961. llcf = llc0 * CFrame.Angles(math.rad(4.5), 0, -math.rad(2.5))
  962. elseif Personality == "Shy" then
  963. ncf = neckc0 * CFrame.Angles(-math.rad(10)+math.sin(angle)*0.075, 0, 0)
  964. rjcf = rootc0 * CFrame.Angles(0, math.rad(10), 0)
  965. rscf = rsc0 * CFrame.Angles(math.sin(-angle)*0.1, 0, -math.rad(2.5))
  966. lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.1, 0, math.rad(2.5))
  967. rlcf = rlc0 * CFrame.Angles(-math.rad(2.5), 0, 0)
  968. llcf = llc0 * CFrame.Angles(math.rad(4.5), 0, 0)
  969. elseif Personality == "Brave" then
  970. ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.075, 0, 0)
  971. rjcf = rootc0 * CFrame.new(0, -0.2, 0)
  972. rscf = rsc0 * CFrame.Angles(-math.pi/24+math.sin(-angle)*0.05, 0, math.rad(5))
  973. lscf = lsc0 * CFrame.Angles(-math.pi/24+math.sin(-angle)*0.05, 0, -math.rad(5))
  974. rlcf = rlc0 * CFrame.Angles(-math.rad(15), 0, math.rad(2.5))
  975. llcf = llc0 * CFrame.Angles(math.rad(15), 0, -math.rad(2.5))
  976. end
  977. end
  978. if is_running then
  979. coroutine.wrap(function()
  980. is_running = false
  981. for camerazoom = camera.FieldOfView, 70, -1 do
  982. camera.FieldOfView = camerazoom
  983. wait()
  984. end
  985. camera.FieldOfView = 70
  986. end)()
  987. end
  988. if sprint_time <= 125 and not ctrl then
  989. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  990. rjcf = rootc0 * CFrame.new(0, -1.9, 0) * CFrame.Angles(math.rad(10), 0, 0)
  991. rscf = rsc0 * CFrame.Angles(-math.rad(10), 0, math.rad(5))
  992. lscf = lsc0 * CFrame.Angles(-math.rad(10), 0, -math.rad(5))
  993. rlcf = rlc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2-math.rad(10), 0, math.rad(5.5))
  994. llcf = llc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2-math.rad(10), 0, -math.rad(5.5))
  995. end
  996. if tool then
  997. if Personality == "Shy" then
  998. rscf = rsc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, math.rad(10))
  999. else
  1000. rscf = rsc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, 0)
  1001. end
  1002. end
  1003. if slashing then
  1004. rscf = rsc0 * CFrame.Angles(0, 0, 0)
  1005. end
  1006. end
  1007. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
  1008. if action == "None" then
  1009. BodyGyro.Parent = nil
  1010. speed = 0.2
  1011. anglespeed = 4
  1012. if ctrl then
  1013. ncf = neckc0 * CFrame.Angles(math.pi/5, 0, 0)
  1014. rjcf = rootc0 * CFrame.new(0, -.55, 0) * CFrame.Angles(-math.pi/5, 0, 0)
  1015. rscf = rsc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/12, 0, math.rad(2))
  1016. lscf = lsc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/12, 0, -math.rad(2))
  1017. llcf = llc0 * CFrame.new(0, .5, -.65) * CFrame.Angles(math.pi/5 - math.sin(angle)*.45, 0, 0)
  1018. rlcf = rlcf * CFrame.new(0, .5, -.65) * CFrame.Angles(math.pi/5 + math.sin(angle)*.45, 0, 0)
  1019. elseif not ctrl then
  1020. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  1021. rjcf = rootc0
  1022. rscf = rsc0 * CFrame.Angles(math.sin(angle)*1.3, 0, 0)
  1023. lscf = lsc0 * CFrame.Angles(math.sin(-angle)*1.3, 0, 0)
  1024. rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*1, 0, math.rad(.5))
  1025. llcf = llc0 * CFrame.Angles(math.sin(angle)*1, 0, -math.rad(.5))
  1026. end
  1027. if is_running then
  1028. coroutine.wrap(function()
  1029. is_running = false
  1030. for camerazoom = camera.FieldOfView, 70, -1 do
  1031. camera.FieldOfView = camerazoom
  1032. wait()
  1033. end
  1034. camera.FieldOfView = 70
  1035. end)()
  1036. end
  1037. if tool then
  1038. rscf = rsc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, 0)
  1039. end
  1040. if slashing then
  1041. rscf = rsc0 * CFrame.Angles(0, 0, 0)
  1042. end
  1043. end
  1044. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
  1045. if action == "Dancing" then action = "None" end
  1046. if action == "None" then
  1047. BodyGyro.Parent = nil
  1048. if sprint_time > 1 then
  1049. sprint_time = sprint_time - .5
  1050. else
  1051. humanoid.WalkSpeed = 16
  1052. cmsg("No stamina left!")
  1053. end
  1054. speed = 0.3
  1055. anglespeed = 5
  1056. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  1057. rjcf = rootc0 * CFrame.new(0, math.abs(mvmnt*.1), 0) * CFrame.Angles(-math.pi/12, math.sin(angle)*.1, 0)
  1058. rscf = rsc0 * CFrame.Angles(math.sin(angle)*2, 0, -math.sin(angle)*0.15 + math.rad(.5))
  1059. lscf = lsc0 * CFrame.Angles(math.sin(-angle)*2, 0, -math.sin(angle)*0.15 + -math.rad(.5))
  1060. rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*1.8, 0, math.rad(.5))
  1061. llcf = llc0 * CFrame.Angles(math.sin(angle)*1.8, 0, -math.rad(.5))
  1062. is_running = true
  1063. if tool then
  1064. rscf = rsc0 * CFrame.Angles(-math.pi/2.75, 0, 0)
  1065. end
  1066. end
  1067. end
  1068. if action == "None" and Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  1069. if sprint_time >= max_sprint_time-.8 then sprint_time = max_sprint_time else
  1070. sprint_time = sprint_time + .5
  1071. end
  1072. elseif action == "None" and Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
  1073. if sprint_time >= max_sprint_time-.9 then sprint_time = max_sprint_time else
  1074. sprint_time = sprint_time + .25
  1075. end
  1076. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 150 then
  1077. if action == "Dancing" then action = "None" end
  1078. if action == "None" then
  1079. BodyGyro.Parent = nil
  1080. if sprint_time > 30 then
  1081. sprint_time = sprint_time - 2
  1082. else
  1083. humanoid.WalkSpeed = 28
  1084. cmsg("TOO HOT!")
  1085. end
  1086. local expl = Instance.new("Part", workspace)
  1087. expl.Size = Vector3.new(0.2, 2, 0.2)
  1088. expl.Anchored = true
  1089. expl.Transparency = 0.25
  1090. expl.TopSurface = 0
  1091. expl.BottomSurface = 0
  1092. expl.Locked = true
  1093. expl.CanCollide = false
  1094. Instance.new("PointLight", expl).Color = expl.BrickColor.Color
  1095. expl.CFrame = torso.CFrame * CFrame.new(0, -2, 0) * CFrame.Angles(math.pi/math.random(1, 8),math.pi/math.random(1, 8),math.pi/math.random(1, 8))
  1096. expl.BrickColor = BrickColor.new("Bright orange")
  1097. local mesh = Instance.new("SpecialMesh", expl)
  1098. mesh.MeshType = "Sphere"
  1099. coroutine.wrap(function()
  1100. for _ = 0, 15 do
  1101. mesh.Scale = mesh.Scale + Vector3.new(.15, .15, .15)
  1102. expl.Transparency = expl.Transparency + 0.075
  1103. wait()
  1104. end
  1105. expl:Destroy()
  1106. end)()
  1107. speed = 0.3
  1108. anglespeed = 7
  1109. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  1110. rjcf = rootc0 * CFrame.Angles(-math.pi/12, math.sin(angle)*.1, 0)
  1111. rscf = rsc0 * CFrame.Angles(math.sin(angle)*2, 0, -math.sin(angle)*0.15 + math.rad(.5))
  1112. lscf = lsc0 * CFrame.Angles(math.sin(-angle)*2, 0, -math.sin(angle)*0.15 + -math.rad(.5))
  1113. rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*1.8, 0, math.rad(.5))
  1114. llcf = llc0 * CFrame.Angles(math.sin(angle)*1.8, 0, -math.rad(.5))
  1115. is_running = true
  1116. if tool then
  1117. rscf = rsc0 * CFrame.Angles(-math.pi/2.75, 0, 0)
  1118. end
  1119. end
  1120. end
  1121.  
  1122. if action == "None" and Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  1123. if sprint_time >= max_sprint_time-.8 then sprint_time = 250 else
  1124. sprint_time = sprint_time + .15
  1125. end
  1126. elseif action == "None" and Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
  1127. if sprint_time >= max_sprint_time-.9 then sprint_time = 250 else
  1128. sprint_time = sprint_time + .05
  1129. end
  1130. end
  1131.  
  1132. neck.C0 = clerp(neck.C0,ncf,speed)
  1133. rm.C0 = clerp(rm.C0,rscf,speed)
  1134. lm.C0 = clerp(lm.C0,lscf,speed)
  1135. rj.C0 = clerp(rj.C0,rjcf,speed)
  1136. neck.C0 = clerp(neck.C0,ncf,speed)
  1137. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  1138. llegm.C0 = clerp(llegm.C0,llcf,speed)
  1139. lastaction = action
  1140. end
  1141. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement