Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait();
- local function scan(p)
- for _,v in pairs(p:GetChildren()) do
- if v:isA("BasePart") then
- if v.Name:match("[RL]EPart") then
- v.Name = "REPart";
- end
- if v.Parent.Name ~= "Hooves" then
- v.Anchored = false;
- v.CanCollide = false;
- elseif v.Parent.Name == "Hooves" then
- v.Anchored = false;
- v.CanCollide = false;
- end
- else
- scan(v);
- end
- end
- end
- local function Weld(w)
- local part0 = w.Part0;
- local part1 = w.Part1;
- local c=CFrame.new(part0.Position)
- local part0cf = part0.CFrame:toObjectSpace(c)
- w.C0=part0cf
- w.C1=part1.CFrame:toObjectSpace(c)
- end
- local function SpawnPig()
- -- 1 - Model
- obj1 = Instance.new("Model")
- -- 2 - Head
- obj2 = Instance.new("Part")
- obj2.CFrame = CFrame.new(Vector3.new(-1.15000498, 1.40999496, 0.00996448286)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj2.FormFactor = Enum.FormFactor.Custom
- obj2.CanCollide = false
- obj2.Transparency = 1
- obj2.TopSurface = Enum.SurfaceType.Smooth
- obj2.BottomSurface = Enum.SurfaceType.Smooth
- obj2.Size = Vector3.new(1.13999987, 1, 1)
- obj2.BrickColor = BrickColor.new("Light reddish violet")
- obj2.Friction = 0.30000001192093
- obj2.Shape = Enum.PartType.Block
- obj2.Name = "Head"
- obj2.Parent = obj1
- -- 13 - Torso
- obj13 = Instance.new("Part")
- obj13.CFrame = CFrame.new(Vector3.new(0.569995999, 1.42999494, 0.00999500044)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj13.FormFactor = Enum.FormFactor.Symmetric
- obj13.CanCollide = false
- obj13.TopSurface = Enum.SurfaceType.Smooth
- obj13.FrontSurface = Enum.SurfaceType.Smooth
- obj13.BottomSurface = Enum.SurfaceType.Smooth
- obj13.Size = Vector3.new(1.5999999, 1.19999993, 2.44000006)
- obj13.Anchored = false;
- obj13.BrickColor = BrickColor.new("Light reddish violet")
- obj13.Friction = 0.30000001192093
- obj13.Shape = Enum.PartType.Block
- obj13.Name = "Torso"
- obj13.Parent = obj1
- local hrp = obj13:clone();
- hrp.Parent = obj1;
- hrp.Name = "HumanoidRootPart";
- hrp.CFrame = obj13.CFrame;
- hrp.Transparency = 1;
- hrp:ClearAllChildren();
- local hrpweld = Instance.new("Motor6D",hrp);
- hrpweld.Name = "RootJoint";
- hrpweld.Part0 = hrp;
- hrpweld.Part1 = obj13;
- Weld(hrpweld);
- local blockmesh = Instance.new("BlockMesh",obj13);
- blockmesh.Scale = Vector3.new(0.8,1.2,1.3);
- -- 14 - Decal
- obj14 = Instance.new("Decal")
- obj14.Transparency = 0.5
- obj14.Face = Enum.NormalId.Top
- obj14.Texture = "http://www.roblox.com/asset/?id=147149482"
- obj14.Parent = obj13
- -- 15 - Decal
- obj15 = Instance.new("Decal")
- obj15.Transparency = 0.60000002384186
- obj15.Face = Enum.NormalId.Right
- obj15.Texture = "http://www.roblox.com/asset/?id=147149490"
- obj15.Parent = obj13
- -- 16 - Decal
- obj16 = Instance.new("Decal")
- obj16.Transparency = 0.60000002384186
- obj16.Face = Enum.NormalId.Left
- obj16.Texture = "http://www.roblox.com/asset/?id=147149538"
- obj16.Parent = obj13
- -- 23 - Right Leg
- obj23 = Instance.new("Part")
- obj23.CFrame = CFrame.new(Vector3.new(1.48999703, 0.529994905, -0.389998883)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj23.FormFactor = Enum.FormFactor.Custom
- obj23.CanCollide = false
- obj23.TopSurface = Enum.SurfaceType.Smooth
- obj23.BottomSurface = Enum.SurfaceType.Smooth
- obj23.Size = Vector3.new(0.399999976, 0.600000024, 0.599999964)
- obj23.BrickColor = BrickColor.new("Light reddish violet")
- obj23.Friction = 0.30000001192093
- obj23.Shape = Enum.PartType.Block
- obj23.Name = "Right Leg"
- obj23.Parent = obj1
- -- 25 - Left Leg
- obj25 = Instance.new("Part")
- obj25.CFrame = CFrame.new(Vector3.new(1.48999703, 0.529994905, 0.409985095)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj25.FormFactor = Enum.FormFactor.Custom
- obj25.CanCollide = false
- obj25.TopSurface = Enum.SurfaceType.Smooth
- obj25.BottomSurface = Enum.SurfaceType.Smooth
- obj25.Size = Vector3.new(0.399999976, 0.600000024, 0.599999964)
- obj25.BrickColor = BrickColor.new("Light reddish violet")
- obj25.Friction = 0.30000001192093
- obj25.Shape = Enum.PartType.Block
- obj25.Name = "Left Leg"
- obj25.Parent = obj1
- -- 27 - Right Arm
- obj27 = Instance.new("Part")
- obj27.CFrame = CFrame.new(Vector3.new(-0.350002944, 0.529994905, -0.389998883)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj27.FormFactor = Enum.FormFactor.Custom
- obj27.CanCollide = false
- obj27.TopSurface = Enum.SurfaceType.Smooth
- obj27.BottomSurface = Enum.SurfaceType.Smooth
- obj27.Size = Vector3.new(0.399999976, 0.600000024, 0.599999964)
- obj27.BrickColor = BrickColor.new("Light reddish violet")
- obj27.Friction = 0.30000001192093
- obj27.Shape = Enum.PartType.Block
- obj27.Name = "Right Arm"
- obj27.Parent = obj1
- -- 29 - Left Arm
- obj29 = Instance.new("Part")
- obj29.CFrame = CFrame.new(Vector3.new(-0.350002944, 0.529994905, 0.409985095)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj29.FormFactor = Enum.FormFactor.Custom
- obj29.CanCollide = false
- obj29.TopSurface = Enum.SurfaceType.Smooth
- obj29.BottomSurface = Enum.SurfaceType.Smooth
- obj29.Size = Vector3.new(0.399999976, 0.600000024, 0.599999964)
- obj29.BrickColor = BrickColor.new("Light reddish violet")
- obj29.Friction = 0.30000001192093
- obj29.Shape = Enum.PartType.Block
- obj29.Name = "Left Arm"
- obj29.Parent = obj1
- -- 31 - LeftEye
- obj31 = Instance.new("Model")
- obj31.Name = "LeftEye"
- obj31.Parent = obj1
- -- 32 - LEPart
- obj32 = Instance.new("Part")
- obj32.CFrame = CFrame.new(Vector3.new(-1.59000504, 1.75997949, 0.305482864)) * CFrame.Angles(0.10000000149012, 1.5707963705063, 0)
- obj32.FormFactor = Enum.FormFactor.Custom
- obj32.CanCollide = false
- obj32.TopSurface = Enum.SurfaceType.Smooth
- obj32.BottomSurface = Enum.SurfaceType.Smooth
- obj32.Size = Vector3.new(0.209999874, 0.200000003, 0.200000003)
- obj32.BrickColor = BrickColor.new("Really black")
- obj32.Friction = 0.30000001192093
- obj32.Shape = Enum.PartType.Block
- obj32.Name = "LEPart"
- obj32.Parent = obj31
- -- 33 - Mesh
- obj33 = Instance.new("BlockMesh")
- obj33.Scale = Vector3.new(0.5, 0.5, 1.20000005)
- obj33.Parent = obj32
- -- 34 - LE
- obj34 = Instance.new("Part")
- obj34.CFrame = CFrame.new(Vector3.new(-1.59000504, 1.75997949, 0.305482864)) * CFrame.Angles(0.10000000149012, 1.5707963705063, 0)
- obj34.FormFactor = Enum.FormFactor.Custom
- obj34.CanCollide = false
- obj34.TopSurface = Enum.SurfaceType.Smooth
- obj34.BottomSurface = Enum.SurfaceType.Smooth
- obj34.Size = Vector3.new(0.209999874, 0.200000003, 0.200000003)
- obj34.BrickColor = BrickColor.new("Institutional white")
- obj34.Friction = 0.30000001192093
- obj34.Shape = Enum.PartType.Block
- obj34.Name = "LE"
- obj34.Parent = obj31
- -- 35 - RightEye
- obj35 = Instance.new("Model")
- obj35.Name = "RightEye"
- obj35.Parent = obj1
- -- 36 - REPart
- obj36 = Instance.new("Part")
- obj36.CFrame = CFrame.new(Vector3.new(-1.59000504, 1.75997972, -0.295502752)) * CFrame.Angles(-0.10000000149012, 1.5707963705063, 0)
- obj36.FormFactor = Enum.FormFactor.Custom
- obj36.CanCollide = false
- obj36.TopSurface = Enum.SurfaceType.Smooth
- obj36.BottomSurface = Enum.SurfaceType.Smooth
- obj36.Size = Vector3.new(0.209999874, 0.200000003, 0.200000003)
- obj36.BrickColor = BrickColor.new("Really black")
- obj36.Friction = 0.30000001192093
- obj36.Shape = Enum.PartType.Block
- obj36.Name = "REPart"
- obj36.Parent = obj35
- -- 37 - Mesh
- obj37 = Instance.new("BlockMesh")
- obj37.Scale = Vector3.new(0.5, 0.5, 1.20000005)
- obj37.Parent = obj36
- -- 38 - RE
- obj38 = Instance.new("Part")
- obj38.CFrame = CFrame.new(Vector3.new(-1.59000504, 1.75997972, -0.295502752)) * CFrame.Angles(-0.10000000149012, 1.5707963705063, 0)
- obj38.FormFactor = Enum.FormFactor.Custom
- obj38.CanCollide = false
- obj38.TopSurface = Enum.SurfaceType.Smooth
- obj38.BottomSurface = Enum.SurfaceType.Smooth
- obj38.Size = Vector3.new(0.209999874, 0.200000003, 0.200000003)
- obj38.BrickColor = BrickColor.new("Institutional white")
- obj38.Friction = 0.30000001192093
- obj38.Shape = Enum.PartType.Block
- obj38.Name = "RE"
- obj38.Parent = obj35
- -- 39 - Ears
- obj39 = Instance.new("Model")
- obj39.Name = "Ears"
- obj39.Parent = obj1
- -- 40 - Ear1
- obj40 = Instance.new("WedgePart")
- obj40.CFrame = CFrame.new(Vector3.new(-1.45000505, 2.00999308, -0.360121965)) * CFrame.Angles(-3.1415922641754, 0, 3.141592502594)
- obj40.FormFactor = Enum.FormFactor.Custom
- obj40.CanCollide = false
- obj40.TopSurface = Enum.SurfaceType.Smooth
- obj40.Size = Vector3.new(0.200000003, 0.200000003, 0.399999976)
- obj40.BrickColor = BrickColor.new("Light reddish violet")
- obj40.Friction = 0.30000001192093
- obj40.Name = "Ear1"
- obj40.Parent = obj39
- -- 41 - Ear2
- obj41 = Instance.new("WedgePart")
- obj41.CFrame = CFrame.new(Vector3.new(-1.45000494, 2.00999308, 0.379959613)) * CFrame.Angles(-0, 0, -0)
- obj41.FormFactor = Enum.FormFactor.Custom
- obj41.CanCollide = false
- obj41.TopSurface = Enum.SurfaceType.Smooth
- obj41.Size = Vector3.new(0.200000003, 0.200000003, 0.399999976)
- obj41.BrickColor = BrickColor.new("Light reddish violet")
- obj41.Friction = 0.30000001192093
- obj41.Name = "Ear2"
- obj41.Parent = obj39
- -- 42 - Mouth
- obj42 = Instance.new("Model")
- obj42.Name = "Mouth"
- obj42.Parent = obj1
- -- 43 - Nostril
- obj43 = Instance.new("Part")
- obj43.CFrame = CFrame.new(Vector3.new(-1.87000501, 1.419994, 0.14498952)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj43.FormFactor = Enum.FormFactor.Custom
- obj43.CanCollide = false
- obj43.TopSurface = Enum.SurfaceType.Smooth
- obj43.BottomSurface = Enum.SurfaceType.Smooth
- obj43.Size = Vector3.new(0.209999874, 0.200000003, 0.400000036)
- obj43.BrickColor = BrickColor.new("Really black")
- obj43.Friction = 0.30000001192093
- obj43.Shape = Enum.PartType.Block
- obj43.Name = "Nostril"
- obj43.Parent = obj42
- -- 44 - Mesh
- obj44 = Instance.new("BlockMesh")
- obj44.Scale = Vector3.new(0.699999988, 0.699999988, 1)
- obj44.Parent = obj43
- -- 45 - Nose
- obj45 = Instance.new("Part")
- obj45.CFrame = CFrame.new(Vector3.new(-1.8400048, 1.31499505, -0.00503489375)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj45.FormFactor = Enum.FormFactor.Custom
- obj45.CanCollide = false
- obj45.TopSurface = Enum.SurfaceType.Smooth
- obj45.BottomSurface = Enum.SurfaceType.Smooth
- obj45.Size = Vector3.new(0.709999859, 0.530000031, 0.400000036)
- obj45.BrickColor = BrickColor.new("Light reddish violet")
- obj45.Friction = 0.30000001192093
- obj45.Shape = Enum.PartType.Block
- obj45.Name = "Nose"
- obj45.Parent = obj42
- -- 46 - Nostril2
- obj46 = Instance.new("Part")
- obj46.CFrame = CFrame.new(Vector3.new(-1.87000501, 1.419994, -0.15502879)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj46.FormFactor = Enum.FormFactor.Custom
- obj46.CanCollide = false
- obj46.TopSurface = Enum.SurfaceType.Smooth
- obj46.BottomSurface = Enum.SurfaceType.Smooth
- obj46.Size = Vector3.new(0.209999874, 0.200000003, 0.400000036)
- obj46.BrickColor = BrickColor.new("Really black")
- obj46.Friction = 0.30000001192093
- obj46.Shape = Enum.PartType.Block
- obj46.Name = "Nostril2"
- obj46.Parent = obj42
- -- 47 - Mesh
- obj47 = Instance.new("BlockMesh")
- obj47.Scale = Vector3.new(0.699999988, 0.699999988, 1)
- obj47.Parent = obj46
- -- 48 - Tail
- obj48 = Instance.new("Part")
- obj48.CFrame = CFrame.new(Vector3.new(1.48999596, 1.48499393, 0.0250096489)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj48.FormFactor = Enum.FormFactor.Custom
- obj48.CanCollide = false
- obj48.TopSurface = Enum.SurfaceType.Smooth
- obj48.FrontSurface = Enum.SurfaceType.Smooth
- obj48.BottomSurface = Enum.SurfaceType.Smooth
- obj48.Size = Vector3.new(0.329999983, 0.310000002, 1)
- obj48.BrickColor = BrickColor.new("Light reddish violet")
- obj48.Friction = 0.30000001192093
- obj48.Shape = Enum.PartType.Block
- obj48.Name = "Tail"
- obj48.Parent = obj1
- -- 49 - FakeHead
- obj49 = Instance.new("Part")
- obj49.CFrame = CFrame.new(Vector3.new(-1.15000498, 1.40999508, 0.0099644959)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj49.FormFactor = Enum.FormFactor.Custom
- obj49.CanCollide = false
- obj49.TopSurface = Enum.SurfaceType.Smooth
- obj49.BottomSurface = Enum.SurfaceType.Smooth
- obj49.Size = Vector3.new(1.13999987, 1, 1)
- obj49.BrickColor = BrickColor.new("Light reddish violet")
- obj49.Friction = 0.30000001192093
- obj49.Shape = Enum.PartType.Block
- obj49.Name = "FakeHead"
- obj49.Parent = obj1
- -- 59 - Hooves
- obj59 = Instance.new("Model")
- obj59.Name = "Hooves"
- obj59.Parent = obj1
- -- 60 - LLPart
- obj60 = Instance.new("Part")
- obj60.CFrame = CFrame.new(Vector3.new(1.48999703, 0.129996926, 0.409985095)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj60.FormFactor = Enum.FormFactor.Custom
- obj60.CanCollide = false
- obj60.TopSurface = Enum.SurfaceType.Smooth
- obj60.BottomSurface = Enum.SurfaceType.Smooth
- obj60.Size = Vector3.new(0.399999976, 0.200000003, 0.599999964)
- obj60.BrickColor = BrickColor.new("Black")
- obj60.Friction = 0.30000001192093
- obj60.Shape = Enum.PartType.Block
- obj60.Name = "LLPart"
- obj60.Parent = obj59
- -- 61 - LAPart
- obj61 = Instance.new("Part")
- obj61.CFrame = CFrame.new(Vector3.new(-0.350002944, 0.129996926, 0.409985095)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj61.FormFactor = Enum.FormFactor.Custom
- obj61.CanCollide = false
- obj61.TopSurface = Enum.SurfaceType.Smooth
- obj61.BottomSurface = Enum.SurfaceType.Smooth
- obj61.Size = Vector3.new(0.399999976, 0.200000003, 0.599999964)
- obj61.BrickColor = BrickColor.new("Black")
- obj61.Friction = 0.30000001192093
- obj61.Shape = Enum.PartType.Block
- obj61.Name = "LAPart"
- obj61.Parent = obj59
- -- 62 - RAPart
- obj62 = Instance.new("Part")
- obj62.CFrame = CFrame.new(Vector3.new(-0.350002944, 0.129996926, -0.389998883)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj62.FormFactor = Enum.FormFactor.Custom
- obj62.CanCollide = false
- obj62.TopSurface = Enum.SurfaceType.Smooth
- obj62.BottomSurface = Enum.SurfaceType.Smooth
- obj62.Size = Vector3.new(0.399999976, 0.200000003, 0.599999964)
- obj62.BrickColor = BrickColor.new("Black")
- obj62.Friction = 0.30000001192093
- obj62.Shape = Enum.PartType.Block
- obj62.Name = "RAPart"
- obj62.Parent = obj59
- -- 63 - RLPart
- obj63 = Instance.new("Part")
- obj63.CFrame = CFrame.new(Vector3.new(1.48999703, 0.129996926, -0.389998883)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj63.FormFactor = Enum.FormFactor.Custom
- obj63.CanCollide = false
- obj63.TopSurface = Enum.SurfaceType.Smooth
- obj63.BottomSurface = Enum.SurfaceType.Smooth
- obj63.Size = Vector3.new(0.399999976, 0.200000003, 0.599999964)
- obj63.BrickColor = BrickColor.new("Black")
- obj63.Friction = 0.30000001192093
- obj63.Shape = Enum.PartType.Block
- obj63.Name = "RLPart"
- obj63.Parent = obj59
- -- Welds and Finalization
- -- 3 - Motor6D
- obj3 = Instance.new("Motor6D")
- obj3.Part0 = obj2
- obj3.Part1 = obj36
- obj3.Parent = obj2
- Weld(obj3);
- -- 4 - Motor6D
- obj4 = Instance.new("Motor6D")
- obj4.Part0 = obj2
- obj4.Part1 = obj38
- obj4.Parent = obj2
- Weld(obj4);
- -- 5 - Motor6D
- obj5 = Instance.new("Motor6D")
- obj5.Part0 = obj2
- obj5.Part1 = obj43
- obj5.Parent = obj2
- Weld(obj5);
- -- 6 - Motor6D
- obj6 = Instance.new("Motor6D")
- obj6.Part0 = obj2
- obj6.Part1 = obj45
- obj6.Parent = obj2
- Weld(obj6);
- -- 7 - Motor6D
- obj7 = Instance.new("Motor6D")
- obj7.Part0 = obj2
- obj7.Part1 = obj46
- obj7.Parent = obj2
- Weld(obj7);
- -- 8 - Motor6D
- obj8 = Instance.new("Motor6D")
- obj8.Part0 = obj2
- obj8.Part1 = obj32
- obj8.Parent = obj2
- Weld(obj8);
- -- 9 - Motor6D
- obj9 = Instance.new("Motor6D")
- obj9.Part0 = obj2
- obj9.Part1 = obj34
- obj9.Parent = obj2
- Weld(obj9);
- -- 10 - Motor6D
- obj10 = Instance.new("Motor6D")
- obj10.Part0 = obj2
- obj10.Part1 = obj40
- obj10.Parent = obj2
- Weld(obj10);
- -- 11 - Motor6D
- obj11 = Instance.new("Motor6D")
- obj11.Part0 = obj2
- obj11.Part1 = obj41
- obj11.Parent = obj2
- Weld(obj11);
- -- 12 - Motor6D
- obj12 = Instance.new("Motor6D")
- obj12.Part0 = obj2
- obj12.Part1 = obj49
- obj12.Parent = obj2
- Weld(obj12);
- -- 17 - Right Hip
- obj17 = Instance.new("Motor6D")
- obj17.Part0 = obj13
- obj17.Part1 = obj23
- obj17.Name = "Right Hip"
- obj17.Parent = obj13
- Weld(obj17);
- -- 18 - Right Shoulder
- obj18 = Instance.new("Motor6D")
- obj18.Part0 = obj13
- obj18.Part1 = obj27
- obj18.Name = "Right Shoulder"
- obj18.Parent = obj13
- Weld(obj18);
- -- 19 - Left Hip
- obj19 = Instance.new("Motor6D")
- obj19.Part0 = obj13
- obj19.Part1 = obj25
- obj19.Name = "Left Hip"
- obj19.Parent = obj13
- Weld(obj19);
- -- 20 - Left Shoulder
- obj20 = Instance.new("Motor6D")
- obj20.Part0 = obj13
- obj20.Part1 = obj29
- obj20.Name = "Left Shoulder"
- obj20.Parent = obj13
- Weld(obj20);
- -- 21 - Neck
- obj21 = Instance.new("Motor6D")
- obj21.Part0 = obj13
- obj21.Part1 = obj2
- obj21.Name = "Neck"
- obj21.Parent = obj13
- Weld(obj21);
- -- 22 - TailWeld
- obj22 = Instance.new("Motor6D")
- obj22.Part0 = obj13
- obj22.Part1 = obj48
- obj22.Name = "TailWeld"
- obj22.Parent = obj13
- Weld(obj22);
- -- 24 - Motor6D
- obj24 = Instance.new("Motor6D")
- obj24.Part0 = obj23
- obj24.Part1 = obj63
- obj24.Parent = obj23
- Weld(obj24);
- -- 26 - Motor6D
- obj26 = Instance.new("Motor6D")
- obj26.Part0 = obj25
- obj26.Part1 = obj60
- obj26.Parent = obj25
- Weld(obj26);
- -- 28 - Motor6D
- obj28 = Instance.new("Motor6D")
- obj28.Part0 = obj27
- obj28.Part1 = obj62
- obj28.Parent = obj27
- Weld(obj28);
- -- 30 - Motor6D
- obj30 = Instance.new("Motor6D")
- obj30.Part0 = obj29
- obj30.Part1 = obj61
- obj30.Parent = obj29
- Weld(obj30);
- local Oink = Instance.new("Sound",obj13);
- Oink.Name = "Oink";
- Oink.Volume = 1;
- Oink.SoundId = "rbxassetid://245763014";
- local Step = Instance.new("Sound",obj13);
- Step.Name = "Step";
- Step.Volume = 0.5;
- local Humanoid = Instance.new("Humanoid",obj1);
- scan(obj1);
- return obj1;
- end
- PigClient = [==[
- wait();
- local pig = script.Parent;
- local hrp = pig:WaitForChild("HumanoidRootPart");
- hrp.RootJoint.C0 = hrp.RootJoint.C0*CFrame.new(0,.5,0);
- local torso = pig:WaitForChild("Torso");
- pig.DescendantAdded:connect(function(o)
- if o:isA("Weld") or o:isA("Motor6D") or o:isA("Weld") then o:Destroy() end
- end)
- local head = pig:WaitForChild("Head");
- FootSteps = {
- [1] = {"185700502","185700484","185700458","185700448","185700432"},
- [2] = {"187263007","187263016","187263022","187263000","187262992"},
- [4] = {"187263007","187263016","187263022","187263000","187262992"},
- }
- Fur = {}
- for _,v in pairs(pig:GetChildren()) do
- if v:isA("BasePart") and (v.BrickColor.name:match("violet")) then
- Fur[#Fur+1]={v,v.BrickColor.name};
- end
- end
- local Sound = torso.Oink;
- local Terror = Sound:clone();
- Terror.Name = "Terror";
- Terror.Volume = .5;
- Terror.Parent = torso;
- Terror.SoundId = "http://roblox.com/asset?id=171412824";
- local Step = torso.Step;
- local rs = torso["Right Shoulder"];
- local ls = torso["Left Shoulder"];
- local rh = torso["Right Hip"];
- local lh = torso["Left Hip"];
- local neck = torso["Neck"];
- freq = 12;
- rsc0 = rs.C0;
- lsc0 = ls.C0;
- rhc0 = rh.C0;
- lhc0 = lh.C0;
- neckc0 = neck.C0;
- local Eyes = {};
- for _,v in pairs(pig:GetChildren()) do
- if v.Name:match("Eye") then
- Eyes[#Eyes+1]=v;
- end
- end
- humanoid = pig:WaitForChild("Humanoid");
- local rst = game:GetService("RunService").RenderStepped;
- local player = game:GetService("Players").LocalPlayer;
- local mouse = player:GetMouse();
- local neckangle = 0;
- local walkspeed = 1;
- function clamp(v,mi,ma)
- if v<mi then return mi elseif v>ma then return ma else return v; end
- end
- function stationary()
- rh:SetDesiredAngle(lockedrh or 0);
- rs:SetDesiredAngle(lockedrs or 0);
- lh:SetDesiredAngle(lockedlh or 0);
- ls:SetDesiredAngle(lockedls or 0);
- end
- local Ignore = {[1]=pig}
- FollowCamera = false;
- local function Peck(number)
- Pecking = true;
- n = number or math.random(1,2);
- if n == 1 then
- for i = 0, 50, 25 do
- neck.DesiredAngle = math.rad(i)
- wait(0.03)
- end
- for i = 50, 0, -25 do
- neck.DesiredAngle = math.rad(i)
- wait(0.03)
- end
- end
- Pecking = false;
- end
- mouse.KeyDown:connect(function(k)
- if k == "r" and not randeb then
- randeb = true;
- ran = 0;
- wait(.5);
- randeb = false;
- end
- if k == "k" then
- FollowCamera = not FollowCamera;
- end
- if k == "e" and not Pecking then
- Peck(1);
- end
- if k == "\48" then
- walkspeed = 2;
- freq = 18;
- humanoid.WalkSpeed = 32;
- end
- end)
- mouse.KeyUp:connect(function(k)
- if k == "\48" then
- freq = 12;
- walkspeed = 1;
- humanoid.WalkSpeed = 12;
- end
- end)
- ran = 5;
- ranblink = 5;
- LastCheck = 0;
- LastBlinkCheck = 0;
- LastRunCheck = 0;
- local asin = math.asin;
- local abs = math.abs;
- local headoriginal = neck.C0;
- camera = Workspace.CurrentCamera;
- local neckc0 = neck.C0;
- local neckc1 = neck.C1;
- while true do
- rst:wait();
- local time = Workspace.DistributedGameTime;
- if FollowCamera then
- torso.CFrame=CFrame.new(torso.Position,torso.Position+camera.CoordinateFrame.lookVector*Vector3.new(10,0,10))
- end
- local MouseX = mouse.X;
- local MouseY = mouse.Y;
- local d = torso.CFrame:pointToObjectSpace(mouse.UnitRay.Origin+mouse.UnitRay.Direction.unit*100);
- local mouseX = asin(((MouseX/mouse.ViewSizeX)-1));
- local mouseY = asin(-d.unit.Y);
- local mouseYP = asin(((MouseY/mouse.ViewSizeY)-0.5)*2);
- local angleY = -mouseY -- clamp(-mouseY,-1.3,2.05);
- local angleYP = -mouseYP
- local angleX = -(mouseX) -- clamp(-mouseX,-1.5,1.5);
- local HeadY = clamp(angleY,-0.2,0.8);
- local HeadYPassive = clamp(angleYP,-0.5,.1);
- neck.C0 = neckc0*CFrame.Angles(0,angleX-.5,-HeadYPassive)
- if not Flying and(not (mouse.Y <= 3 or mouse.X >= mouse.ViewSizeX - 5 or mouse.X <= 3 or mouse.Y >= mouse.ViewSizeY - 5)) then
- if torso.Velocity.magnitude >= 2 then Walking = true
- local sin = math.sin(time*(freq))/10;
- local desangle = 1.1 * sin;
- rh.DesiredAngle = lockedrh or -desangle
- rs.DesiredAngle = lockedrs or -desangle
- lh.DesiredAngle = lockedlh or desangle;
- ls.DesiredAngle = lockedls or desangle;
- else
- Walking = false;
- rh:SetDesiredAngle(lockedrh or 0);
- rs:SetDesiredAngle(lockedrs or 0);
- lh:SetDesiredAngle(lockedlh or 0);
- ls:SetDesiredAngle(lockedls or 0);
- end
- neck.MaxVelocity = 0.05;
- ls.MaxVelocity = 0.04*walkspeed;
- rs.MaxVelocity = 0.04*walkspeed;
- lh.MaxVelocity = 0.04*walkspeed;
- rh.MaxVelocity = 0.04*walkspeed;
- if Workspace.DistributedGameTime-LastBlinkCheck >= ranblink then
- LastBlinkCheck = Workspace.DistributedGameTime
- ranblink = math.random(3,8);
- for _,v in pairs(Eyes) do
- v.REPart.Mesh.Scale = Vector3.new(0.5, 0.1, 1.2);
- end
- wait(.1)
- for _,v in pairs(Eyes) do
- v.REPart.Mesh.Scale = Vector3.new(0.5, 0.5, 1.2);
- end
- end
- if Workspace.DistributedGameTime-LastRunCheck >= .5/walkspeed and Walking then
- LastRunCheck = Workspace.DistributedGameTime;
- Step.SoundId = "http://roblox.com/asset?id="..FootSteps[walkspeed][math.random(1,5)];
- Step:Play();
- end
- if Workspace.DistributedGameTime-LastCheck >= ran then
- Sound.Pitch = math.random(80,120)/100;
- wait();
- Sound:Play();
- LastCheck = Workspace.DistributedGameTime;
- ran = math.random(5,15);
- end
- end
- end
- ]==]
- function MakePlayerPig(player)
- if Workspace:FindFirstChild("Com") or NLS then
- local pig = SpawnPig();
- pig.Parent = Workspace;
- pig:MakeJoints();
- pig:TranslateBy(Vector3.new(150/3,5,150/3)-pig:GetModelCFrame().p)
- Workspace.CurrentCamera.CameraSubject = pig.Humanoid;
- local ch = player.Character;
- ch.Humanoid:Destroy();
- wait(.5);
- for _,v in pairs(ch:GetChildren()) do
- v:Destroy();
- end
- for _,v in pairs(pig:GetChildren()) do
- v.Parent = ch;
- end
- if not NLS then Workspace.Com:FireServer(PigClient,ch,"NLS"); else NLS(PigClient,ch) end
- end
- end
- MakePlayerPig(game.Players.LocalPlayer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement