Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.53 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. print'Courtsey of matteo101man'
  88. do --CFrame lerp (stravant, clerp by AntiBoomz0r)
  89. local function QuaternionFromCFrame(cf)
  90. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  91. local trace = m00 + m11 + m22
  92. if trace > 0 then
  93. local s = math.sqrt(1 + trace)
  94. local recip = 0.5/s
  95. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  96. else
  97. local i = 0
  98. if m11 > m00 then
  99. i = 1
  100. end
  101. if m22 > (i == 0 and m00 or m11) then
  102. i = 2
  103. end
  104. if i == 0 then
  105. local s = math.sqrt(m00-m11-m22+1)
  106. local recip = 0.5/s
  107. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  108. elseif i == 1 then
  109. local s = math.sqrt(m11-m22-m00+1)
  110. local recip = 0.5/s
  111. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  112. elseif i == 2 then
  113. local s = math.sqrt(m22-m00-m11+1)
  114. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  115. end
  116. end
  117. end
  118. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  119. local xs, ys, zs = x + x, y + y, z + z
  120. local wx, wy, wz = w*xs, w*ys, w*zs
  121. local xx = x*xs
  122. local xy = x*ys
  123. local xz = x*zs
  124. local yy = y*ys
  125. local yz = y*zs
  126. local zz = z*zs
  127. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  128. end
  129. function QuaternionSlerp(a, b, t)
  130. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  131. local startInterp, finishInterp;
  132. if cosTheta >= 0.0001 then
  133. if (1 - cosTheta) > 0.0001 then
  134. local theta = math.acos(cosTheta)
  135. local invSinTheta = 1/math.sin(theta)
  136. startInterp = math.sin((1-t)*theta)*invSinTheta
  137. finishInterp = math.sin(t*theta)*invSinTheta
  138. else
  139. startInterp = 1-t
  140. finishInterp = t
  141. end
  142. else
  143. if (1+cosTheta) > 0.0001 then
  144. local theta = math.acos(-cosTheta)
  145. local invSinTheta = 1/math.sin(theta)
  146. startInterp = math.sin((t-1)*theta)*invSinTheta
  147. finishInterp = math.sin(t*theta)*invSinTheta
  148. else
  149. startInterp = t-1
  150. finishInterp = t
  151. end
  152. end
  153. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  154. end
  155. function clerp(a,b,t)
  156. local qa = {QuaternionFromCFrame(a)}
  157. local qb = {QuaternionFromCFrame(b)}
  158. local ax, ay, az = a.x, a.y, a.z
  159. local bx, by, bz = b.x, b.y, b.z
  160. local _t = 1-t
  161. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  162. end
  163. end
  164. plr = owner
  165. char = plr.Character
  166. humanoid = char:findFirstChild("Humanoid")
  167. torso = char:findFirstChild("Torso")
  168. head = char.Head
  169. ra = char:findFirstChild("Right Arm")
  170. la = char:findFirstChild("Left Arm")
  171. rl = char:findFirstChild("Right Leg")
  172. ll = char:findFirstChild("Left Leg")
  173. rs = torso:findFirstChild("Right Shoulder")
  174. ls = torso:findFirstChild("Left Shoulder")
  175. rh = torso:findFirstChild("Right Hip")
  176. lh = torso:findFirstChild("Left Hip")
  177. neck = torso:findFirstChild("Neck")
  178. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  179. anim = char:findFirstChild("Animate")
  180. if anim then
  181. anim:Destroy()
  182. end
  183. rootpart = char:findFirstChild("HumanoidRootPart")
  184. camera = workspace.CurrentCamera
  185. modelforparts = char:findFirstChild("ModelForParts") or Instance.new("Model", char)
  186. modelforparts.Name = "ModelForParts"
  187. function trailconnect(obj, wat)
  188. local trail = {}
  189. for i = 1, 4 do
  190. local p = Instance.new("Part")
  191. p.BrickColor = obj.BrickColor
  192. p.formFactor = "Custom"
  193. p.Size = Vector3.new(1,1,1)
  194. p.Locked = true
  195. p.Anchored = true
  196. p.CanCollide = false
  197. local mesh = Instance.new("CylinderMesh", p)
  198. mesh.Name = "Mesh"
  199. table.insert(trail,{p,0})
  200. end
  201. local lastpos = obj.Position
  202. local updatethis = 0
  203. local dontdothis = false
  204. game:service'RunService'.Stepped:connect(function()
  205. if wat == true then if dontdothis then return end
  206. for i,v in pairs(trail) do
  207. game:service'Debris':AddItem(obj, 0)
  208. table.remove(v, i)
  209. end
  210. dontdothis = true
  211. return
  212. end
  213. updatethis = ((updatethis) % 4) + 1
  214. local dstnc = (obj.Position - lastpos).magnitude
  215. trail[updatethis][1].Mesh.Scale = Vector3.new(.2,dstnc,.2)
  216. trail[updatethis][1].Parent = obj.Parent
  217. trail[updatethis][1].CFrame = CFrame.new((obj.Position + lastpos)/2,obj.Position) * CFrame.Angles(math.pi/2, 0, 0)
  218. trail[updatethis][2] = 0
  219. for i,v in pairs(trail) do
  220. v[2] = v[2] + .15
  221. v[1].Transparency = v[2]
  222. end
  223. lastpos = obj.Position
  224. end)
  225. end
  226. do --rayCast
  227. function rayCast(startpos, Speed, Gravity, Dmg, color)
  228. local ran,err = ypcall(function()
  229. local rayPart = Instance.new("Part")
  230. rayPart.Name = "RayPart"
  231. rayPart.BrickColor = BrickColor.new(color)
  232. rayPart.Anchored = true
  233. rayPart.CanCollide = false
  234. rayPart.Locked = true
  235. rayPart.FormFactor = "Custom"
  236. rayPart.TopSurface = Enum.SurfaceType.Smooth
  237. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  238. rayPart.Size = Vector3.new(.2, 50, .2)
  239. rayPart:breakJoints()
  240. Instance.new("CylinderMesh", rayPart)
  241. local fire = Instance.new("Fire", rayPart)
  242. fire.Color = rayPart.BrickColor.Color
  243. fire.SecondaryColor = rayPart.BrickColor.Color
  244. fire.Heat = 0
  245. fire.Size = 10
  246. local pl = Instance.new("PointLight", rayPart)
  247. pl.Color = Color3.new(rayPart.BrickColor.r/1.5, rayPart.BrickColor.g/1.5, rayPart.BrickColor.b/1.5)
  248. pl.Range = 18
  249. local hitobj = false
  250. local bulletposition = startpos.Position
  251. rayPart.CFrame = startpos.CFrame
  252. trailconnect(rayPart, hitobj)
  253. local bulletvelocity = (Vector3.new(math.random(-2,2), math.random(-2,2), math.random(-2,2)))+( mouse.Hit.p - bulletposition).unit*Speed
  254. local bulletlastposition = bulletposition
  255.  
  256. coroutine.resume(coroutine.create(function()
  257. while true do
  258. local dt = wait()
  259. bulletlastposition = bulletposition
  260. bulletvelocity = bulletvelocity + (Vector3.new(0, -3.81*Gravity, 0)*dt)
  261. bulletposition = bulletposition + (bulletvelocity*dt)
  262. local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
  263. local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, {char, modelforparts} )
  264.  
  265. if (torso.Position - rayPart.Position).magnitude > 840 then
  266. rayPart:Destroy()
  267. hitobj = true
  268. break
  269. end
  270.  
  271. if hit then
  272. hitobj = true
  273. local damage = math.random(Dmg, Dmg+6)
  274. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  275. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
  276. elseif hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") then
  277. hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
  278. end
  279. local boom = Instance.new("Part", modelforparts)
  280. boom.BrickColor = rayPart.BrickColor
  281. boom.Anchored = true
  282. boom.FormFactor = "Custom"
  283. boom.Size = Vector3.new(1,1,1)
  284. boom.CanCollide = false
  285. boom.Transparency = 0.25
  286. boom.CFrame = CFrame.new(hitposition.x, hitposition.y, hitposition.z)
  287. boom.TopSurface = 0
  288. boom.BottomSurface = 0
  289. local sphere = Instance.new("SpecialMesh", boom)
  290. sphere.MeshType = "Sphere"
  291. local pl = Instance.new("PointLight", boom)
  292. pl.Color = Color3.new(boom.BrickColor.r/1.5, boom.BrickColor.g/1.5, boom.BrickColor.b/1.5)
  293. pl.Range = 20
  294. for ye = 0, 8 do
  295. local lite = Instance.new("Part", boom)
  296. lite.FormFactor = "Custom"
  297. lite.Size = Vector3.new(.2, 1.5, .2)
  298. lite.BrickColor = boom.BrickColor
  299. lite.CanCollide = false
  300. lite.TopSurface = 0
  301. lite.Anchored = false
  302. lite.BottomSurface = 0
  303. lite.Position = boom.Position + Vector3.new(math.random(-10, 10), math.random(6,15), math.random(-10, 10))
  304. end
  305.  
  306. for i = 0, 20, 2.5 do
  307. sphere.Scale = sphere.Scale + Vector3.new(i,i,i)
  308. boom.Transparency = boom.Transparency + i/60
  309. pl.Range = pl.Range + i/15
  310. wait()
  311. end
  312. boom:Destroy()
  313. for i,v in pairs(workspace:children()) do
  314. if v:IsA("Model") and v:findFirstChild("Humanoid") then
  315. if v:findFirstChild("Head") and v:findFirstChild("Torso") then
  316. if (v:findFirstChild("Torso").Position - boom.Position).magnitude < 16 and v.Name ~= char.Name then
  317. v:findFirstChild("Humanoid"):TakeDamage(math.random(Dmg+2,Dmg+6))
  318. end
  319. end
  320. end
  321. if v and v:IsA("Part") and v.Name ~= "Base" then
  322. if (v.Position - boom.Position).magnitude < 16 then
  323. v:BreakJoints()
  324. v.TopSurface = 0
  325. v.BottomSurface = 0
  326. v.LeftSurface = 0
  327. v.RightSurface = 0
  328. v.FrontSurface = 0
  329. v.BackSurface = 0
  330. v.Anchored = false
  331. end
  332. end
  333. end
  334. pcall(function()
  335. bulletposition = hitposition
  336. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
  337. rayPart:Destroy()
  338. end)
  339. break
  340. end
  341. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
  342. rayPart.Parent = modelforparts
  343. end
  344. end))
  345. for i = 70, 65, -1.5 do
  346. camera.FieldOfView = i
  347. wait()
  348. end
  349. for i = 65, 70, 2.5 do
  350. camera.FieldOfView = i
  351. wait()
  352. end
  353. end)
  354. if err then
  355. print(err)
  356. end
  357. end
  358. end
  359. charge = 100
  360. plrgui = game:service'Players'.LocalPlayer:findFirstChild("PlayerGui")
  361. local statusgui = Instance.new("ScreenGui", plrgui)
  362. local mainframe = Instance.new("Frame", statusgui)
  363. mainframe.Size = UDim2.new(0, 200, 0, 200)
  364. mainframe.Position = UDim2.new(.75, 0, .75, 0)
  365. mainframe.Style = 3
  366. local image = Instance.new("ImageLabel", mainframe)
  367. image.Size = UDim2.new(1, 0, .47, 0)
  368. image.Position = UDim2.new(0, 0, .235, 0)
  369. image.BackgroundTransparency = 1
  370. image.Image = "rbxassetid://109550704"
  371. local chargetext = Instance.new("TextLabel", mainframe)
  372. chargetext.FontSize = "Size18"
  373. chargetext.Size = UDim2.new(1, 0, .95, 0)
  374. chargetext.TextYAlignment = "Bottom"
  375. chargetext.BackgroundTransparency = 1
  376. chargetext.TextColor3 = Color3.new(1,1,1)
  377. game:service'RunService'.Stepped:connect(function()
  378. chargetext.Text = math.floor(charge).."%"
  379. end)
  380.  
  381.  
  382. local rm = Instance.new("Weld", torso)
  383. rm.C0 = CFrame.new(1.5, 0.5, 0)
  384. rm.C1 = CFrame.new(0, 0.5, 0)
  385. rm.Part0 = torso
  386. rm.Part1 = ra
  387. local lm = Instance.new("Weld", torso)
  388. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  389. lm.C1 = CFrame.new(0, 0.5, 0)
  390. lm.Part0 = torso
  391. lm.Part1 = la
  392. sound = Instance.new("Sound", head)
  393. sound.Volume = 1
  394. sound.SoundId = "rbxassetid://145197148"
  395. sound.Looped = true
  396. dancemode = true
  397. debounceofsprint = false
  398. --create func
  399. function part(parent, size, color, formfactor, collide, transparency)
  400. if transparency == nil then transparency=0 end
  401. if collide == nil then collide=false end
  402. if formfactor == nil then formfactor="Custom" end
  403. local p = Instance.new("Part", parent)
  404. p.FormFactor = formfactor
  405. p.CanCollide = collide
  406. p.Size = size
  407. p.Locked = true
  408. p.Transparency = transparency
  409. p.Position = torso.Position + Vector3.new(0, 1, 0)
  410. p.BrickColor = color
  411. p.FrontSurface = "SmoothNoOutlines"
  412. p.BackSurface = "SmoothNoOutlines"
  413. p.LeftSurface = "SmoothNoOutlines"
  414. p.BottomSurface = "SmoothNoOutlines"
  415. p.TopSurface = "SmoothNoOutlines"
  416. p.RightSurface = "SmoothNoOutlines"
  417. return p
  418. end
  419. function wedge(parent, size, color, formfactor, collide, transparency)
  420. if transparency==nil then transparency=0 end
  421. if collide==nil then collide=false end
  422. if formfactor==nil then formfactor="Custom" end
  423. local p = Instance.new("WedgePart", parent)
  424. p.FormFactor = formfactor
  425. p.CanCollide = collide
  426. p.Size = size
  427. p.Locked = true
  428. p.Position = torso.Position
  429. p.BrickColor = color
  430. p.FrontSurface = "SmoothNoOutlines"
  431. p.BackSurface = "SmoothNoOutlines"
  432. p.LeftSurface = "SmoothNoOutlines"
  433. p.BottomSurface = "SmoothNoOutlines"
  434. p.TopSurface = "SmoothNoOutlines"
  435. p.RightSurface = "SmoothNoOutlines"
  436. return p
  437. end
  438. function weld(part0, part1, c0, parent, c1)
  439. if parent == nil then parent=char end
  440. if c1 == nil then c1=CFrame.new() end
  441. local wel = Instance.new("Weld", parent)
  442. wel.Part0 = part0
  443. wel.Part1 = part1
  444. wel.C0 = c0
  445. wel.C1 = c1
  446. return wel
  447. end
  448. function specialmesh(parent, meshType, scale, meshId)
  449. if meshId==nil then meshId="" end
  450. local mesh = Instance.new("SpecialMesh", parent)
  451. mesh.Scale = scale
  452. mesh.MeshType = meshType
  453. mesh.MeshId = meshId
  454. return mesh
  455. end
  456. ----------------------------------------------------------------------------------------------------------
  457. --function part(parent, size, color, formfactor, collide, transparency)
  458. --function weld(part0, part1, c0, parent, c1)
  459. ----------------------------------------------------------------------------------------------------------
  460. function animatehuman(animationid, object)
  461. local animation = object:findFirstChild("Humanoid"):LoadAnimation(animationid)
  462. animation:Play()
  463. end
  464. local danceAnim = Instance.new("Animation", char)
  465. danceAnim.AnimationId = "http://www.roblox.com/asset/?id=93648331"
  466. danceAnim.Name = "Dance"
  467. ----------------------------------------------------------------------------------------------------------
  468. local main = Instance.new("Part", char)
  469. main.FormFactor = "Custom"
  470. main.CanCollide = false
  471. main.Size = Vector3.new(.75, 1, 1.2)
  472. main.Locked = true
  473. main.BrickColor = BrickColor.new("White")
  474. main.TopSurface = 0
  475. main.BottomSurface = 0
  476. main.Position = torso.Position
  477. main:BreakJoints()
  478. local weld1 = weld(main, ra, CFrame.new(), char, CFrame.new(0, -.8, -.6))
  479. local speaker = Instance.new("Part", char)
  480. speaker.FormFactor = "Custom"
  481. speaker.CanCollide = false
  482. speaker.Size = Vector3.new(1.5, .25, 1.4)
  483. speaker.Locked = true
  484. speaker.BrickColor = BrickColor.new("White")
  485. speaker.TopSurface = 0
  486. speaker.BottomSurface = 0
  487. speaker.Position = torso.Position
  488. speaker:BreakJoints()
  489. local weld2 = weld(speaker, main, CFrame.new(), char, CFrame.new(-.25, -1.7, .6))
  490. local speaker2 = Instance.new("Part", char)
  491. speaker2.FormFactor = "Custom"
  492. speaker2.CanCollide = false
  493. speaker2.Size = Vector3.new(1, .25, 2)
  494. speaker2.Locked = true
  495. speaker2.BrickColor = BrickColor.new("White")
  496. speaker2.TopSurface = 0
  497. speaker2.BottomSurface = 0
  498. speaker2.Position = torso.Position
  499. speaker2:BreakJoints()
  500. local weld3 = weld(speaker2, main, CFrame.new(), char, CFrame.new(0, -1.7, -.2))
  501. local main2 = Instance.new("Part", char)
  502. main2.FormFactor = "Custom"
  503. main2.CanCollide = false
  504. main2.Size = Vector3.new(.751, 1, .6)
  505. main2.Locked = true
  506. main2.BrickColor = BrickColor.new("White")
  507. main2.TopSurface = 0
  508. main2.BottomSurface = 0
  509. main2.Position = torso.Position
  510. main2:BreakJoints()
  511. local weld4 = weld(main2, ra, CFrame.new(), char, CFrame.new(0, 0, -.9))
  512. local main3 = Instance.new("Part", char)
  513. main3.FormFactor = "Custom"
  514. main3.CanCollide = false
  515. main3.Size = Vector3.new(.751, 1.45, 1)
  516. main3.Locked = true
  517. main3.BrickColor = BrickColor.new("White")
  518. main3.TopSurface = 0
  519. main3.BottomSurface = 0
  520. main3.Position = torso.Position
  521. main3:BreakJoints()
  522. local weld5 = weld(main3, ra, CFrame.new(), char, CFrame.new(0, -1.6, -.9))
  523. local main4 = Instance.new("Part", char)
  524. main4.FormFactor = "Custom"
  525. main4.CanCollide = false
  526. main4.Size = Vector3.new(1, .76, 1)
  527. Instance.new("CylinderMesh", main4)
  528. main4.Locked = true
  529. main4.BrickColor = BrickColor.new("Black")
  530. main4.TopSurface = 0
  531. main4.BottomSurface = 0
  532. main4.Position = torso.Position
  533. main4:BreakJoints()
  534. local weld6 = weld(main4, main, CFrame.new(), char, CFrame.new(0, -.15, -.5)*CFrame.Angles(math.pi/2, 0, math.pi/2))
  535. local speaker3 = Instance.new("Part", char)
  536. speaker3.FormFactor = "Custom"
  537. speaker3.CanCollide = false
  538. speaker3.Size = Vector3.new(1.5, .5, 1.4)
  539. speaker3.Locked = true
  540. speaker3.BrickColor = BrickColor.new("Yellow")
  541. speaker3.TopSurface = 0
  542. speaker3.BottomSurface = 0
  543. speaker3.Position = torso.Position
  544. speaker3:BreakJoints()
  545. local welds1 = weld(speaker3, main, CFrame.new(), char, CFrame.new(-.25, -2.2, .6))
  546. local speaker4 = Instance.new("Part", char)
  547. speaker4.FormFactor = "Custom"
  548. speaker4.CanCollide = false
  549. speaker4.Size = Vector3.new(1, .5, 2)
  550. speaker4.Locked = true
  551. speaker4.BrickColor = BrickColor.new("White")
  552. speaker4.TopSurface = 0
  553. speaker4.BottomSurface = 0
  554. speaker4.Position = torso.Position
  555. speaker4:BreakJoints()
  556. local welds2 = weld(speaker4, main, CFrame.new(), char, CFrame.new(0, -2.205, -.2))
  557. local speaker5 = Instance.new("Part", char)
  558. speaker5.FormFactor = "Custom"
  559. speaker5.CanCollide = false
  560. speaker5.Size = Vector3.new(1.4, .4, 1.3)
  561. speaker5.Locked = true
  562. speaker5.BrickColor = BrickColor.new("Black")
  563. speaker5.TopSurface = 0
  564. speaker5.BottomSurface = 0
  565. speaker5.Position = torso.Position
  566. speaker5:BreakJoints()
  567. local welds3 = weld(speaker5, main, CFrame.new(), char, CFrame.new(-.25, -2, .6))
  568. local speaker6 = Instance.new("Part", char)
  569. speaker6.FormFactor = "Custom"
  570. speaker6.CanCollide = false
  571. speaker6.Size = Vector3.new(.9, .4, 1.9)
  572. speaker6.Locked = true
  573. speaker6.BrickColor = BrickColor.new("Black")
  574. speaker6.TopSurface = 0
  575. speaker6.BottomSurface = 0
  576. speaker6.Position = torso.Position
  577. speaker6:BreakJoints()
  578. local welds4 = weld(speaker6, main, CFrame.new(), char, CFrame.new(0, -2, -.2))
  579.  
  580. local support = Instance.new("Part", char)
  581. support.FormFactor = "Custom"
  582. support.CanCollide = false
  583. support.Size = Vector3.new(.3, .4, .6)
  584. support.Locked = true
  585. support.BrickColor = BrickColor.new("Black")
  586. support.TopSurface = 0
  587. support.BottomSurface = 0
  588. support.Position = torso.Position
  589. support:BreakJoints()
  590. local welds5 = weld(support, main, CFrame.new(), char, CFrame.new(0, -1.5, -.4))
  591. debounce = false
  592. function stopsound()
  593. if debounce then return end
  594. if not sound.IsPlaying then return end
  595. sound:stop()
  596. debounce = true
  597. local dancebro = Instance.new("StringValue", game:service'Lighting')
  598. dancebro.Name = ('STOPDANCING'..plr.Name)
  599. game:service'Debris':AddItem(dancebro, 1)
  600. coroutine.wrap(function()
  601. while not sound.IsPlaying do
  602. if charge <= 100 then
  603. charge = charge + .1
  604. wait()
  605. elseif charge > 100 then
  606. charge = 100
  607. break
  608. end
  609. end
  610. end)()
  611. wait(.1)
  612. debounce = false
  613. end
  614. mouse.Button1Down:connect(function(mous)
  615. if debounceofsprint then return end
  616. if sound.IsPlaying then return end
  617. if debounce then return end
  618. sound:play()
  619. for i = 70, 55, -.35 do
  620. if not sound.IsPlaying then debounce = true camera.FieldOfView = 70 return end
  621. camera.FieldOfView = i
  622. wait()
  623. end
  624. for i = 65, 70, 2.5 do
  625. if not sound.IsPlaying then debounce = true camera.FieldOfView = 70 return end
  626. camera.FieldOfView = i
  627. wait()
  628. end
  629. if debounce then debounce = false return end
  630. if dancemode then
  631. for i,v in pairs(workspace:children()) do
  632. if not sound.IsPlaying then break end
  633. coroutine.wrap(function()
  634. 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
  635. danceAnimClone = danceAnim:clone()
  636. danceAnimClone.Parent = v
  637. danceAnimClone.AnimationId = "http://www.roblox.com/asset/?id=93648331"
  638. wait()
  639. NLS([[
  640. function animatehuman(animationid, object)
  641. local animation = object:findFirstChild("Humanoid"):LoadAnimation(animationid)
  642. animation:Play()
  643. end
  644. while wait(.5) do
  645. 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
  646. animatehuman(script.Parent:findFirstChild("DancingAnimation"), script.Parent)
  647. end
  648. ]], v)
  649. end
  650. end)()
  651. end
  652. end
  653. coroutine.wrap(function()
  654. while sound.IsPlaying do
  655. if charge <= 1 then
  656. if debounce then break end
  657. if not sound.IsPlaying then break end
  658. sound:stop()
  659. debounce = true
  660. chargetext.TextColor3 = Color3.new(1,0,0)
  661. dancebro = Instance.new("StringValue", game:service'Lighting')
  662. dancebro.Name = ('STOPDANCING'..plr.Name)
  663. game:service'Debris':AddItem(dancebro, 1)
  664. coroutine.wrap(function()
  665. repeat wait() until charge >= 10
  666. debounce = false
  667. chargetext.TextColor3 = Color3.new(1,1,1)
  668. end)()
  669. coroutine.wrap(function()
  670. while not sound.IsPlaying do
  671. if charge <= 100 then
  672. charge = charge + .1
  673. wait()
  674. elseif charge > 100 then
  675. charge = 100
  676. break
  677. end
  678. end
  679. end)()
  680. else
  681. charge = charge - .08
  682. wait()
  683. end
  684. end
  685. end)()
  686. coroutine.wrap(function()
  687. local ran,err = ypcall(function()
  688. while sound.IsPlaying and Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 do
  689. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  690. if not sound.IsPlaying then break end
  691. rayCast(speaker, 1250, 0, 5, "Bright yellow")
  692. wait(.35)
  693. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  694. if not sound.IsPlaying then break end
  695. rayCast(speaker, 1250, 0, 5, "Deep Orange")
  696. wait(.95)
  697. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  698. if not sound.IsPlaying then break end
  699. rayCast(speaker, 1250, 0, 5, "Bright bluish green")
  700. wait(.55)
  701. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  702. if not sound.IsPlaying then break end
  703. rayCast(speaker, 1250, 0, 5, "Deep orange")
  704. wait(.4)
  705. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  706. if not sound.IsPlaying then break end
  707. rayCast(speaker, 1250, 0, 5, "Bright bluish green")
  708. local pl = Instance.new("PointLight", torso)
  709. pl.Color = Color3.new(153/255/1.25, 102/255/1.25, 204/255/1.25)
  710. pl.Range = 30
  711. pl.Brightness = 0.7
  712. game:service'Debris':AddItem(pl, .3)
  713. wait(.45)
  714. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
  715. if not sound.IsPlaying then break end
  716. rayCast(speaker, 1250, 0, 5, "Bright yellow")
  717. wait(.75)
  718. end
  719. end) if err then print(err) end
  720. end)()
  721. end)
  722. mouse.Button1Up:connect(function(mous)
  723. stopsound()
  724. end)
  725. ctrl = false
  726. mouse.KeyDown:connect(function(k)
  727. if string.byte(k) == 50 then
  728. ctrl = true
  729. humanoid.WalkSpeed = 8
  730. end
  731. if string.byte(k) == 48 then
  732. humanoid.WalkSpeed = 28
  733. end
  734. end)
  735. mouse.KeyUp:connect(function(k)
  736. if string.byte(k) == 50 then
  737. ctrl = false
  738. humanoid.WalkSpeed = 16
  739. end
  740. if string.byte(k) == 48 then
  741. humanoid.WalkSpeed = 16
  742. if ctrl then
  743. humanoid.WalkSpeed = 8
  744. end
  745. end
  746. end)
  747. humanoid.Died:connect(function()
  748. deathpos = torso.Position
  749. WorkModel = Instance.new("Model", workspace)
  750. WorkModel.Name = " "
  751. wait(1/60)
  752. humanoid.Parent = nil
  753. if torso then
  754. local Head = char:FindFirstChild("Head")
  755. if Head then
  756. local Neck = Instance.new("Weld")
  757. Neck.Name = "Neck"
  758. Neck.Part0 = torso
  759. Neck.Part1 = Head
  760. Neck.C0 = CFrame.new(0, 1.5, 0)
  761. Neck.C1 = CFrame.new()
  762. Neck.Parent = torso
  763. end
  764. local Limb = char:FindFirstChild("Right Arm")
  765. if Limb then
  766. Limb.CFrame = torso.CFrame * CFrame.new(1.5, 0, 0)
  767. local Joint = Instance.new("Glue")
  768. Joint.Name = "RightShoulder"
  769. Joint.Part0 = torso
  770. Joint.Part1 = Limb
  771. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  772. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  773. Joint.Parent = torso
  774. local B = Instance.new("Part")
  775. B.TopSurface = 0
  776. B.BottomSurface = 0
  777. B.formFactor = "Symmetric"
  778. B.Size = Vector3.new(1, 1, 1)
  779. B.Transparency = 1
  780. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  781. B.Parent = char
  782. B.CanCollide = false
  783. local W = Instance.new("Weld")
  784. W.Part0 = Limb
  785. W.Part1 = B
  786. W.C0 = CFrame.new(0, -0.5, 0)
  787. W.Parent = Limb
  788. end
  789. local Limb = char:FindFirstChild("Left Arm")
  790. if Limb then
  791. Limb.CFrame = torso.CFrame * CFrame.new(-1.5, 0, 0)
  792. local Joint = Instance.new("Glue")
  793. Joint.Name = "LeftShoulder"
  794. Joint.Part0 = torso
  795. Joint.Part1 = Limb
  796. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  797. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  798. Joint.Parent = torso
  799. local B = Instance.new("Part")
  800. B.TopSurface = 0
  801. B.BottomSurface = 0
  802. B.formFactor = "Symmetric"
  803. B.Size = Vector3.new(1, 1, 1)
  804. B.Transparency = 1
  805. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  806. B.Parent = char
  807. B.CanCollide = false
  808. local W = Instance.new("Weld")
  809. W.Part0 = Limb
  810. W.Part1 = B
  811. W.C0 = CFrame.new(0, -0.5, 0)
  812. W.Parent = Limb
  813. end
  814. local Limb = char:FindFirstChild("Right Leg")
  815. if Limb then
  816. Limb.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
  817. local Joint = Instance.new("Glue")
  818. Joint.Name = "RightHip"
  819. Joint.Part0 = torso
  820. Joint.Part1 = Limb
  821. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  822. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  823. Joint.Parent = torso
  824. local B = Instance.new("Part")
  825. B.TopSurface = 0
  826. B.BottomSurface = 0
  827. B.formFactor = "Symmetric"
  828. B.Size = Vector3.new(1, 1, 1)
  829. B.Transparency = 1
  830. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  831. B.Parent = char
  832. B.CanCollide = false
  833. local W = Instance.new("Weld")
  834. W.Part0 = Limb
  835. W.Part1 = B
  836. W.C0 = CFrame.new(0, -0.5, 0)
  837. W.Parent = Limb
  838. end
  839. local Limb = char:FindFirstChild("Left Leg")
  840. if Limb then
  841. Limb.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
  842. local Joint = Instance.new("Glue")
  843. Joint.Name = "LeftHip"
  844. Joint.Part0 = torso
  845. Joint.Part1 = Limb
  846. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  847. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  848. Joint.Parent = torso
  849. local B = Instance.new("Part")
  850. B.TopSurface = 0
  851. B.BottomSurface = 0
  852. B.formFactor = "Symmetric"
  853. B.Size = Vector3.new(1, 1, 1)
  854. B.Transparency = 1
  855. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  856. B.Parent = char
  857. B.CanCollide = false
  858. local W = Instance.new("Weld")
  859. W.Part0 = Limb
  860. W.Part1 = B
  861. W.C0 = CFrame.new(0, -0.5, 0)
  862. W.Parent = Limb
  863. end
  864. for blood = 0, 3 do
  865. local blood = Instance.new("Part", workspace)
  866. blood.BrickColor = BrickColor.Red()
  867. blood.FormFactor = "Custom"
  868. blood.Size = Vector3.new(.2,.2,.2)
  869. blood.Anchored = true
  870. blood.TopSurface = "Smooth"
  871. blood.BackSurface = "Smooth"
  872. local bloodmesh = Instance.new("CylinderMesh", blood)
  873. bloodmesh.Scale = Vector3.new(3, 0, 3)
  874. local rayzb = Ray.new(torso.Position, Vector3.new(0, -20, 0) + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)))
  875. local hitzb, hitposb = workspace:findPartOnRay(rayzb, char)
  876. if hitzb then
  877. blood.CFrame = CFrame.new(hitposb.x,hitposb.y,hitposb.z)
  878. blood.CFrame = blood.CFrame * CFrame.new(0, .05, 0)
  879. coroutine.wrap(function()
  880. for cframe = 0, math.random(16, 24) do
  881. bloodmesh.Scale = bloodmesh.Scale + Vector3.new(.45, 0, .45)
  882. wait()
  883. end
  884. end)()
  885. elseif not hitzb then
  886. blood:Destroy()
  887. end
  888. end
  889. local BP = Instance.new("BodyPosition", torso)
  890. BP.maxForce = Vector3.new(1,1,1)/0
  891. BP.position = deathpos
  892. for i,v in pairs(char:children()) do
  893. if v:IsA("Part") then v.Parent = WorkModel end
  894. end
  895. wait(.3)
  896. BP:Destroy()
  897. end
  898. end)
  899. local rlegm = Instance.new("Motor", torso)
  900. rlegm.C0 = CFrame.new(0.5, -1, 0)
  901. rlegm.C1 = CFrame.new(0, 1, 0)
  902. rlegm.Part0 = torso
  903. rlegm.Part1 = rl
  904. rlegm.Name = "Right Hip"
  905. local llegm = Instance.new("Motor", torso)
  906. llegm.C0 = CFrame.new(-0.5, -1, 0)
  907. llegm.C1 = CFrame.new(0, 1, 0)
  908. llegm.Part0 = torso
  909. llegm.Part1 = ll
  910. llegm.Name = "Left Hip"
  911. neck.C0 = CFrame.new(0, 1, 0)
  912. neck.C1 = CFrame.new(0, -0.5, 0)
  913. rj.C0 = CFrame.new(0, -1, 0)
  914. rj.C1 = CFrame.new(0, -1, 0)
  915. rsc0 = rm.C0
  916. lsc0 = lm.C0
  917. neckc0 = neck.C0
  918. rootc0 = rj.C0
  919. llc0 = llegm.C0
  920. rlc0 = rlegm.C0
  921. speed = 0.4
  922. angle = 0
  923. anglespeed = 0
  924. mvmnt = 0
  925. game:service'RunService'.Stepped:connect(function()
  926. angle = (angle % 100) + anglespeed/10
  927. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  928. local rscf = rsc0
  929. local lscf = lsc0
  930. local rlcf = rlc0
  931. local llcf = llc0
  932. local rjcf = rootc0
  933. local ncf = neckc0
  934. local rayz = Ray.new(rootpart.Position, Vector3.new(0, -4.1, 0))
  935. local hitz, enz = workspace:findPartOnRay(rayz, char)
  936. --math.asin(mouse.UnitRay.Direction.y)
  937. ncf = neckc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y, 0, 0)
  938. rscf = rsc0 * CFrame.new(-.55, 0, .35) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, 0)
  939. lscf = lsc0 * CFrame.new(.85, 0, -.65) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, math.rad(45))
  940. if not hitz then
  941. ncf = neckc0 * CFrame.Angles(math.pi/18, 0, 0)
  942. rscf = rsc0 * CFrame.new(-.45, 0, -.75) * CFrame.Angles(math.pi/5+math.pi/18, 0, math.rad(-70))
  943. lscf = lsc0 * CFrame.new(.35, 0, 0) * CFrame.Angles(math.pi/3.5+math.pi/18, 0, 0)
  944. rjcf = rootc0 * CFrame.Angles(-math.pi/32, 0, 0)
  945. rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) * CFrame.Angles(-math.pi/14, 0, 0)
  946. llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0)
  947. elseif humanoid.Sit then
  948. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  949. rjcf = rootc0 * CFrame.new(0, -.2, 0)
  950. rlcf = rlc0 * CFrame.Angles(math.pi/2, 0, math.rad(7.5))
  951. llcf = llc0 * CFrame.Angles(math.pi/2, 0, -math.rad(7.5))
  952. if sprinting then
  953. debounceofsprint = false
  954. sprinting = false
  955. end
  956. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  957. speed = 0.3
  958. if ctrl then
  959. rjcf = rootc0 * CFrame.new(0, -1.25, 0)
  960. llcf = llc0 * CFrame.new(0, 0, -.45) * CFrame.Angles(-math.pi/2.2, 0, 0)
  961. rlcf = rlcf * CFrame.new(0, 1.25, -.85)
  962. else
  963. rjcf = rootc0
  964. rlcf = rlc0 * CFrame.Angles(-math.rad(.5), 0, math.rad(1.5))
  965. llcf = llc0 * CFrame.Angles(math.rad(1.5), 0, -math.rad(1.5))
  966. end
  967. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
  968. if not humanoid.Sit then
  969. anglespeed = 3
  970. if ctrl then
  971. anglespeed = 3
  972. ncf = neckc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/18, 0, 0)
  973. rjcf = rootc0 * CFrame.new(0, -.35, 0) * CFrame.Angles(-math.pi/18, 0, 0)
  974. rscf = rsc0 * CFrame.new(-.55, 0, .35) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2+math.pi/18, 0, 0)
  975. lscf = lsc0 * CFrame.new(.85, 0, -.65) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2+math.pi/18, 0, math.rad(45))
  976. llcf = llc0 * CFrame.new(0, .45, -.35) * CFrame.Angles(math.pi/18 - math.sin(angle)*.45, 0, 0)
  977. rlcf = rlcf * CFrame.new(0, .45, -.35) * CFrame.Angles(math.pi/18 + math.sin(angle)*.45, 0, 0)
  978. else
  979. rjcf = rootc0
  980. rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*.65, 0, math.rad(.5))
  981. llcf = llc0 * CFrame.Angles(math.sin(angle)*.65, 0, -math.rad(.5))
  982. end
  983. if sprinting then
  984. debounceofsprint = false
  985. sprinting = false
  986. end
  987. end
  988. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
  989. if not humanoid.Sit then
  990. anglespeed = 3
  991. ncf = neckc0 * CFrame.Angles(math.pi/18, 0, 0)
  992. rscf = rsc0 * CFrame.new(-.45, 0, -.75) * CFrame.Angles(math.pi/5+math.pi/18, 0, math.rad(-70))
  993. lscf = lsc0 * CFrame.new(.35, 0, 0) * CFrame.Angles(math.pi/3.5+math.pi/18, 0, 0)
  994. rjcf = rootc0 * CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/18, math.sin(angle)*.1, math.sin(angle)*.045)
  995. rlcf = rlc0 * CFrame.new(0, 0, -.6+math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
  996. llcf = llc0 * CFrame.new(0, 0, -math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
  997. sprinting = true
  998. debounceofsprint = true
  999. end
  1000. end
  1001. rm.C0 = clerp(rm.C0,rscf,speed)
  1002. lm.C0 = clerp(lm.C0,lscf,speed)
  1003. rj.C0 = clerp(rj.C0,rjcf,speed)
  1004. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  1005. llegm.C0 = clerp(llegm.C0,llcf,speed)
  1006. neck.C0 = clerp(neck.C0,ncf,speed)
  1007. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement