ScripterExecutioner

anim script

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