Advertisement
Alishan555

Untitled

Mar 18th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.98 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. end
  611. if string.byte(k) == 48 then
  612. humanoid.WalkSpeed = 150
  613. end
  614. end)
  615.  
  616. mouse.KeyUp:connect(function(k)
  617. if string.byte(k) == 50 then
  618. ctrl = false
  619. humanoid.WalkSpeed = 16
  620. end
  621. if string.byte(k) == 48 then
  622. humanoid.WalkSpeed = 150
  623. if ctrl then
  624. humanoid.WalkSpeed = 8
  625. end
  626. end
  627. end)
  628.  
  629. humanoid.Died:connect(function()
  630. deathpos = torso.Position
  631. WorkModel = Instance.new("", workspace)
  632. WorkModel.Name = " "
  633. wait(1/60)
  634. humanoid.Parent = nil
  635. if torso then
  636. local Head = char:FindFirstChild("Head")
  637. if Head then
  638. local Neck = Instance.new("Weld")
  639. Neck.Name = "Neck"
  640. Neck.Part0 = torso
  641. Neck.Part1 = Head
  642. Neck.C0 = CFrame.new(0, 1.5, 0)
  643. Neck.C1 = CFrame.new()
  644. Neck.Parent = torso
  645. end
  646. local Limb = char:FindFirstChild("Right Arm")
  647. if Limb then
  648.  
  649. Limb.CFrame = torso.CFrame * CFrame.new(0, 0, 0)
  650. local Joint = Instance.new("Glue")
  651. Joint.Name = "RightShoulder"
  652. Joint.Part0 = torso
  653. Joint.Part1 = Limb
  654. Joint.C0 = CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  655. Joint.C1 = CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  656. Joint.Parent = torso
  657.  
  658. local B = Instance.new("Part")
  659. B.TopSurface = 0
  660. B.BottomSurface = 0
  661. B.formFactor = "Symmetric"
  662. B.Size = Vector3.new(0, 0, 0)
  663. B.Transparency = 1
  664. B.CFrame = Limb.CFrame * CFrame.new(0, 0, 0)
  665. B.Parent = char
  666. B.CanCollide = false
  667. local W = Instance.new("Weld")
  668. W.Part0 = Limb
  669. W.Part1 = B
  670. W.C0 = CFrame.new(0, 0.5, 0)
  671. W.Parent = Limb
  672.  
  673. end
  674. local Limb = char:FindFirstChild("Left Arm")
  675. if Limb then
  676.  
  677. Limb.CFrame = torso.CFrame * CFrame.new(0, 0, 0)
  678. local Joint = Instance.new("Glue")
  679. Joint.Name = "LeftShoulder"
  680. Joint.Part0 = torso
  681. Joint.Part1 = Limb
  682. Joint.C0 = CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  683. Joint.C1 = CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  684. Joint.Parent = torso
  685.  
  686. local B = Instance.new("Part")
  687. B.TopSurface = 0
  688. B.BottomSurface = 0
  689. B.formFactor = "Symmetric"
  690. B.Size = Vector3.new(0, 0, 0)
  691. B.Transparency = 1
  692. B.CFrame = Limb.CFrame * CFrame.new(0, 0, 0)
  693. B.Parent = char
  694. B.CanCollide = false
  695. local W = Instance.new("Weld")
  696. W.Part0 = Limb
  697. W.Part1 = B
  698. W.C0 = CFrame.new(0, 0, 0)
  699. W.Parent = Limb
  700.  
  701. end
  702. local Limb = char:FindFirstChild("Right Leg")
  703. if Limb then
  704.  
  705. Limb.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
  706. local Joint = Instance.new("Glue")
  707. Joint.Name = "RightHip"
  708. Joint.Part0 = torso
  709. Joint.Part1 = Limb
  710. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  711. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  712. Joint.Parent = torso
  713.  
  714. local B = Instance.new("Part")
  715. B.TopSurface = 0
  716. B.BottomSurface = 0
  717. B.formFactor = "Symmetric"
  718. B.Size = Vector3.new(0, 0, 0)
  719. B.Transparency = 1
  720. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  721. B.Parent = char
  722. B.CanCollide = false
  723. local W = Instance.new("Weld")
  724. W.Part0 = Limb
  725. W.Part1 = B
  726. W.C0 = CFrame.new(0, -0.5, 0)
  727. W.Parent = Limb
  728.  
  729. end
  730. local Limb = char:FindFirstChild("Left Leg")
  731. if Limb then
  732.  
  733. Limb.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
  734. local Joint = Instance.new("Glue")
  735. Joint.Name = "LeftHip"
  736. Joint.Part0 = torso
  737. Joint.Part1 = Limb
  738. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  739. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  740. Joint.Parent = torso
  741.  
  742. local B = Instance.new("Part")
  743. B.TopSurface = 0
  744. B.BottomSurface = 0
  745. B.formFactor = "Symmetric"
  746. B.Size = Vector3.new(0, 0, 0)
  747. B.Transparency = 1
  748. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  749. B.Parent = char
  750. B.CanCollide = false
  751. local W = Instance.new("Weld")
  752. W.Part0 = Limb
  753. W.Part1 = B
  754. W.C0 = CFrame.new(0, -0.5, 0)
  755. W.Parent = Limb
  756. end
  757. for blood = 0, 3 do
  758. local blood = Instance.new("Part", workspace)
  759. blood.BrickColor = BrickColor.Red()
  760. blood.FormFactor = "Custom"
  761. blood.Size = Vector3.new(0,0,0)
  762. blood.Anchored = false
  763. blood.TopSurface = "Smooth"
  764. blood.BackSurface = "Smooth"
  765. local bloodmesh = Instance.new("Mesh", blood)
  766. bloodmesh.Scale = Vector3.new(3, 0, 3)
  767. local rayzb = Ray.new(torso.Position, Vector3.new(0, -20, 0) + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)))
  768. local hitzb, hitposb = workspace:findPartOnRay(rayzb, char)
  769. if hitzb then
  770. blood.CFrame = CFrame.new(hitposb.x,hitposb.y,hitposb.z)
  771. blood.CFrame = blood.CFrame * CFrame.new(0, .05, 0)
  772. coroutine.wrap(function()
  773. for cframe = 0, math.random(16, 24) do
  774. bloodmesh.Scale = bloodmesh.Scale + Vector3.new(.45, 0, .45)
  775. wait()
  776. end
  777. end)()
  778. elseif not hitzb then
  779. blood:Destroy()
  780. end
  781. end
  782. local BP = Instance.new("BodyPosition", torso)
  783. BP.maxForce = Vector3.new(1,1,1)/0
  784. BP.position = deathpos
  785. for i,v in pairs(char:children()) do
  786. if v:IsA("Part") then v.Parent = WorkModel end
  787. end
  788. wait(.3)
  789. BP:Destroy()
  790. end
  791. end)
  792.  
  793. local rlegm = Instance.new("Motor", torso)
  794. rlegm.C0 = CFrame.new(0.5, -1, 0)
  795. rlegm.C1 = CFrame.new(0, 1, 0)
  796. rlegm.Part0 = torso
  797. rlegm.Part1 = rl
  798. rlegm.Name = "Right Hip"
  799. local llegm = Instance.new("Motor", torso)
  800. llegm.C0 = CFrame.new(-0.5, -1, 0)
  801. llegm.C1 = CFrame.new(0, 1, 0)
  802. llegm.Part0 = torso
  803. llegm.Part1 = ll
  804. llegm.Name = "Left Hip"
  805. neck.C0 = CFrame.new(0, 1, 0)
  806. neck.C1 = CFrame.new(0, -0.5, 0)
  807. rj.C0 = CFrame.new(0, -1, 0)
  808. rj.C1 = CFrame.new(0, -1, 0)
  809. rsc0 = rm.C0
  810. lsc0 = lm.C0
  811. neckc0 = neck.C0
  812. rootc0 = rj.C0
  813. llc0 = llegm.C0
  814. rlc0 = rlegm.C0
  815. speed = 0.4
  816. angle = 0
  817. anglespeed = 0
  818. mvmnt = 0
  819. game:service'RunService'.RenderStepped:connect(function()
  820. angle = (angle % 100) + anglespeed/10
  821. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  822. local rscf = rsc0
  823. local lscf = lsc0
  824. local rlcf = rlc0
  825. local llcf = llc0
  826. local rjcf = rootc0
  827. local ncf = neckc0
  828. local rayz = Ray.new(rootpart.Position, Vector3.new(0, -4.1, 0))
  829. local hitz, enz = workspace:findPartOnRay(rayz, char)
  830. --math.asin(mouse.UnitRay.Direction.y)
  831. ncf = neckc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y, 0, 0)
  832. rscf = rsc0 * CFrame.new(-.55, -.0, .45) * CFrame.Angles(math.pi/0.001+math.pi/-.5, 0, 0.2)
  833. lscf = lsc0 * CFrame.new(.55, -.0, -.45) * CFrame.Angles(math.pi/0.001+math.pi/-.5, 0, -0.2)
  834. if firing then
  835. rscf = rsc0 * CFrame.new(0, 0, 0) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, 0)
  836. lscf = lsc0 * CFrame.new(0, 0, 0) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, math.rad(45))
  837. end
  838. if not hitz then
  839. ncf = neckc0 * CFrame.Angles(math.pi/18, 0, 0)
  840. rscf = rsc0 * CFrame.new(-0.8, 0.4, 0.5) * CFrame.Angles(math.pi/420000+math.pi/18, 5.6, -180.9)
  841. lscf = lsc0 * CFrame.new(0.8, 0.4, -0.5) * CFrame.Angles(math.pi/420000+math.pi/-18, -5.6, 181.1)
  842. rjcf = rootc0 * CFrame.Angles(-math.pi/32, 0, 0)
  843. rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) * CFrame.Angles(-math.pi/14, 0, 0)
  844. llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0)
  845. elseif humanoid.Sit then
  846. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  847. rjcf = rootc0 * CFrame.new(0, -.2, 0)
  848. rlcf = rlc0 * CFrame.Angles(math.pi/2, 0, math.rad(7.5))
  849. llcf = llc0 * CFrame.Angles(math.pi/2, 0, -math.rad(7.5))
  850. if sprinting then
  851. debounceofsprint = false
  852. sprinting = false
  853. end
  854. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  855. speed = 0.3
  856. if ctrl then
  857. rjcf = rootc0 * CFrame.new(0, -1.25, 0)
  858. llcf = llc0 * CFrame.new(0, 0, -.45) * CFrame.Angles(-math.pi/2.2, 0, 0)
  859. rlcf = rlcf * CFrame.new(0, 1.25, -.85)
  860. else
  861. rjcf = rootc0
  862. rlcf = rlc0 * CFrame.Angles(-math.rad(.5), 0, math.rad(1.5))
  863. llcf = llc0 * CFrame.Angles(math.rad(1.5), 0, -math.rad(1.5))
  864. end
  865. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
  866. if not humanoid.Sit then
  867. anglespeed = 2
  868. if ctrl then
  869. anglespeed = 3
  870. ncf = neckc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/18, 0, 0)
  871. rjcf = rootc0 * CFrame.new(0, -.35, 0) * CFrame.Angles(-math.pi/18, 0, 0)
  872. rscf = rsc0 * CFrame.new(-0.6, 0.2, 0.7) * CFrame.Angles(math.pi/420000+math.pi/18, 5.6, -181.6)
  873. lscf = lsc0 * CFrame.new(0.6, 0.2, -0.4) * CFrame.Angles(math.pi/420000+math.pi/-18, -5.6, 181.8)
  874. llcf = llc0 * CFrame.new(0, .45, -.35) * CFrame.Angles(math.pi/18 - math.sin(angle)*.45, 0, 0)
  875. rlcf = rlcf * CFrame.new(0, .45, -.35) * CFrame.Angles(math.pi/18 + math.sin(angle)*.45, 0, 0)
  876. else
  877. rjcf = rootc0
  878. rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*.65, 0, math.rad(.5))
  879. llcf = llc0 * CFrame.Angles(math.sin(angle)*.65, 0, -math.rad(.5))
  880. end
  881. if sprinting then
  882. debounceofsprint = false
  883. sprinting = false
  884. end
  885. end
  886. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
  887. if not humanoid.Sit then
  888. anglespeed = 2.7
  889. ncf = neckc0 * CFrame.Angles(math.pi/18, 0, 0)
  890. rscf = rsc0 * CFrame.new(-0.8, 0.4, 0.5) * CFrame.Angles(math.pi/420000+math.pi/18, 5.6, -180.9)
  891. lscf = lsc0 * CFrame.new(0.8, 0.4, -0.5) * CFrame.Angles(math.pi/420000+math.pi/-18, -5.6, 181.1)
  892. rjcf = rootc0 * CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/18, math.sin(angle)*.1, math.sin(angle)*.045)
  893. 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))
  894. 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))
  895. sprinting = true
  896. debounceofsprint = true
  897. end
  898. end
  899. rm.C0 = clerp(rm.C0,rscf,speed)
  900. lm.C0 = clerp(lm.C0,lscf,speed)
  901. rj.C0 = clerp(rj.C0,rjcf,speed)
  902. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  903. llegm.C0 = clerp(llegm.C0,llcf,speed)
  904. neck.C0 = clerp(neck.C0,ncf,speed)
  905. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement