Advertisement
GS1029

Sprint/Walk/Jump/Look Roblox Script

Feb 17th, 2016
8,581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.20 KB | None | 0 0
  1. function clerp(c1,c2,al)
  2. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  3. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  4. for i,v in pairs(com1) do
  5. com1[i] = v+(com2[i]-v)*al
  6. end
  7. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  8. end
  9.  
  10. plr = game:service'Players'.LocalPlayer
  11. char = plr.Character
  12. mouse = plr:GetMouse()
  13. humanoid = char:findFirstChild("Humanoid")
  14. torso = char:findFirstChild("Torso")
  15. head = char.Head
  16. ra = char:findFirstChild("Right Arm")
  17. la = char:findFirstChild("Left Arm")
  18. rl = char:findFirstChild("Right Leg")
  19. ll = char:findFirstChild("Left Leg")
  20. rs = torso:findFirstChild("Right Shoulder")
  21. ls = torso:findFirstChild("Left Shoulder")
  22. rh = torso:findFirstChild("Right Hip")
  23. lh = torso:findFirstChild("Left Hip")
  24. neck = torso:findFirstChild("Neck")
  25. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  26. anim = char:findFirstChild("Animate")
  27. do --Removing ROBLOX's new Looped bug >_>
  28. local function rec(x)
  29. for i,v in pairs(x:children()) do
  30. if v:IsA'Animation' then
  31. v.AnimationId = 'rbxassetid://227770820'
  32. end
  33. rec(v)
  34. end
  35. end
  36. rec(anim) --the Animate script
  37. end
  38.  
  39. humanoid.Jump = true
  40.  
  41. wait(.4)
  42.  
  43.  
  44. if anim then
  45. anim:Destroy()
  46. end
  47. rootpart = char:findFirstChild("HumanoidRootPart")
  48. camera = workspace.CurrentCamera
  49. modelforparts = char:findFirstChild("") or Instance.new("Model", char)
  50. modelforparts.Name = ""
  51.  
  52. function trailconnect(obj, wat)
  53. local trail = {}
  54. for i = 1, 4 do
  55. local p = Instance.new("Part")
  56. p.BrickColor = obj.BrickColor
  57. p.formFactor = "Custom"
  58. p.Size = Vector3.new(0,0,0)
  59. p.Locked = false
  60. p.Anchored = false
  61. p.CanCollide = false
  62. local mesh = Instance.new("Mesh", p)
  63. mesh.Name = "Mesh"
  64. table.insert(trail,{p,0})
  65. end
  66. local lastpos = obj.Position
  67. local updatethis = 0
  68. local dontdothis = false
  69. game:service'RunService'.Stepped:connect(function()
  70. if wat == true then if dontdothis then return end
  71. for i,v in pairs(trail) do
  72. game:service'Debris':AddItem(obj, 0)
  73. table.remove(v, i)
  74. end
  75. dontdothis = true
  76. return
  77. end
  78. updatethis = ((updatethis) % 4) + 1
  79. local dstnc = (obj.Position - lastpos).magnitude
  80. trail[updatethis][1].Mesh.Scale = Vector3.new(.2,dstnc,.2)
  81. trail[updatethis][1].Parent = obj.Parent
  82. trail[updatethis][1].CFrame = CFrame.new((obj.Position + lastpos)/2,obj.Position) * CFrame.Angles(math.pi/2, 0, 0)
  83. trail[updatethis][2] = 0
  84. for i,v in pairs(trail) do
  85. v[2] = v[2] + .15
  86. v[1].Transparency = v[2]
  87. end
  88. lastpos = obj.Position
  89. end)
  90. end
  91.  
  92. do --rayCast
  93. function rayCast(startpos, Speed, Gravity, Dmg, color)
  94. local ran,err = ypcall(function()
  95. local rayPart = Instance.new("Part")
  96. rayPart.Name = "RayPart"
  97. rayPart.BrickColor = BrickColor.new(color)
  98. rayPart.Anchored = false
  99. rayPart.CanCollide = false
  100. rayPart.Locked = false
  101. rayPart.FormFactor = "Custom"
  102. rayPart.TopSurface = Enum.SurfaceType.Smooth
  103. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  104. rayPart.Size = Vector3.new(0, 0, 0)
  105. rayPart:breakJoints()
  106. Instance.new("Mesh", rayPart)
  107. local fire = Instance.new("Fire", rayPart)
  108. fire.Color = rayPart.BrickColor.Color
  109. fire.SecondaryColor = rayPart.BrickColor.Color
  110. fire.Heat = 0
  111. fire.Size = 10
  112. local pl = Instance.new("PointLight", rayPart)
  113. pl.Color = Color3.new(rayPart.BrickColor.r/1.5, rayPart.BrickColor.g/1.5, rayPart.BrickColor.b/1.5)
  114. pl.Range = 18
  115.  
  116. local hitobj = false
  117. local bulletposition = startpos.Position
  118. rayPart.CFrame = startpos.CFrame
  119. trailconnect(rayPart, hitobj)
  120.  
  121. local bulletvelocity = (Vector3.new(math.random(-2,2), math.random(-2,2), math.random(-2,2)))+( mouse.Hit.p - bulletposition).unit*Speed
  122. local bulletlastposition = bulletposition
  123.  
  124. coroutine.resume(coroutine.create(function()
  125. while true do
  126.  
  127. local dt = wait()
  128. bulletlastposition = bulletposition
  129. bulletvelocity = bulletvelocity + (Vector3.new(0, -3.81*Gravity, 0)*dt)
  130. bulletposition = bulletposition + (bulletvelocity*dt)
  131. local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
  132. local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, {char, modelforparts} )
  133.  
  134. if (torso.Position - rayPart.Position).magnitude > 840 then
  135. rayPart:Destroy()
  136. hitobj = true
  137. break
  138. end
  139.  
  140.  
  141. if hit then
  142. hitobj = true
  143. local damage = math.random(Dmg, Dmg+6)
  144. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  145. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
  146. elseif hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") then
  147. hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
  148. end
  149. local boom = Instance.new("Part", modelforparts)
  150. boom.BrickColor = rayPart.BrickColor
  151. boom.Anchored = false
  152. boom.FormFactor = "Custom"
  153. boom.Size = Vector3.new(0,0,0)
  154. boom.CanCollide = false
  155. boom.Transparency = 1
  156. boom.CFrame = CFrame.new(hitposition.x, hitposition.y, hitposition.z)
  157. boom.TopSurface = 0
  158. boom.BottomSurface = 0
  159. local sphere = Instance.new("Mesh", boom)
  160. sphere.MeshType = ""
  161. local pl = Instance.new("PointLight", boom)
  162. pl.Color = Color3.new(boom.BrickColor.r/1.5, boom.BrickColor.g/1.5, boom.BrickColor.b/1.5)
  163. pl.Range = 20
  164. for ye = 0, 8 do
  165. local lite = Instance.new("Part", boom)
  166. lite.FormFactor = "Custom"
  167. lite.Size = Vector3.new(0, 0, 0)
  168. lite.BrickColor = boom.BrickColor
  169. lite.CanCollide = false
  170. lite.TopSurface = 0
  171. lite.Anchored = false
  172. lite.BottomSurface = 0
  173. lite.Position = boom.Position + Vector3.new(math.random(-10, 10), math.random(6,15), math.random(-10, 10))
  174. end
  175.  
  176. for i = 0, 20, 2.5 do
  177. sphere.Scale = sphere.Scale + Vector3.new(i,i,i)
  178. boom.Transparency = boom.Transparency + i/60000
  179. pl.Range = pl.Range + i/15
  180. wait()
  181. end
  182. boom:Destroy()
  183. for i,v in pairs(workspace:children()) do
  184. if v:IsA("Model") and v:findFirstChild("Humanoid") then
  185. if v:findFirstChild("Head") and v:findFirstChild("Torso") then
  186. if (v:findFirstChild("Torso").Position - boom.Position).magnitude < 16 and v.Name ~= char.Name then
  187. v:findFirstChild("Humanoid"):TakeDamage(math.random(Dmg+2,Dmg+6))
  188. end
  189. end
  190. end
  191. if v and v:IsA("Part") and v.Name ~= "Base" then
  192. if (v.Position - boom.Position).magnitude < 16 then
  193. v:BreakJoints()
  194. v.TopSurface = 0
  195. v.BottomSurface = 0
  196. v.LeftSurface = 0
  197. v.RightSurface = 0
  198. v.FrontSurface = 0
  199. v.BackSurface = 0
  200. v.Anchored = false
  201. end
  202. end
  203. end
  204. pcall(function()
  205. bulletposition = hitposition
  206. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
  207. rayPart:Destroy()
  208. end)
  209. break
  210. end
  211. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
  212. rayPart.Parent = modelforparts
  213. end
  214. end))
  215. for i = 0, 0, 0 do
  216. firing = false
  217. wait()
  218. end
  219. for i = 0, 0 ,0 do
  220. firing = false
  221. wait()
  222. end
  223. end)
  224. if err then
  225. print(err)
  226. end
  227. end
  228. end
  229.  
  230.  
  231. charge = 0
  232.  
  233. plrgui = game:service'Players'.LocalPlayer:findFirstChild("")
  234.  
  235. local statusgui = Instance.new("ScreenGui", plrgui)
  236. local mainframe = Instance.new("Frame", statusgui)
  237. mainframe.Size = UDim2.new(0, 0, 0, 0)
  238. mainframe.Position = UDim2.new(.75, 0, .75, 0)
  239. mainframe.Style = 3
  240. local image = Instance.new("ImageLabel", mainframe)
  241. image.Size = UDim2.new(0, 0, 0, 0)
  242. image.Position = UDim2.new(0, 0, .235, 0)
  243. image.BackgroundTransparency = 1
  244. image.Image = ""
  245. local chargetext = Instance.new("TextLabel", mainframe)
  246. chargetext.FontSize = "Size18"
  247. chargetext.Size = UDim2.new(0, 0, 0, 0)
  248. chargetext.TextYAlignment = "Bottom"
  249. chargetext.BackgroundTransparency = 1
  250. chargetext.TextColor3 = Color3.new(1,1,1)
  251. game:service'RunService'.Stepped:connect(function()
  252. chargetext.Text = ""
  253. end)
  254.  
  255.  
  256.  
  257. local rm = Instance.new("Weld", torso)
  258. rm.C0 = CFrame.new(2, 0.6, -0.5)
  259. rm.C1 = CFrame.new(0, 0.5, 0)
  260. rm.Part0 = torso
  261. rm.Part1 = ra
  262. local lm = Instance.new("Weld", torso)
  263. lm.C0 = CFrame.new(-2, 0.6, 0.5)
  264. lm.C1 = CFrame.new(0, 0.5, 0)
  265. lm.Part0 = torso
  266. lm.Part1 = la
  267.  
  268. sound = Instance.new("Sound", head)
  269. sound.Volume = 1
  270. sound.SoundId = ""
  271. sound.Looped = true
  272.  
  273.  
  274. dancemode = true
  275. debounceofsprint = false
  276.  
  277. --create func
  278. function part(parent, size, color, formfactor, collide, transparency)
  279. if transparency == nil then transparency=1 end
  280. if collide == nil then collide=false end
  281. if formfactor == nil then formfactor="Custom" end
  282. local p = Instance.new("Part", parent)
  283. p.FormFactor = formfactor
  284. p.CanCollide = collide
  285. p.Size = size
  286. p.Locked = false
  287. p.Transparency = transparency
  288. p.Position = torso.Position + Vector3.new(0, 1, 0)
  289. p.BrickColor = color
  290. p.FrontSurface = "SmoothNoOutlines"
  291. p.BackSurface = "SmoothNoOutlines"
  292. p.LeftSurface = "SmoothNoOutlines"
  293. p.BottomSurface = "SmoothNoOutlines"
  294. p.TopSurface = "SmoothNoOutlines"
  295. p.RightSurface = "SmoothNoOutlines"
  296. return p
  297. end
  298. function wedge(parent, size, color, formfactor, collide, transparency)
  299. if transparency==nil then transparency=1 end
  300. if collide==nil then collide=false end
  301. if formfactor==nil then formfactor="Custom" end
  302. local p = Instance.new("WedgePart", parent)
  303. p.FormFactor = formfactor
  304. p.CanCollide = collide
  305. p.Size = size
  306. p.Locked = false
  307. p.Position = torso.Position
  308. p.BrickColor = color
  309. p.FrontSurface = "SmoothNoOutlines"
  310. p.BackSurface = "SmoothNoOutlines"
  311. p.LeftSurface = "SmoothNoOutlines"
  312. p.BottomSurface = "SmoothNoOutlines"
  313. p.TopSurface = "SmoothNoOutlines"
  314. p.RightSurface = "SmoothNoOutlines"
  315. return p
  316. end
  317. function weld(part0, part1, c0, parent, c1)
  318. if parent == nil then parent=char end
  319. if c1 == nil then c1=CFrame.new() end
  320.  
  321. local wel = Instance.new("Weld", parent)
  322. wel.Part0 = part0
  323. wel.Part1 = part1
  324. wel.C0 = c0
  325. wel.C1 = c1
  326. return wel
  327. end
  328. function specialmesh(parent, meshType, scale, meshId)
  329. if meshId==nil then meshId="" end
  330. local mesh = Instance.new("SpecialMesh", parent)
  331. mesh.Scale = scale
  332. mesh.MeshType = meshType
  333. mesh.MeshId = meshId
  334. return mesh
  335. end
  336. ----------------------------------------------------------------------------------------------------------
  337. --function part(parent, size, color, formfactor, collide, transparency)
  338. --function weld(part0, part1, c0, parent, c1)
  339.  
  340. ----------------------------------------------------------------------------------------------------------
  341. function animatehuman(animationid, object)
  342. local animation = object:findFirstChild("Humanoid"):LoadAnimation(animationid)
  343. animation:Play()
  344. end
  345. local danceAnim = Instance.new("Animation", char)
  346. danceAnim.AnimationId = "http://www.roblox.com/asset/?id=130018893"
  347. danceAnim.Name = "DancingAnimation"
  348. ----------------------------------------------------------------------------------------------------------
  349. local main = Instance.new("Part", char)
  350. main.FormFactor = "Custom"
  351. main.CanCollide = false
  352. main.Size = Vector3.new(0, 0, 0)
  353. main.Locked = false
  354. main.BrickColor = BrickColor.new("Black")
  355. main.TopSurface = 0
  356. main.BottomSurface = 0
  357. main.Position = torso.Position
  358. main:BreakJoints()
  359. local speaker = Instance.new("Part", char)
  360. speaker.FormFactor = "Custom"
  361. speaker.CanCollide = false
  362. speaker.Size = Vector3.new(0, 0, 0)
  363. speaker.Locked = false
  364. speaker.BrickColor = BrickColor.new("")
  365. speaker.TopSurface = 0
  366. speaker.BottomSurface = 0
  367. speaker.Position = torso.Position
  368. speaker:BreakJoints()
  369. local speaker2 = Instance.new("Part", char)
  370. speaker2.FormFactor = "Custom"
  371. speaker2.CanCollide = false
  372. speaker2.Size = Vector3.new(0, 0, 0)
  373. speaker2.Locked = false
  374. speaker2.BrickColor = BrickColor.new("")
  375. speaker2.TopSurface = 0
  376. speaker2.BottomSurface = 0
  377. speaker2.Position = torso.Position
  378. speaker2:BreakJoints()
  379. local main2 = Instance.new("Part", char)
  380. main2.FormFactor = "Custom"
  381. main2.CanCollide = false
  382. main2.Size = Vector3.new(0, 0, 0)
  383. main2.Locked = false
  384. main2.BrickColor = BrickColor.new("")
  385. main2.TopSurface = 0
  386. main2.BottomSurface = 0
  387. main2.Position = torso.Position
  388. main2:BreakJoints()
  389. local main3 = Instance.new("Part", char)
  390. main3.FormFactor = "Custom"
  391. main3.CanCollide = false
  392. main3.Size = Vector3.new(.0, 0, 0)
  393. main3.Locked = false
  394. main3.BrickColor = BrickColor.new("")
  395. main3.TopSurface = 0
  396. main3.BottomSurface = 0
  397. main3.Position = torso.Position
  398. main3:BreakJoints()
  399. local main4 = Instance.new("Part", char)
  400. main4.FormFactor = "Custom"
  401. main4.CanCollide = false
  402. main4.Size = Vector3.new(0, 0, 0)
  403. Instance.new("CylinderMesh", main4)
  404. main4.Locked = true
  405. main4.BrickColor = BrickColor.new("Black")
  406. main4.TopSurface = 0
  407. main4.BottomSurface = 0
  408. main4.Position = torso.Position
  409. main4:BreakJoints()
  410. local weld6 = weld(main4, main, CFrame.new(), char, CFrame.new(0, -.15, -.5)*CFrame.Angles(math.pi/2, 0, math.pi/2))
  411. local speaker3 = Instance.new("Part", char)
  412. speaker3.FormFactor = "Custom"
  413. speaker3.CanCollide = false
  414. speaker3.Size = Vector3.new(0, 0, 0)
  415. speaker3.Locked = true
  416. speaker3.BrickColor = BrickColor.new("Black")
  417. speaker3.TopSurface = 0
  418. speaker3.BottomSurface = 0
  419. speaker3.Position = torso.Position
  420. speaker3:BreakJoints()
  421. local welds1 = weld(speaker3, main, CFrame.new(), char, CFrame.new(-.25, -2.2, .6))
  422. local speaker4 = Instance.new("Part", char)
  423. speaker4.FormFactor = "Custom"
  424. speaker4.CanCollide = false
  425. speaker4.Size = Vector3.new(0, 0, 0)
  426. speaker4.Locked = true
  427. speaker4.BrickColor = BrickColor.new("Black")
  428. speaker4.TopSurface = 0
  429. speaker4.BottomSurface = 0
  430. speaker4.Position = torso.Position
  431. speaker4:BreakJoints()
  432. local welds2 = weld(speaker4, main, CFrame.new(), char, CFrame.new(0, -2.205, -.2))
  433. local speaker5 = Instance.new("Part", char)
  434. speaker5.FormFactor = "Custom"
  435. speaker5.CanCollide = false
  436. speaker5.Size = Vector3.new(0, 0, 0)
  437. speaker5.Locked = true
  438. speaker5.BrickColor = BrickColor.new("Black")
  439. speaker5.TopSurface = 0
  440. speaker5.BottomSurface = 0
  441. speaker5.Position = torso.Position
  442. speaker5:BreakJoints()
  443. local welds3 = weld(speaker5, main, CFrame.new(), char, CFrame.new(-.25, -2, .6))
  444. local speaker6 = Instance.new("Part", char)
  445. speaker6.FormFactor = "Custom"
  446. speaker6.CanCollide = false
  447. speaker6.Size = Vector3.new(0, 0, 0)
  448. speaker6.Locked = true
  449. speaker6.BrickColor = BrickColor.new("Black")
  450. speaker6.TopSurface = 0
  451. speaker6.BottomSurface = 0
  452. speaker6.Position = torso.Position
  453. speaker6:BreakJoints()
  454. local welds4 = weld(speaker6, main, CFrame.new(), char, CFrame.new(0, -2, -.2))
  455.  
  456. local support = Instance.new("Part", char)
  457. support.FormFactor = "Custom"
  458. support.CanCollide = false
  459. support.Size = Vector3.new(0, 0, 0)
  460. support.Locked = true
  461. support.BrickColor = BrickColor.new("Black")
  462. support.TopSurface = 0
  463. support.BottomSurface = 0
  464. support.Position = torso.Position
  465. support:BreakJoints()
  466. local welds5 = weld(support, main, CFrame.new(), char, CFrame.new(0, -1.5, -.4))
  467.  
  468.  
  469. debounce = false
  470.  
  471. function stopsound()
  472. if debounce then return end
  473. if not sound.IsPlaying then return end
  474. sound:stop()
  475. debounce = true
  476. local dancebro = Instance.new("StringValue", game:service'Lighting')
  477. dancebro.Name = ('STOPDANCING'..plr.Name)
  478. game:service'Debris':AddItem(dancebro, 1)
  479. coroutine.wrap(function()
  480. while not sound.IsPlaying do
  481. if charge <= 100 then
  482. charge = charge + .1
  483. wait()
  484. elseif charge > 100 then
  485. charge = 100
  486. break
  487. end
  488. end
  489. end)()
  490. wait(.1)
  491. debounce = false
  492. end
  493. mouse.Button1Down:connect(function(mous)
  494. if debounceofsprint then return end
  495. if sound.IsPlaying then return end
  496. if debounce then return end
  497. sound:play()
  498. for i = 0, 0, 0 do
  499. if not sound.IsPlaying then debounce = true camera.FieldOfView = 70 return end
  500. camera.FieldOfView = 70
  501. wait()
  502. end
  503. for i = 0, 0, 0 do
  504. if not sound.IsPlaying then debounce = true camera.FieldOfView = 70 return end
  505. camera.FieldOfView = 70
  506. wait()
  507. end
  508. if debounce then debounce = false return end
  509. if dancemode then
  510. for i,v in pairs(workspace:children()) do
  511. if not sound.IsPlaying then break end
  512. coroutine.wrap(function()
  513. if v:IsA("Model") and v:findFirstChild("Humanoid") and v.Name ~= char.Name and v:findFirstChild("ModelForParts") == nil and v:findFirstChild("Torso") and (v:findFirstChild("Torso").Position - head.Position).magnitude < 30 then
  514. danceAnimClone = danceAnim:clone()
  515. danceAnimClone.Parent = v
  516. danceAnimClone.AnimationId = "http://www.roblox.com/asset/?id=130018893"
  517. wait()
  518. NLS([[
  519. function animatehuman(animationid, object)
  520. local animation = object:findFirstChild("Humanoid"):LoadAnimation(animationid)
  521. animation:Play()
  522. end
  523. while wait(.5) do
  524. if game:service'Lighting':findFirstChild("STOPDANCING]]..plr.Name..[[") and game:service'Lighting':findFirstChild("STOPDANCING]]..plr.Name..[["):IsA("StringValue") then game:service'Debris':AddItem(script.Parent:findFirstChild("DancingAnimation"), 5) break end
  525. animatehuman(script.Parent:findFirstChild("DancingAnimation"), script.Parent)
  526. end
  527. ]], v)
  528. end
  529. end)()
  530. end
  531. end
  532. coroutine.wrap(function()
  533. while sound.IsPlaying do
  534. if charge <= 1 then
  535. if debounce then break end
  536. if not sound.IsPlaying then break end
  537. sound:stop()
  538. debounce = true
  539. chargetext.TextColor3 = Color3.new(1,0,0)
  540. dancebro = Instance.new("StringValue", game:service'Lighting')
  541. dancebro.Name = ('STOPDANCING'..plr.Name)
  542. game:service'Debris':AddItem(dancebro, 1)
  543. coroutine.wrap(function()
  544. repeat wait() until charge >= 10
  545. debounce = false
  546. chargetext.TextColor3 = Color3.new(1,1,1)
  547. end)()
  548. coroutine.wrap(function()
  549. while not sound.IsPlaying do
  550. if charge <= 100 then
  551. charge = charge + .1
  552. wait()
  553. elseif charge > 100 then
  554. charge = 100
  555. break
  556. end
  557. end
  558. end)()
  559. else
  560. charge = charge - .08
  561. wait()
  562. end
  563. end
  564. end)()
  565. coroutine.wrap(function()
  566. local ran,err = ypcall(function()
  567. while sound.IsPlaying and Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 do
  568. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  569. if not sound.IsPlaying then break end
  570. rayCast(speaker, 1250, 0, 5, "Lavender")
  571. wait(.35)
  572. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  573. if not sound.IsPlaying then break end
  574. rayCast(speaker, 1250, 0, 5, "Pink")
  575. wait(.95)
  576. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  577. if not sound.IsPlaying then break end
  578. rayCast(speaker, 1250, 0, 5, "Bright bluish green")
  579. wait(.55)
  580. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  581. if not sound.IsPlaying then break end
  582. rayCast(speaker, 1250, 0, 5, "Pink")
  583. wait(.4)
  584. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  585. if not sound.IsPlaying then break end
  586. rayCast(speaker, 1250, 0, 5, "Bright bluish green")
  587. local pl = Instance.new("PointLight", torso)
  588. pl.Color = Color3.new(153/255/1.25, 102/255/1.25, 204/255/1.25)
  589. pl.Range = 30
  590. pl.Brightness = 0.7
  591. game:service'Debris':AddItem(pl, .3)
  592. wait(.45)
  593. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  594. if not sound.IsPlaying then break end
  595. rayCast(speaker, 1250, 0, 5, "Lavender")
  596. wait(.75)
  597. end
  598. end) if err then print(err) end
  599. end)()
  600. end)
  601.  
  602. mouse.Button1Up:connect(function(mous)
  603. stopsound()
  604. end)
  605. ctrl = false
  606. mouse.KeyDown:connect(function(k)
  607. if string.byte(k) == 50 then
  608. ctrl = true
  609. humanoid.WalkSpeed = 8
  610. humanoid.JumpPower = 25
  611. end
  612. if string.byte(k) == 48 then
  613. humanoid.WalkSpeed = 75
  614. humanoid.JumpPower = 75
  615. end
  616. end)
  617.  
  618. mouse.KeyUp:connect(function(k)
  619. if string.byte(k) == 50 then
  620. ctrl = false
  621. humanoid.WalkSpeed = 16
  622. humanoid.JumpPower = 50
  623. humanoid.Health = 1000
  624. humanoid.MaxHealth = 1000
  625. end
  626. if string.byte(k) == 48 then
  627. humanoid.WalkSpeed = 16
  628. humanoid.JumpPower = 50
  629. if ctrl then
  630. humanoid.WalkSpeed = 8
  631. humanoid.JumpPower = 25
  632. end
  633. end
  634. end)
  635.  
  636. humanoid.Died:connect(function()
  637. deathpos = torso.Position
  638. WorkModel = Instance.new("", workspace)
  639. WorkModel.Name = " "
  640. wait(1/60)
  641. humanoid.Parent = nil
  642. if torso then
  643. local Head = char:FindFirstChild("Head")
  644. if Head then
  645. local Neck = Instance.new("Weld")
  646. Neck.Name = "Neck"
  647. Neck.Part0 = torso
  648. Neck.Part1 = Head
  649. Neck.C0 = CFrame.new(0, 1.5, 0)
  650. Neck.C1 = CFrame.new()
  651. Neck.Parent = torso
  652. end
  653. local Limb = char:FindFirstChild("Right Arm")
  654. if Limb then
  655.  
  656. Limb.CFrame = torso.CFrame * CFrame.new(0, 0, 0)
  657. local Joint = Instance.new("Glue")
  658. Joint.Name = "RightShoulder"
  659. Joint.Part0 = torso
  660. Joint.Part1 = Limb
  661. Joint.C0 = CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  662. Joint.C1 = CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  663. Joint.Parent = torso
  664.  
  665. local B = Instance.new("Part")
  666. B.TopSurface = 0
  667. B.BottomSurface = 0
  668. B.formFactor = "Symmetric"
  669. B.Size = Vector3.new(0, 0, 0)
  670. B.Transparency = 1
  671. B.CFrame = Limb.CFrame * CFrame.new(0, 0, 0)
  672. B.Parent = char
  673. B.CanCollide = false
  674. local W = Instance.new("Weld")
  675. W.Part0 = Limb
  676. W.Part1 = B
  677. W.C0 = CFrame.new(0, 0.5, 0)
  678. W.Parent = Limb
  679.  
  680. end
  681. local Limb = char:FindFirstChild("Left Arm")
  682. if Limb then
  683.  
  684. Limb.CFrame = torso.CFrame * CFrame.new(0, 0, 0)
  685. local Joint = Instance.new("Glue")
  686. Joint.Name = "LeftShoulder"
  687. Joint.Part0 = torso
  688. Joint.Part1 = Limb
  689. Joint.C0 = CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  690. Joint.C1 = CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  691. Joint.Parent = torso
  692.  
  693. local B = Instance.new("Part")
  694. B.TopSurface = 0
  695. B.BottomSurface = 0
  696. B.formFactor = "Symmetric"
  697. B.Size = Vector3.new(0, 0, 0)
  698. B.Transparency = 1
  699. B.CFrame = Limb.CFrame * CFrame.new(0, 0, 0)
  700. B.Parent = char
  701. B.CanCollide = false
  702. local W = Instance.new("Weld")
  703. W.Part0 = Limb
  704. W.Part1 = B
  705. W.C0 = CFrame.new(0, 0, 0)
  706. W.Parent = Limb
  707.  
  708. end
  709. local Limb = char:FindFirstChild("Right Leg")
  710. if Limb then
  711.  
  712. Limb.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
  713. local Joint = Instance.new("Glue")
  714. Joint.Name = "RightHip"
  715. Joint.Part0 = torso
  716. Joint.Part1 = Limb
  717. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  718. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  719. Joint.Parent = torso
  720.  
  721. local B = Instance.new("Part")
  722. B.TopSurface = 0
  723. B.BottomSurface = 0
  724. B.formFactor = "Symmetric"
  725. B.Size = Vector3.new(0, 0, 0)
  726. B.Transparency = 1
  727. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  728. B.Parent = char
  729. B.CanCollide = false
  730. local W = Instance.new("Weld")
  731. W.Part0 = Limb
  732. W.Part1 = B
  733. W.C0 = CFrame.new(0, -0.5, 0)
  734. W.Parent = Limb
  735.  
  736. end
  737. local Limb = char:FindFirstChild("Left Leg")
  738. if Limb then
  739.  
  740. Limb.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
  741. local Joint = Instance.new("Glue")
  742. Joint.Name = "LeftHip"
  743. Joint.Part0 = torso
  744. Joint.Part1 = Limb
  745. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  746. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  747. Joint.Parent = torso
  748.  
  749. local B = Instance.new("Part")
  750. B.TopSurface = 0
  751. B.BottomSurface = 0
  752. B.formFactor = "Symmetric"
  753. B.Size = Vector3.new(0, 0, 0)
  754. B.Transparency = 1
  755. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  756. B.Parent = char
  757. B.CanCollide = false
  758. local W = Instance.new("Weld")
  759. W.Part0 = Limb
  760. W.Part1 = B
  761. W.C0 = CFrame.new(0, -0.5, 0)
  762. W.Parent = Limb
  763. end
  764. for blood = 0, 3 do
  765. local blood = Instance.new("Part", workspace)
  766. blood.BrickColor = BrickColor.Red()
  767. blood.FormFactor = "Custom"
  768. blood.Size = Vector3.new(0,0,0)
  769. blood.Anchored = false
  770. blood.TopSurface = "Smooth"
  771. blood.BackSurface = "Smooth"
  772. local bloodmesh = Instance.new("Mesh", blood)
  773. bloodmesh.Scale = Vector3.new(3, 0, 3)
  774. local rayzb = Ray.new(torso.Position, Vector3.new(0, -20, 0) + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)))
  775. local hitzb, hitposb = workspace:findPartOnRay(rayzb, char)
  776. if hitzb then
  777. blood.CFrame = CFrame.new(hitposb.x,hitposb.y,hitposb.z)
  778. blood.CFrame = blood.CFrame * CFrame.new(0, .05, 0)
  779. coroutine.wrap(function()
  780. for cframe = 0, math.random(16, 24) do
  781. bloodmesh.Scale = bloodmesh.Scale + Vector3.new(.45, 0, .45)
  782. wait()
  783. end
  784. end)()
  785. elseif not hitzb then
  786. blood:Destroy()
  787. end
  788. end
  789. local BP = Instance.new("BodyPosition", torso)
  790. BP.maxForce = Vector3.new(1,1,1)/0
  791. BP.position = deathpos
  792. for i,v in pairs(char:children()) do
  793. if v:IsA("Part") then v.Parent = WorkModel end
  794. end
  795. wait(.3)
  796. BP:Destroy()
  797. end
  798. end)
  799.  
  800. local rlegm = Instance.new("Motor", torso)
  801. rlegm.C0 = CFrame.new(0.5, -1, 0)
  802. rlegm.C1 = CFrame.new(0, 1, 0)
  803. rlegm.Part0 = torso
  804. rlegm.Part1 = rl
  805. rlegm.Name = "Right Hip"
  806. local llegm = Instance.new("Motor", torso)
  807. llegm.C0 = CFrame.new(-0.5, -1, 0)
  808. llegm.C1 = CFrame.new(0, 1, 0)
  809. llegm.Part0 = torso
  810. llegm.Part1 = ll
  811. llegm.Name = "Left Hip"
  812. neck.C0 = CFrame.new(0, 1, 0)
  813. neck.C1 = CFrame.new(0, -0.5, 0)
  814. rj.C0 = CFrame.new(0, -1, 0)
  815. rj.C1 = CFrame.new(0, -1, 0)
  816. rsc0 = rm.C0
  817. lsc0 = lm.C0
  818. neckc0 = neck.C0
  819. rootc0 = rj.C0
  820. llc0 = llegm.C0
  821. rlc0 = rlegm.C0
  822. speed = 0.4
  823. angle = 0
  824. anglespeed = 0
  825. mvmnt = 0
  826. game:service'RunService'.RenderStepped:connect(function()
  827. angle = (angle % 100) + anglespeed/10
  828. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  829. local rscf = rsc0
  830. local lscf = lsc0
  831. local rlcf = rlc0
  832. local llcf = llc0
  833. local rjcf = rootc0
  834. local ncf = neckc0
  835. local rayz = Ray.new(rootpart.Position, Vector3.new(0, -4.1, 0))
  836. local hitz, enz = workspace:findPartOnRay(rayz, char)
  837. --math.asin(mouse.UnitRay.Direction.y)
  838. ncf = neckc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y, 0, 0)
  839. rscf = rsc0 * CFrame.new(-.55, -.0, .45) * CFrame.Angles(math.pi/0.001+math.pi/-.5, 0, 0.2)
  840. lscf = lsc0 * CFrame.new(.55, -.0, -.45) * CFrame.Angles(math.pi/0.001+math.pi/-.5, 0, -0.2)
  841. if firing then
  842. rscf = rsc0 * CFrame.new(0, 0, 0) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, 0)
  843. lscf = lsc0 * CFrame.new(0, 0, 0) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, math.rad(45))
  844. end
  845. if not hitz then
  846. ncf = neckc0 * CFrame.Angles(math.pi/18, 0, 0)
  847. rscf = rsc0 * CFrame.new(-0.8, 0.4, 0.5) * CFrame.Angles(math.pi/420000+math.pi/18, 5.6, -180.9)
  848. lscf = lsc0 * CFrame.new(0.8, 0.4, -0.5) * CFrame.Angles(math.pi/420000+math.pi/-18, -5.6, 181.1)
  849. rjcf = rootc0 * CFrame.Angles(-math.pi/32, 0, 0)
  850. rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) * CFrame.Angles(-math.pi/14, 0, 0)
  851. llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0)
  852. elseif humanoid.Sit then
  853. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  854. rjcf = rootc0 * CFrame.new(0, -.2, 0)
  855. rlcf = rlc0 * CFrame.Angles(math.pi/2, 0, math.rad(7.5))
  856. llcf = llc0 * CFrame.Angles(math.pi/2, 0, -math.rad(7.5))
  857. if sprinting then
  858. debounceofsprint = false
  859. sprinting = false
  860. end
  861. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  862. speed = 0.3
  863. if ctrl then
  864. rjcf = rootc0 * CFrame.new(0, -1.25, 0)
  865. llcf = llc0 * CFrame.new(0, 0, -.45) * CFrame.Angles(-math.pi/2.2, 0, 0)
  866. rlcf = rlcf * CFrame.new(0, 1.25, -.85)
  867. else
  868. rjcf = rootc0
  869. rlcf = rlc0 * CFrame.Angles(-math.rad(.5), 0, math.rad(1.5))
  870. llcf = llc0 * CFrame.Angles(math.rad(1.5), 0, -math.rad(1.5))
  871. end
  872. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
  873. if not humanoid.Sit then
  874. anglespeed = 2
  875. if ctrl then
  876. anglespeed = 3
  877. ncf = neckc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/18, 0, 0)
  878. rjcf = rootc0 * CFrame.new(0, -.35, 0) * CFrame.Angles(-math.pi/18, 0, 0)
  879. rscf = rsc0 * CFrame.new(-0.6, 0.2, 0.7) * CFrame.Angles(math.pi/420000+math.pi/18, 5.6, -181.6)
  880. lscf = lsc0 * CFrame.new(0.6, 0.2, -0.4) * CFrame.Angles(math.pi/420000+math.pi/-18, -5.6, 181.8)
  881. llcf = llc0 * CFrame.new(0, .45, -.35) * CFrame.Angles(math.pi/18 - math.sin(angle)*.45, 0, 0)
  882. rlcf = rlcf * CFrame.new(0, .45, -.35) * CFrame.Angles(math.pi/18 + math.sin(angle)*.45, 0, 0)
  883. else
  884. rjcf = rootc0
  885. rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*.65, 0, math.rad(.5))
  886. llcf = llc0 * CFrame.Angles(math.sin(angle)*.65, 0, -math.rad(.5))
  887. end
  888. if sprinting then
  889. debounceofsprint = false
  890. sprinting = false
  891. end
  892. end
  893. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
  894. if not humanoid.Sit then
  895. anglespeed = 2.7
  896. ncf = neckc0 * CFrame.Angles(math.pi/18, 0, 0)
  897. rscf = rsc0 * CFrame.new(-0.8, 0.4, 0.5) * CFrame.Angles(math.pi/420000+math.pi/18, 5.6, -180.9)
  898. lscf = lsc0 * CFrame.new(0.8, 0.4, -0.5) * CFrame.Angles(math.pi/420000+math.pi/-18, -5.6, 181.1)
  899. rjcf = rootc0 * CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/18, math.sin(angle)*.1, math.sin(angle)*.045)
  900. rlcf = rlc0 * CFrame.new(0, .3 + -math.cos(-angle)*.3, -.2+math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
  901. llcf = llc0 * CFrame.new(0, .3 - -math.cos(angle)*.3, -.05-math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
  902. sprinting = true
  903. debounceofsprint = true
  904. end
  905. end
  906. rm.C0 = clerp(rm.C0,rscf,speed)
  907. lm.C0 = clerp(lm.C0,lscf,speed)
  908. rj.C0 = clerp(rj.C0,rjcf,speed)
  909. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  910. llegm.C0 = clerp(llegm.C0,llcf,speed)
  911. neck.C0 = clerp(neck.C0,ncf,speed)
  912. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement