tyridge77

ChickenClient

Jul 10th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.50 KB | None | 0 0
  1. wait();
  2.  
  3.  
  4.     Animating = true;
  5.     local model = script.Parent;
  6.     local torso = model:WaitForChild("Torso");
  7.     local head = model:WaitForChild("Head");
  8.     local vhead = model:WaitForChild("VisibleHead")
  9.     local rwing = model:WaitForChild("Left Arm");
  10.     local lwing = model:WaitForChild("Right Arm");
  11.     local rleg = model:WaitForChild("Right Leg");
  12.     local lleg = model:WaitForChild("Left Leg");
  13.     local beak = model:WaitForChild("Beak");
  14.     local wattle = model:WaitForChild("Wattle");
  15.     local eye1 = model:WaitForChild("Eye")
  16.     local eye2 = model:WaitForChild("Eye2")
  17.     local eye1m = eye1:WaitForChild("eye1m")
  18.     local eye2m = eye2:WaitForChild("eye2m");
  19.     local neck = torso:WaitForChild("Neck");
  20.     local vneck = head:WaitForChild("VNeck");
  21.     local rsh = torso:WaitForChild("Right Shoulder");
  22.     local lsh = torso:WaitForChild("Left Shoulder");
  23.     local rhi = torso:WaitForChild("Right Shoulderr");
  24.     local lhi = torso:WaitForChild("Left Shoulderr");
  25.     local bth = head:WaitForChild("bth");
  26.     local wth = head:WaitForChild("wth");
  27.     local eth1 = head:WaitForChild("eth1");
  28.     local eth2 = head:WaitForChild("eth2");
  29.     local swoot = Instance.new("Sound",torso);
  30.     swoot.Volume = .5;
  31.     swoot.SoundId = "http://www.roblox.com/asset/?id=3931318"
  32.     swoot.Looped = true
  33.     local cluck1 = Instance.new("Sound", head)
  34.     local randomids = {
  35.     'http://www.roblox.com/asset/?id=24111782',
  36.     'http://www.roblox.com/asset/?id=24111798',
  37.     'http://www.roblox.com/asset/?id=24111823',
  38.     'http://www.roblox.com/asset/?id=24111685'
  39.     }
  40.      
  41.    
  42.     cluck1.Pitch = 1
  43.     cluck1.Volume = 1
  44.  
  45.     local humanoid = model:WaitForChild("Humanoid");     
  46.     local status = "standing"
  47.  
  48.     lastcluck = 0;
  49.     clucktime = 0;
  50.    
  51.     lastpeck = 0;
  52.     pecktime = 0;
  53.    
  54.     lastblink = 0;
  55.     blinktime = 0;
  56.    
  57.     local function Peck()
  58.         if math.random(1,2) == 1 then
  59.             for i = 0, -125, -25 do
  60.                 neck.DesiredAngle = math.rad(i)
  61.                 wait(0.03)
  62.             end
  63.             for i = -125, 0, 25 do
  64.                 neck.DesiredAngle = math.rad(i)
  65.                 wait(0.03)
  66.             end
  67.         else
  68.             vneck.DesiredAngle = math.rad(60)
  69.             wait(0.5)
  70.             vneck.DesiredAngle = -math.rad(60)
  71.             wait(1)
  72.             vneck.DesiredAngle = 0
  73.         end
  74.     end
  75.     local function Blink()
  76.         eye1m.Scale = Vector3.new(0.3, 0.02, 0.3)
  77.         eye2m.Scale = Vector3.new(0.3, 0.02, 0.3)
  78.         wait(0.1)
  79.         eye1m.Scale = Vector3.new(0.3, 0.3, 0.3)
  80.         eye2m.Scale = Vector3.new(0.3, 0.3, 0.3)
  81.     end
  82.    
  83.    
  84.     local run = humanoid.Running:connect(function(spd)
  85.         if spd <1 then
  86.             status = "standing"
  87.             else
  88.             status = "walking"
  89.         end
  90.     end)
  91.     local climb = humanoid.Climbing:connect(function(active)
  92.         if active then
  93.             status = "walking"
  94.         end
  95.     end)
  96.     local seated = humanoid.Seated:connect(function(active)
  97.         if active then
  98.             status = "sitting"
  99.         end
  100.     end)     
  101.     local swimming = humanoid.Swimming:connect(function(active)
  102.         if active then
  103.             status = "sitting"
  104.         end
  105.     end)
  106.     local fallingdown = humanoid.FallingDown:connect(function(active)
  107.         if active then
  108.             status = "falling"
  109.         end
  110.     end)
  111.     local freefalling = humanoid.FreeFalling:connect(function(active)
  112.         if active then
  113.             status = "falling"
  114.         end
  115.     end)
  116.     local rs = game:GetService("RunService").RenderStepped;
  117.    
  118.    
  119.    
  120.    
  121.     while true do
  122.         rs:wait();
  123.         local time = Workspace.DistributedGameTime;
  124.        
  125.         if time - lastcluck >= clucktime then
  126.             cluck1.SoundId = randomids[math.random(1,#randomids)]
  127.             wait(0)
  128.             cluck1:Play()
  129.             lastcluck = time;
  130.             clucktime = (math.random()*10)+4;
  131.         end
  132.         if time - lastpeck >= pecktime and status == "standing" then
  133.             Peck();
  134.             lastpeck = time;
  135.             pecktime = (math.random()*10)+6;
  136.         end
  137.         if time - lastblink >= blinktime then
  138.             Blink();
  139.             lastblink = time;
  140.             blinktime = (math.random()*10)+2
  141.         end
  142.        
  143.         local amp, fre = 0, 1    
  144.         if status == "sitting" then
  145.             rleg.Transparency = 1
  146.             lleg.Transparency = 1
  147.             else
  148.             rleg.Transparency = 0
  149.             lleg.Transparency = 0
  150.         end  
  151.         if status == "walking" then
  152.             amp = 1.1
  153.             fre = 15
  154.         end  
  155.         local desangle = amp * math.sin(time*fre)
  156.        
  157.         rhi.DesiredAngle = -desangle
  158.         lhi.DesiredAngle = -desangle   
  159.          
  160.         if torso.Velocity.y < -1 then
  161.             torso.Velocity = Vector3.new(torso.Velocity.x, -0.5, torso.Velocity.z)
  162.         end
  163.          
  164.         if status == "falling" then
  165.             if not swoot.IsPlaying then
  166.                 swoot:Play()
  167.             end
  168.             swoot.Pitch = (math.random()*2) + 7
  169.             local swoosh = math.rad(40) * math.sin(time*30)
  170.             rsh.DesiredAngle = swoosh + math.rad(40)
  171.             lsh.DesiredAngle = swoosh + math.rad(40)
  172.             else
  173.             if swoot.IsPlaying then
  174.                 swoot:Stop()
  175.             end
  176.             rsh.DesiredAngle = 0
  177.             lsh.DesiredAngle = 0
  178.         end
  179.     end
Advertisement
Add Comment
Please, Sign In to add comment