StaphanoRulez

Untitled

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