Advertisement
1x1x1x1IAMbck

flat body

May 19th, 2018
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.58 KB | None | 0 0
  1. local p = game:GetService("Players").LocalPlayer
  2. local char = p.Character
  3. local mouse = p:GetMouse()
  4. local larm = char:WaitForChild("Left Arm")
  5. local rarm = char:WaitForChild("Right Arm")
  6. local lleg = char:WaitForChild("Left Leg")
  7. local rleg = char:WaitForChild("Right Leg")
  8. local hed = char:WaitForChild("Head")
  9. local torso = char:WaitForChild("Torso")
  10. local root = char:WaitForChild("HumanoidRootPart")
  11. local hum = char:FindFirstChildOfClass("Humanoid")
  12. local debris = game:GetService("Debris")
  13. local input = game:GetService("UserInputService")
  14. local run = game:GetService("RunService")
  15. local rs = run.RenderStepped
  16. local wingpose = "Idle"
  17. local DebrisModel = Instance.new("Model",char)
  18. DebrisModel.Name = "Debris"
  19. repeat rs:wait() until p.CharacterAppearanceLoaded
  20.  
  21. noidle = false
  22. shift = false
  23. control = false
  24. no_nosound_able = false
  25. kills = 0
  26.  
  27. function rswait(value)
  28. if value ~= nil and value ~= 0 then
  29. for i=1,value do
  30. rs:wait()
  31. end
  32. else
  33. rs:wait()
  34. end
  35. end
  36.  
  37. local timeposition = 0
  38.  
  39. function music(id)
  40. if not torso:FindFirstChild("MusicRuin") then
  41. soundz = Instance.new("Sound",torso)
  42. end
  43. soundz.Volume = 10
  44. soundz.Name = "MusicRuin"
  45. soundz.Looped = true
  46. soundz.PlaybackSpeed = 1
  47. soundz.SoundId = "rbxassetid://"..id
  48. soundz:Stop()
  49. soundz:Play()
  50. if no_nosound_able == true then
  51. soundz.TimePosition = timeposition
  52. end
  53. end
  54.  
  55. function lerp(a, b, t)
  56. return a + (b - a)*t
  57. end
  58.  
  59. ----------------------------------------------------------------------------
  60.  
  61. function Lerp(c1,c2,al)
  62. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  63. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  64. for i,v in pairs(com1) do
  65. com1[i] = v+(com2[i]-v)*al
  66. end
  67. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  68. end
  69.  
  70. function slerp(a, b, t)
  71. dot = a:Dot(b)
  72. if dot > 0.99999 or dot < -0.99999 then
  73. return t <= 0.5 and a or b
  74. else
  75. r = math.acos(dot)
  76. return (a*math.sin((1 - t)*r) + b*math.sin(t*r)) / math.sin(r)
  77. end
  78. end
  79.  
  80. ----------------------------------------------------------------------------
  81.  
  82. function clerp(c1,c2,al)
  83.  
  84. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  85.  
  86. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  87.  
  88. for i,v in pairs(com1) do
  89.  
  90. com1[i] = lerp(v,com2[i],al)
  91.  
  92. end
  93.  
  94. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  95.  
  96. end
  97.  
  98. function findAllNearestTorso(pos,dist)
  99. local list = workspace:children()
  100. local torso = {}
  101. local temp = nil
  102. local human = nil
  103. local temp2 = nil
  104. for x = 1, #list do
  105. temp2 = list[x]
  106. if (temp2.className == "Model") and (temp2 ~= char) then
  107. temp = temp2:findFirstChild("Torso")
  108. human = temp2:findFirstChildOfClass("Humanoid")
  109. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  110. if (temp.Position - pos).magnitude < dist then
  111. table.insert(torso,temp)
  112. dist = (temp.Position - pos).magnitude
  113. end
  114. end
  115. end
  116. end
  117. return torso
  118. end
  119.  
  120. ----------------------------------------------------------------------------
  121.  
  122. function checkIfNotPlayer(model)
  123. if model.CanCollide == true and model ~= char and model.Parent ~= char and model.Parent.Parent ~= char and model.Parent.Parent ~= char and model.Parent ~= DebrisModel and model.Parent.Parent ~= DebrisModel and model.Parent.Parent.Parent ~= DebrisModel and model ~= wings and model.Parent ~= wings and model.Parent.Parent ~= wings then
  124. return true
  125. else
  126. return false
  127. end
  128. end
  129.  
  130. ----------------------------------------------------------------------------
  131.  
  132. function newWeld(wp0, wp1, wc0x, wc0y, wc0z)
  133.  
  134. local wld = Instance.new("Weld", wp1)
  135.  
  136. wld.Part0 = wp0
  137.  
  138. wld.Part1 = wp1
  139.  
  140. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  141.  
  142. return wld
  143.  
  144. end
  145.  
  146. function weld(model)
  147. local parts,last = {}
  148. local function scan(parent)
  149. for _,v in pairs(parent:GetChildren()) do
  150. if (v:IsA("BasePart")) then
  151. if (last) then
  152. local w = Instance.new("Weld")
  153. w.Name = ("%s_Weld"):format(v.Name)
  154. w.Part0,w.Part1 = last,v
  155. w.C0 = last.CFrame:inverse()
  156. w.C1 = v.CFrame:inverse()
  157. w.Parent = last
  158. end
  159. last = v
  160. table.insert(parts,v)
  161. end
  162. scan(v)
  163. end
  164. end
  165. scan(model)
  166. for _,v in pairs(parts) do
  167. v.Anchored = false
  168. v.Locked = true
  169. v.Anchored = false
  170. v.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  171. v.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  172. v.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  173. v.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  174. v.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  175. v.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  176. v.CustomPhysicalProperties = PhysicalProperties.new(0,0,0)
  177. end
  178. end
  179.  
  180. ----------------------------------------------------------------------------
  181.  
  182. function calculate(part,asd)
  183. local Head = hed
  184. local RightShoulder = asd
  185. local RightArm = part
  186. local MousePosition = mouse.Hit.p
  187. local ToMouse = (MousePosition - Head.Position).unit
  188. local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
  189. local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0)))
  190. local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
  191. local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  192. local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
  193. if tostring(LateralAngle) == "-1.#IND" then
  194. LateralAngle = 0
  195. end
  196. local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
  197. if LateralAngle > (math.pi / 2) then
  198. LateralAngle = (math.pi / 2)
  199. local Torso = root
  200. local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p)
  201. if Point.Z > 0 then
  202. if Point.X > -0 and RightArm == rarm then
  203. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(110),0)
  204. elseif Point.X < 0 and RightArm == rarm then
  205. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-110),0)
  206. end
  207. end
  208. end
  209. if Cross.Y < 0 then
  210. LateralAngle = -LateralAngle
  211. end
  212. return(CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
  213. end
  214.  
  215. ----------------------------------------------------------------------------
  216.  
  217. function sound(id,position,vol,pitch,start,finish)
  218. coroutine.resume(coroutine.create(function()
  219.  
  220. local part = Instance.new("Part",workspace)
  221. part.Position = position
  222. part.Size = Vector3.new(0,0,0)
  223. part.CanCollide = false
  224. part.Transparency = 1
  225.  
  226. local sound = Instance.new("Sound",part)
  227.  
  228. sound.SoundId = "rbxassetid://"..id
  229.  
  230. repeat rs:wait() until sound.IsLoaded
  231.  
  232. if vol ~= nil then
  233. sound.Volume = vol
  234. end
  235.  
  236. if pitch ~= nil then
  237. sound.PlaybackSpeed = pitch
  238. end
  239.  
  240. if start ~= nil then
  241. sound.TimePosition = start
  242. end
  243.  
  244. if finish ~= nil then
  245. debris:AddItem(part,finish-start)
  246. else
  247. debris:AddItem(part,sound.TimeLength)
  248. end
  249.  
  250. sound:Play()
  251.  
  252. return sound
  253.  
  254. end))
  255. end
  256.  
  257. ----------------------------------------------------------------------------
  258.  
  259. function computeDirection(vec)
  260. local lenSquared = vec.magnitude * vec.magnitude
  261. local invSqrt = 1 / math.sqrt(lenSquared)
  262. return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
  263. end
  264.  
  265. ----------------------------------------------------------------------------
  266.  
  267. local shaking = 0
  268. function shake(num) if num > shaking then shaking = num end end
  269. game:GetService("RunService").RenderStepped:connect(function()
  270. hum.CameraOffset = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))*(shaking/100)
  271. if shaking > 0 then shaking = shaking - 1 else shaking = 0 end
  272. end)
  273.  
  274. plr = game:GetService("Players").LocalPlayer
  275. DebrisModel = Instance.new("Model",plr.Character)
  276. DebrisModel.Name = "DebrisModel"
  277.  
  278. function Effect(mesh,size,transparency,material,color,position,rotation,sizechange,rotationchange,transparencychange,acceleration)
  279.  
  280. local part = Instance.new("Part",DebrisModel)
  281. part.Anchored = true
  282. part.CanCollide = false
  283. part.Size = Vector3.new(1,1,1)
  284. part.Transparency = transparency
  285. part.Material = material
  286. part.Color = color
  287. part.CFrame = CFrame.new(position)*CFrame.Angles(math.rad(rotation.X),math.rad(rotation.Y),math.rad(rotation.Z))
  288.  
  289. local partmesh = Instance.new("SpecialMesh",part)
  290. if tonumber(mesh) == nil then partmesh.MeshType = mesh else partmesh.MeshId = "rbxassetid://"..mesh end
  291. partmesh.Scale = size
  292.  
  293. local pvalue = Instance.new("Vector3Value",part)
  294. pvalue.Name = "Position"
  295. pvalue.Value = part.Position
  296.  
  297. local svalue = Instance.new("Vector3Value",part)
  298. svalue.Name = "Size"
  299. svalue.Value = sizechange
  300.  
  301. local rvalue = Instance.new("Vector3Value",part)
  302. rvalue.Name = "Rotation"
  303. rvalue.Value = rotationchange
  304.  
  305. local tvalue = Instance.new("NumberValue",part)
  306. tvalue.Name = "Transparency"
  307. tvalue.Value = transparencychange
  308.  
  309. local avalue = Instance.new("NumberValue",part)
  310. avalue.Name = "Acceleration"
  311. avalue.Value = acceleration
  312.  
  313. part.Name = "EFFECT"
  314.  
  315. return part
  316.  
  317. end
  318.  
  319. game:GetService("RunService").RenderStepped:connect(function()
  320.  
  321.  
  322. if not plr.Character:FindFirstChild("DebrisModel") then
  323. DebrisModel = Instance.new("Model",plr.Character)
  324. DebrisModel.Name = "DebrisModel"
  325. end
  326.  
  327. for i,v in pairs(DebrisModel:GetChildren()) do
  328. if v:IsA("BasePart") and v.Name == "EFFECT" then
  329. local pvalue = v:FindFirstChild("Position").Value
  330. local svalue = v:FindFirstChild("Size").Value
  331. local rvalue = v:FindFirstChild("Rotation").Value
  332. local tvalue = v:FindFirstChild("Transparency").Value
  333. local avalue = v:FindFirstChild("Acceleration").Value
  334. local mesh = v:FindFirstChild("Mesh")
  335. mesh.Scale = mesh.Scale + svalue
  336. v:FindFirstChild("Size").Value = v:FindFirstChild("Size").Value + (Vector3.new(1,1,1)*avalue)
  337. v.Transparency = v.Transparency + tvalue
  338. v.CFrame = v.CFrame*CFrame.Angles(math.rad(rvalue.X),math.rad(rvalue.Y),math.rad(rvalue.Z))
  339. if v.Transparency >= 1 or mesh.Scale.X < 0 or mesh.Scale.Y < 0 or mesh.Scale.Z < 0 then
  340. v:Destroy()
  341. end
  342. end
  343. end
  344.  
  345.  
  346. end)
  347.  
  348. ----------------------------------------------------------------------------
  349. skin_color = BrickColor.new("Light orange")
  350. p:ClearCharacterAppearance()
  351. --hed:WaitForChild("face"):Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement