sadasdasdsaas

aon

Mar 6th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  2.  
  3. part.Parent = parent
  4.  
  5. part.formFactor = form
  6.  
  7. part.CanCollide = collide
  8.  
  9. part.Transparency = tran
  10.  
  11. part.Reflectance = ref
  12.  
  13. part.Size = Vector3.new(x,y,z)
  14.  
  15. part.BrickColor = BrickColor.new(color)
  16.  
  17. part.TopSurface = 0
  18.  
  19. part.BottomSurface = 0
  20.  
  21. part.Anchored = anchor
  22.  
  23. part.Locked = true
  24.  
  25. part:BreakJoints()
  26.  
  27. end
  28.  
  29.  
  30.  
  31. function weld(w, p, p1, a, b, c, x, y, z)
  32.  
  33. w.Parent = p
  34.  
  35. w.Part0 = p
  36.  
  37. w.Part1 = p1
  38.  
  39. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  40.  
  41. end
  42.  
  43.  
  44.  
  45. function bird(pos)
  46.  
  47. local mod = Instance.new("Model")
  48.  
  49. mod.Name = "Bird"
  50.  
  51. local main = Instance.new("Part")
  52.  
  53. prop(main,mod,true,0,0,1.5,1.4,2.5,"Black",false,"Custom")
  54.  
  55. main.CFrame = CFrame.new(pos) * CFrame.Angles(0,math.random(-32,32)/10,0)
  56.  
  57. main.Name = "Torso"
  58.  
  59. Instance.new("SpecialMesh",main).MeshType = "Sphere"
  60.  
  61.  
  62.  
  63. local pa1 = Instance.new("Part")
  64.  
  65. prop(pa1,mod,false,0,0,0.9,1,0.9,"Black",false,"Custom")
  66.  
  67. pa1.CFrame = main.CFrame
  68.  
  69. pa1.Name = "Head"
  70.  
  71. Instance.new("SpecialMesh",pa1).MeshType = "Sphere"
  72.  
  73.  
  74.  
  75. local pa2 = Instance.new("Part")
  76.  
  77. prop(pa2,mod,false,0,0,0.2,0.4,0.7,"Neon orange",false,"Custom")
  78.  
  79. pa2.CFrame = main.CFrame
  80.  
  81. Instance.new("SpecialMesh",pa2).MeshType = "Wedge"
  82.  
  83.  
  84.  
  85. local wing1 = Instance.new("Part")
  86.  
  87. prop(wing1,mod,false,0,0,0.2,1.8,1.1,"Black",false,"Custom")
  88.  
  89. wing1.CFrame = main.CFrame
  90.  
  91.  
  92.  
  93. local wing2 = Instance.new("Part")
  94.  
  95. prop(wing2,mod,false,0,0,0.2,1.8,1.1,"Black",false,"Custom")
  96.  
  97. wing2.CFrame = main.CFrame
  98.  
  99.  
  100.  
  101.  
  102.  
  103. local w1 = Instance.new("Weld")
  104.  
  105. weld(w1,main,pa1,0.5,0,0,0,-0.6,1.2)
  106.  
  107. w1.Name = "Neck"
  108.  
  109.  
  110.  
  111. local w2 = Instance.new("Weld")
  112.  
  113. weld(w2,main,pa2,-0.2,0,0,0,-0.6,1.7)
  114.  
  115.  
  116.  
  117. local wi1 = Instance.new("Weld")
  118.  
  119. weld(wi1,main,wing1,0,0,math.pi/2,-1,-0.1,0.1)
  120.  
  121. local worig1 = CFrame.new(0.4,0,0) * CFrame.fromEulerAnglesXYZ(0,0,-0.4)
  122.  
  123. wi1.C0 = worig1
  124.  
  125.  
  126.  
  127. local wi2 = Instance.new("Weld")
  128.  
  129. weld(wi2,main,wing2,0,0,-math.pi/2,1,-0.1,0.1)
  130.  
  131. local worig2 = CFrame.new(-0.4,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0.4)
  132.  
  133. wi2.C0 = worig2
  134.  
  135.  
  136.  
  137. local hum = Instance.new("Humanoid",mod)
  138.  
  139. hum.Name = "Humanoid"
  140.  
  141. hum.MaxHealth = 30
  142.  
  143. hum.Health = 30
  144.  
  145.  
  146.  
  147. local bv = Instance.new("BodyVelocity",main)
  148.  
  149. bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  150.  
  151. bv.P = 5000
  152.  
  153. bv.velocity = main.CFrame.lookVector * 6
  154.  
  155.  
  156.  
  157. local bav = Instance.new("BodyAngularVelocity",main)
  158.  
  159. bav.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  160.  
  161. bav.P = 5000
  162.  
  163. bav.angularvelocity = Vector3.new(0,0,0)
  164.  
  165.  
  166.  
  167. hum.Died:connect(function()
  168.  
  169. bv:remove()
  170.  
  171. bav:remove()
  172.  
  173. wait(4)
  174.  
  175. mod:remove()
  176.  
  177. end)
  178.  
  179. mod.Parent = workspace
  180.  
  181. mod:MakeJoints()
  182.  
  183. coroutine.resume(coroutine.create(function()
  184.  
  185. while true do
  186.  
  187. for i=0.4,-0.4,-0.15 do
  188.  
  189. wait()
  190.  
  191. wi1.C0 = worig1 * CFrame.fromEulerAnglesXYZ(0,0,i)
  192.  
  193. wi2.C0 = worig2 * CFrame.fromEulerAnglesXYZ(0,0,-i)
  194.  
  195. end
  196.  
  197. for i=0.4,-0.4,-0.15 do
  198.  
  199. wait()
  200.  
  201. wi1.C0 = worig1 * CFrame.fromEulerAnglesXYZ(0,0,-i)
  202.  
  203. wi2.C0 = worig2 * CFrame.fromEulerAnglesXYZ(0,0,i)
  204.  
  205. end
  206.  
  207. end
  208.  
  209. end))
  210.  
  211. coroutine.resume(coroutine.create(function()
  212.  
  213. while true do
  214.  
  215. wait(0.1)
  216.  
  217. local turn = math.random(1,6)
  218.  
  219. coroutine.resume(coroutine.create(function()
  220.  
  221. if turn == 1 then
  222.  
  223. bav.angularvelocity = Vector3.new(0,6,0)
  224.  
  225. wait(1)
  226.  
  227. bav.angularvelocity = Vector3.new(0,0,0)
  228.  
  229. bv.velocity = main.CFrame.lookVector * 6
  230.  
  231. elseif turn == 2 then
  232.  
  233. bav.angularvelocity = Vector3.new(0,-6,0)
  234.  
  235. wait(1)
  236.  
  237. bav.angularvelocity = Vector3.new(0,0,0)
  238.  
  239. bv.velocity = main.CFrame.lookVector * 6
  240.  
  241. end
  242.  
  243. end))
  244.  
  245. end
  246.  
  247. end))
  248.  
  249. end
  250.  
  251.  
  252.  
  253. for i=1, math.random(4,11) do
  254.  
  255. local poz = Vector3.new(math.random(-100,100),math.random(60,80),math.random(-100,100))
  256.  
  257. bird(poz)
  258.  
  259. end
Add Comment
Please, Sign In to add comment