Advertisement
lafur

Untitled

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