Advertisement
iiJosephCats205

b

May 20th, 2018
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.64 KB | None | 0 0
  1. --Nothing interesting here
  2.  
  3.  
  4. local plr = game:service'Players'.LocalPlayer
  5. local char = plr.Character
  6. local hum = char.Humanoid
  7. local rarm = char["Right Arm"]
  8. local larm= char["Left Arm"]
  9. local rleg= char["Right Leg"]
  10. local lleg = char["Left Leg"]
  11. local root = char.HumanoidRootPart
  12. local tors = char.Torso
  13. local head = char.Head
  14. local sine = 0;
  15. local change = 1;
  16. local RunS = game:GetService("RunService")
  17. local mouse = plr:GetMouse()
  18. local defAnim = true;
  19.  
  20. local Attachments = {}
  21.  
  22. function GetAttach(p)
  23. for _,v in next, p:children() do
  24. if v:IsA'Attachment' then
  25. table.insert(Attachments,v)
  26. end
  27. GetAttach(v)
  28. end
  29. end
  30.  
  31. GetAttach(char)
  32.  
  33. wait(1)
  34.  
  35. local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ}
  36. local V3 = {N=Vector3.new}
  37. local M = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge}
  38. local Effects,Sounds = {},{};
  39. --Stop animations
  40. for _,v in next, hum:GetPlayingAnimationTracks() do
  41. v:Stop();
  42. end
  43.  
  44. pcall(game.Destroy,char:FindFirstChild'Animate')
  45. pcall(game.Destroy,hum:FindFirstChild'Animator')
  46. hum:SetStateEnabled("Dead",false)
  47. hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
  48. -- Sounds
  49. Sounds['Wet'] = {Id=256738023,Loop=false,Pitch=1}
  50. Sounds['Swoosh1'] = {Id=320557353,Loop=false,Pitch=1}
  51. Sounds['Swoosh2'] = {Id=320557382,Loop=false,Pitch=1}
  52. Sounds['Swoosh3'] = {Id=320557413,Loop=false,Pitch=1}
  53. Sounds['Swoosh4'] = {Id=320557453,Loop=false,Pitch=1}
  54. Sounds['Swoosh5'] = {Id=320557487,Loop=false,Pitch=1}
  55. Sounds['Swoosh6'] = {Id=320557537,Loop=false,Pitch=1}
  56. Sounds['Swoosh7'] = {Id=320557563,Loop=false,Pitch=1}
  57. Sounds['Swoosh8'] = {Id=320557518,Loop=false,Pitch=1}
  58. Sounds['ShrekRemix'] = {Id=163306929,Loop=true,Pitch=1,Volume = 4}
  59. Sounds['CreoDimension'] = {Id=927529620,Loop=true,Pitch=1,Volume=4}
  60. Sounds['BlackBlizzard'] = {Id=657626121,Loop=true,Pitch=1,Volume=4}
  61. Sounds['ColbreakzFantasy'] = {Id=876981900,Loop=true,Pitch=1,Volume=4}
  62. Sounds['NeflCrystals'] = {Id=340106355,Loop=true,Pitch=1,Volume=4}
  63. Sounds['EvilMortyRemix'] = {Id=1057401232,Loop=true,Pitch=1,Volume=10}
  64. Sounds['SayoFuckYouDan-Nara'] = {Id=1205183071,Loop=true,Pitch=1,Volume=1}
  65.  
  66.  
  67. -- Functions
  68. local NewInstance = function(instance,parent,properties)
  69. local inst = Instance.new(instance,parent)
  70. if(properties)then
  71. for i,v in next, properties do
  72. pcall(function() inst[i] = v end)
  73. end
  74. end
  75. return inst;
  76. end
  77.  
  78. function clerp(a, b, t)
  79. local qa = {
  80. QuaternionFromCFrame(a)
  81. }
  82. local qb = {
  83. QuaternionFromCFrame(b)
  84. }
  85. local ax, ay, az = a.x, a.y, a.z
  86. local bx, by, bz = b.x, b.y, b.z
  87. local _t = 1 - t
  88. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  89. end
  90. function QuaternionFromCFrame(cf)
  91. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  92. local trace = m00 + m11 + m22
  93. if trace > 0 then
  94. local s = math.sqrt(1 + trace)
  95. local recip = 0.5 / s
  96. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  97. else
  98. local i = 0
  99. if m00 < m11 then
  100. i = 1
  101. end
  102. if m22 > (i == 0 and m00 or m11) then
  103. i = 2
  104. end
  105. if i == 0 then
  106. local s = math.sqrt(m00 - m11 - m22 + 1)
  107. local recip = 0.5 / s
  108. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  109. elseif i == 1 then
  110. local s = math.sqrt(m11 - m22 - m00 + 1)
  111. local recip = 0.5 / s
  112. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  113. elseif i == 2 then
  114. local s = math.sqrt(m22 - m00 - m11 + 1)
  115. local recip = 0.5 / s
  116. return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  117. end
  118. end
  119. end
  120. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  121. local xs, ys, zs = x + x, y + y, z + z
  122. local wx, wy, wz = w * xs, w * ys, w * zs
  123. local xx = x * xs
  124. local xy = x * ys
  125. local xz = x * zs
  126. local yy = y * ys
  127. local yz = y * zs
  128. local zz = z * zs
  129. 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))
  130. end
  131. function QuaternionSlerp(a, b, t)
  132. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  133. local startInterp, finishInterp
  134. if cosTheta >= 1.0E-4 then
  135. if 1 - cosTheta > 1.0E-4 then
  136. local theta = math.acos(cosTheta)
  137. local invSinTheta = 1 / math.sin(theta)
  138. startInterp = math.sin((1 - t) * theta) * invSinTheta
  139. finishInterp = math.sin(t * theta) * invSinTheta
  140. else
  141. startInterp = 1 - t
  142. finishInterp = t
  143. end
  144. elseif 1 + cosTheta > 1.0E-4 then
  145. local theta = math.acos(-cosTheta)
  146. local invSinTheta = 1 / math.sin(theta)
  147. startInterp = math.sin((t - 1) * theta) * invSinTheta
  148. finishInterp = math.sin(t * theta) * invSinTheta
  149. else
  150. startInterp = t - 1
  151. finishInterp = t
  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.  
  156. local sndFromData = function(data,parent)
  157. if(typeof(data) == 'table')then
  158. local snd = NewInstance("Sound",parent or char,{SoundId = "rbxassetid://"..data.Id,Looped=data.Loop or false,Pitch = data.Pitch or 1,Volume = data.Volume or 1})
  159. return snd;
  160. else
  161. return error('Argument passed into sndFromData must be a table!',1)
  162. end
  163. end
  164.  
  165. function UnbindLoops()
  166. pcall(RunS.UnbindFromRenderStep,RunS,"N_Effects")
  167. pcall(RunS.UnbindFromRenderStep,RunS,"N_Animations")
  168. end;
  169.  
  170. UnbindLoops() -- Just so if the loops already exist from previously running a script using this template, there's no errors
  171.  
  172. function ragdoll()
  173. char.Archivable = true
  174. local clone = game.Players.LocalPlayer.Character:Clone()
  175. clone.Parent = workspace
  176. for i,v in pairs(clone:GetChildren()) do
  177. if v.ClassName == "Script" or v.ClassName == "LocalScript" then
  178. v:destroy()
  179. end
  180. for i,p in pairs(v:GetChildren()) do
  181. if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then
  182. p:destroy()
  183. end
  184. end
  185. end
  186. local leftarm = clone:findFirstChild("Left Arm")
  187. local rightrm = clone:findFirstChild("Right Arm")
  188. local leftleg = clone:findFirstChild("Left Leg")
  189. local rightleg = clone:findFirstChild("Right Leg")
  190. local head = clone:findFirstChild("Head")
  191. char:Destroy()
  192. workspace.CurrentCamera.CameraSubject = head
  193. if head then
  194. local attachment = Instance.new("Attachment", clone.Head)
  195. attachment.Position = Vector3.new(0, -0.5, 0)
  196. attachment.Name = "lol"
  197. attachment.Visible = false
  198. clone.Torso.NeckAttachment.Visible = false
  199. clone.Torso.NeckAttachment.Position = clone.Torso.NeckAttachment.Position + Vector3.new(0,0,0)
  200. local ball = Instance.new("BallSocketConstraint", clone)
  201. ball.Attachment0 = clone.Torso.NeckAttachment
  202. ball.Attachment1 = attachment
  203. ball.LimitsEnabled = true
  204. ball.TwistLimitsEnabled = true
  205. ball.UpperAngle = 90
  206. ball.Restitution = 0.5
  207. ball.TwistUpperAngle = 90
  208. ball.TwistLowerAngle = -90
  209. local collidepartofleftleg = Instance.new("Part", clone.Torso)
  210. collidepartofleftleg.Name = "Bone"
  211. collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7)
  212. collidepartofleftleg.Transparency = 1
  213. collidepartofleftleg:BreakJoints()
  214. local weeld = Instance.new("Weld", collidepartofleftleg)
  215. weeld.Part0 = collidepartofleftleg
  216. weeld.Part1 = clone["Head"]
  217. end
  218. if leftleg ~= nil then
  219. local glue = Instance.new("Glue", clone.Torso)
  220. glue.Part0 = clone.Torso
  221. glue.Part1 = leftleg
  222. glue.Name = "Left leg"
  223. local collider = Instance.new("Part", leftleg)
  224. collider.Position = Vector3.new(0,999,0)
  225. collider.Size = Vector3.new(1.5, 1, 1)
  226. collider.Shape = "Cylinder"
  227. local weld = Instance.new("Weld", collider)
  228. weld.Part0 = leftleg
  229. weld.Part1 = collider
  230. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  231. collider.TopSurface = "Smooth"
  232. collider.BottomSurface = "Smooth"
  233. collider.formFactor = "Symmetric"
  234. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  235. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  236. collider.Transparency = 1
  237. end
  238. ------------
  239. if rightleg ~= nil then
  240. local glue1 = Instance.new("Glue", clone.Torso)
  241. glue1.Part0 = clone.Torso
  242. glue1.Part1 = rightleg
  243. glue1.Name = "Right leg"
  244. local collider1 = Instance.new("Part", rightleg)
  245. collider1.Position = Vector3.new(0,999,0)
  246. collider1.Size = Vector3.new(1.5, 1, 1)
  247. collider1.Shape = "Cylinder"
  248. local weld1 = Instance.new("Weld", collider1)
  249. weld1.Part0 = rightleg
  250. weld1.Part1 = collider1
  251. weld1.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  252. collider1.TopSurface = "Smooth"
  253. collider1.BottomSurface = "Smooth"
  254. collider1.formFactor = "Symmetric"
  255. glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  256. glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  257. collider1.Transparency = 1
  258. end
  259. ------------
  260. if rightrm ~= nil then
  261. local glue11 = Instance.new("Glue", clone.Torso)
  262. glue11.Part0 = clone.Torso
  263. glue11.Part1 = rightrm
  264. glue11.Name = "Right shoulder"
  265. local collider11 = Instance.new("Part", rightrm)
  266. collider11.Position = Vector3.new(0,9999,0)
  267. collider11.Size = Vector3.new(1.5,1,1)
  268. collider11.Shape = "Cylinder"
  269. local weld11 = Instance.new("Weld", collider11)
  270. weld11.Part0 = rightrm
  271. weld11.Part1 = collider11
  272. weld11.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  273. collider11.TopSurface = "Smooth"
  274. collider11.BottomSurface = "Smooth"
  275. collider11.formFactor = "Symmetric"
  276. glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  277. glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  278. collider11.Transparency = 1
  279. end
  280. ------------
  281. if leftarm ~= nil then
  282. local glue111 = Instance.new("Glue", clone.Torso)
  283. glue111.Part0 = clone.Torso
  284. glue111.Part1 = leftarm
  285. glue111.Name = "Left shoulder"
  286. local collider111 = Instance.new("Part", leftarm)
  287. collider111.Position = Vector3.new(0,9999,0)
  288. collider111.Size = Vector3.new(1.5,1,1)
  289. collider111.Shape = "Cylinder"
  290. local weld111 = Instance.new("Weld", collider111)
  291. weld111.Part0 = leftarm
  292. weld111.Part1 = collider111
  293. weld111.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  294. collider111.TopSurface = "Smooth"
  295. collider111.BottomSurface = "Smooth"
  296. collider111.formFactor = "Symmetric"
  297. glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  298. glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  299. collider111.Transparency = 1
  300. ----------------
  301. end
  302.  
  303. wait(0.5)
  304. coroutine.resume(coroutine.create(function()
  305. while wait() do
  306. clone.Head.CanCollide = false
  307. game:GetService("RunService").Stepped:wait()
  308. end
  309. end))
  310. return clone
  311. end
  312.  
  313.  
  314. -- Build
  315.  
  316. New = function(Object, Parent, Name, Data)
  317. local Object = Instance.new(Object)
  318. for Index, Value in pairs(Data or {}) do
  319. Object[Index] = Value
  320. end
  321. Object.Parent = Parent
  322. Object.Name = Name
  323. return Object
  324. end
  325.  
  326. Model = New("Model",workspace,"Model",{})
  327. ring = New("Part",Model,"ring",{CanCollide=false,BrickColor = BrickColor.new("Brick yellow"),Elasticity = 0,FormFactor = Enum.FormFactor.Symmetric,Size = Vector3.new(1, 1, 1),CFrame = CFrame.new(-72.0287933, 6.52005148, 33.66502, -0.0191105176, -0.965736747, 0.258819014, -0.246841118, -0.246295646, -0.937234163, 0.96886754, -0.0817982107, -0.233676717),Anchored = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.843137, 0.772549, 0.603922),})
  328. Mesh = New("SpecialMesh",ring,"Mesh",{MeshId = "http://www.roblox.com/asset/?id=3270017",MeshType = Enum.MeshType.FileMesh,})
  329. roof = New("Part",Model,"roof",{CanCollide=false,BrickColor = BrickColor.new("Reddish brown"),FormFactor = Enum.FormFactor.Plate,Size = Vector3.new(3.83999777, 0.200000256, 3.35999894),CFrame = CFrame.new(-71.9617996, 14.1185007, 33.3817253, 0.999999523, 0.000339658902, 0.000940953556, -0.000311135052, 0.999545336, -0.030149797, -0.000950766378, 0.0301494878, 0.999544978),Anchored = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.411765, 0.25098, 0.156863),})
  330.  
  331.  
  332. tors.CFrame = tors.CFrame * CFrame.new(0,4,0)
  333. local storedCF = tors.CFrame
  334. roof.CFrame = storedCF * CFrame.new(0,9,0)
  335. ring.CFrame = head.CFrame
  336. local a0 = Instance.new("Attachment",roof)
  337. local a1 = Instance.new("Attachment",ring)
  338.  
  339. local rope = Instance.new("RopeConstraint",roof)
  340. rope.Thickness = 0.1
  341. rope.Color = ring.BrickColor
  342. rope.Attachment0 = a0
  343. rope.Visible = true
  344. rope.Attachment1 = a1
  345. rope.Length = (roof.CFrame.p - ring.CFrame.p).magnitude
  346. wait(.05)
  347. local rag = ragdoll()
  348. plr.Character = rag
  349. Model.Parent = rag
  350. local hw = Instance.new("Weld",rag)
  351. hw.Part0 = rag.Head
  352. hw.Part1 = ring
  353. hw.C1 = CFrame.new(0,0,0.5)*CFrame.Angles(math.rad(90),0,0)
  354.  
  355.  
  356. local Music = sndFromData(Sounds["SayoFuckYouDan-Nara"],rag.Torso)
  357. Music:Play()
  358.  
  359. -- Check State
  360. function CheckState(rPart)
  361. if(rPart.Velocity.y > 1 and hum:GetState() == Enum.HumanoidStateType.Freefall)then
  362. return 'Jump';
  363. elseif(rPart.Velocity.y < -1 and hum:GetState() == Enum.HumanoidStateType.Freefall)then
  364. return 'Fall';
  365. elseif(math.abs(rPart.Velocity.x) > 2 or math.abs(rPart.Velocity.z) > 2 and hum:GetState() ~= Enum.HumanoidStateType.Freefall)then
  366. return 'Walk';
  367. end
  368. return 'Idle';
  369. end
  370.  
  371.  
  372. -- Died event
  373.  
  374. hum.Died:connect(function() -- When the player dies
  375. UnbindLoops() -- Unbind all of the loops used
  376. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement