Advertisement
Guest User

Untitled

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