Advertisement
tyridge77

PigLocal

Sep 12th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 23.92 KB | None | 0 0
  1. wait();
  2.  
  3. local function scan(p)
  4.  for _,v in pairs(p:GetChildren()) do  
  5.     if v:isA("BasePart") then
  6.        if v.Name:match("[RL]EPart") then
  7.          v.Name = "REPart";
  8.        end
  9.        if v.Parent.Name ~= "Hooves" then
  10.        v.Anchored = false;
  11.        v.CanCollide = false;
  12.        elseif v.Parent.Name == "Hooves" then
  13.        v.Anchored = false;
  14.        v.CanCollide = false;
  15.        end
  16.     else
  17.        scan(v);
  18.     end
  19.  end
  20. end
  21. local function Weld(w)
  22.         local part0 = w.Part0;
  23.         local part1 = w.Part1;
  24.         local c=CFrame.new(part0.Position)
  25.         local part0cf = part0.CFrame:toObjectSpace(c)
  26.         w.C0=part0cf
  27.         w.C1=part1.CFrame:toObjectSpace(c)
  28. end
  29.  
  30. local function SpawnPig()
  31. -- 1 - Model
  32. obj1 = Instance.new("Model")
  33.  
  34. -- 2 - Head
  35. obj2 = Instance.new("Part")
  36. obj2.CFrame = CFrame.new(Vector3.new(-1.15000498, 1.40999496, 0.00996448286)) * CFrame.Angles(0, 1.5707963705063, 0)
  37. obj2.FormFactor = Enum.FormFactor.Custom
  38. obj2.CanCollide = false
  39. obj2.Transparency = 1
  40. obj2.TopSurface = Enum.SurfaceType.Smooth
  41. obj2.BottomSurface = Enum.SurfaceType.Smooth
  42. obj2.Size = Vector3.new(1.13999987, 1, 1)
  43. obj2.BrickColor = BrickColor.new("Light reddish violet")
  44. obj2.Friction = 0.30000001192093
  45. obj2.Shape = Enum.PartType.Block
  46. obj2.Name = "Head"
  47. obj2.Parent = obj1
  48.  
  49.  
  50. -- 13 - Torso
  51. obj13 = Instance.new("Part")
  52. obj13.CFrame = CFrame.new(Vector3.new(0.569995999, 1.42999494, 0.00999500044)) * CFrame.Angles(0, 1.5707963705063, 0)
  53. obj13.FormFactor = Enum.FormFactor.Symmetric
  54. obj13.CanCollide = false
  55. obj13.TopSurface = Enum.SurfaceType.Smooth
  56. obj13.FrontSurface = Enum.SurfaceType.Smooth
  57. obj13.BottomSurface = Enum.SurfaceType.Smooth
  58. obj13.Size = Vector3.new(1.5999999, 1.19999993, 2.44000006)
  59. obj13.Anchored = false;
  60. obj13.BrickColor = BrickColor.new("Light reddish violet")
  61. obj13.Friction = 0.30000001192093
  62. obj13.Shape = Enum.PartType.Block
  63. obj13.Name = "Torso"
  64. obj13.Parent = obj1
  65.  
  66. local hrp = obj13:clone();
  67. hrp.Parent = obj1;
  68. hrp.Name = "HumanoidRootPart";
  69. hrp.CFrame = obj13.CFrame;
  70. hrp.Transparency = 1;
  71. hrp:ClearAllChildren();
  72.  
  73. local hrpweld = Instance.new("Motor6D",hrp);
  74. hrpweld.Name = "RootJoint";
  75. hrpweld.Part0 = hrp;
  76. hrpweld.Part1 = obj13;
  77. Weld(hrpweld);
  78.  
  79. local blockmesh = Instance.new("BlockMesh",obj13);
  80. blockmesh.Scale = Vector3.new(0.8,1.2,1.3);
  81.  
  82. -- 14 - Decal
  83. obj14 = Instance.new("Decal")
  84. obj14.Transparency = 0.5
  85. obj14.Face = Enum.NormalId.Top
  86. obj14.Texture = "http://www.roblox.com/asset/?id=147149482"
  87. obj14.Parent = obj13
  88.  
  89. -- 15 - Decal
  90. obj15 = Instance.new("Decal")
  91. obj15.Transparency = 0.60000002384186
  92. obj15.Face = Enum.NormalId.Right
  93. obj15.Texture = "http://www.roblox.com/asset/?id=147149490"
  94. obj15.Parent = obj13
  95.  
  96. -- 16 - Decal
  97. obj16 = Instance.new("Decal")
  98. obj16.Transparency = 0.60000002384186
  99. obj16.Face = Enum.NormalId.Left
  100. obj16.Texture = "http://www.roblox.com/asset/?id=147149538"
  101. obj16.Parent = obj13
  102.  
  103.  
  104. -- 23 - Right Leg
  105. obj23 = Instance.new("Part")
  106. obj23.CFrame = CFrame.new(Vector3.new(1.48999703, 0.529994905, -0.389998883)) * CFrame.Angles(0, 1.5707963705063, 0)
  107. obj23.FormFactor = Enum.FormFactor.Custom
  108. obj23.CanCollide = false
  109. obj23.TopSurface = Enum.SurfaceType.Smooth
  110. obj23.BottomSurface = Enum.SurfaceType.Smooth
  111. obj23.Size = Vector3.new(0.399999976, 0.600000024, 0.599999964)
  112. obj23.BrickColor = BrickColor.new("Light reddish violet")
  113. obj23.Friction = 0.30000001192093
  114. obj23.Shape = Enum.PartType.Block
  115. obj23.Name = "Right Leg"
  116. obj23.Parent = obj1
  117.  
  118.  
  119.  
  120. -- 25 - Left Leg
  121. obj25 = Instance.new("Part")
  122. obj25.CFrame = CFrame.new(Vector3.new(1.48999703, 0.529994905, 0.409985095)) * CFrame.Angles(0, 1.5707963705063, 0)
  123. obj25.FormFactor = Enum.FormFactor.Custom
  124. obj25.CanCollide = false
  125. obj25.TopSurface = Enum.SurfaceType.Smooth
  126. obj25.BottomSurface = Enum.SurfaceType.Smooth
  127. obj25.Size = Vector3.new(0.399999976, 0.600000024, 0.599999964)
  128. obj25.BrickColor = BrickColor.new("Light reddish violet")
  129. obj25.Friction = 0.30000001192093
  130. obj25.Shape = Enum.PartType.Block
  131. obj25.Name = "Left Leg"
  132. obj25.Parent = obj1
  133.  
  134.  
  135.  
  136. -- 27 - Right Arm
  137. obj27 = Instance.new("Part")
  138. obj27.CFrame = CFrame.new(Vector3.new(-0.350002944, 0.529994905, -0.389998883)) * CFrame.Angles(0, 1.5707963705063, 0)
  139. obj27.FormFactor = Enum.FormFactor.Custom
  140. obj27.CanCollide = false
  141. obj27.TopSurface = Enum.SurfaceType.Smooth
  142. obj27.BottomSurface = Enum.SurfaceType.Smooth
  143. obj27.Size = Vector3.new(0.399999976, 0.600000024, 0.599999964)
  144. obj27.BrickColor = BrickColor.new("Light reddish violet")
  145. obj27.Friction = 0.30000001192093
  146. obj27.Shape = Enum.PartType.Block
  147. obj27.Name = "Right Arm"
  148. obj27.Parent = obj1
  149.  
  150.  
  151.  
  152. -- 29 - Left Arm
  153. obj29 = Instance.new("Part")
  154. obj29.CFrame = CFrame.new(Vector3.new(-0.350002944, 0.529994905, 0.409985095)) * CFrame.Angles(0, 1.5707963705063, 0)
  155. obj29.FormFactor = Enum.FormFactor.Custom
  156. obj29.CanCollide = false
  157. obj29.TopSurface = Enum.SurfaceType.Smooth
  158. obj29.BottomSurface = Enum.SurfaceType.Smooth
  159. obj29.Size = Vector3.new(0.399999976, 0.600000024, 0.599999964)
  160. obj29.BrickColor = BrickColor.new("Light reddish violet")
  161. obj29.Friction = 0.30000001192093
  162. obj29.Shape = Enum.PartType.Block
  163. obj29.Name = "Left Arm"
  164. obj29.Parent = obj1
  165.  
  166.  
  167.  
  168. -- 31 - LeftEye
  169. obj31 = Instance.new("Model")
  170. obj31.Name = "LeftEye"
  171. obj31.Parent = obj1
  172.  
  173. -- 32 - LEPart
  174. obj32 = Instance.new("Part")
  175. obj32.CFrame = CFrame.new(Vector3.new(-1.59000504, 1.75997949, 0.305482864)) * CFrame.Angles(0.10000000149012, 1.5707963705063, 0)
  176. obj32.FormFactor = Enum.FormFactor.Custom
  177. obj32.CanCollide = false
  178. obj32.TopSurface = Enum.SurfaceType.Smooth
  179. obj32.BottomSurface = Enum.SurfaceType.Smooth
  180. obj32.Size = Vector3.new(0.209999874, 0.200000003, 0.200000003)
  181. obj32.BrickColor = BrickColor.new("Really black")
  182. obj32.Friction = 0.30000001192093
  183. obj32.Shape = Enum.PartType.Block
  184. obj32.Name = "LEPart"
  185. obj32.Parent = obj31
  186.  
  187. -- 33 - Mesh
  188. obj33 = Instance.new("BlockMesh")
  189. obj33.Scale = Vector3.new(0.5, 0.5, 1.20000005)
  190. obj33.Parent = obj32
  191.  
  192. -- 34 - LE
  193. obj34 = Instance.new("Part")
  194. obj34.CFrame = CFrame.new(Vector3.new(-1.59000504, 1.75997949, 0.305482864)) * CFrame.Angles(0.10000000149012, 1.5707963705063, 0)
  195. obj34.FormFactor = Enum.FormFactor.Custom
  196. obj34.CanCollide = false
  197. obj34.TopSurface = Enum.SurfaceType.Smooth
  198. obj34.BottomSurface = Enum.SurfaceType.Smooth
  199. obj34.Size = Vector3.new(0.209999874, 0.200000003, 0.200000003)
  200. obj34.BrickColor = BrickColor.new("Institutional white")
  201. obj34.Friction = 0.30000001192093
  202. obj34.Shape = Enum.PartType.Block
  203. obj34.Name = "LE"
  204. obj34.Parent = obj31
  205.  
  206. -- 35 - RightEye
  207. obj35 = Instance.new("Model")
  208. obj35.Name = "RightEye"
  209. obj35.Parent = obj1
  210.  
  211. -- 36 - REPart
  212. obj36 = Instance.new("Part")
  213. obj36.CFrame = CFrame.new(Vector3.new(-1.59000504, 1.75997972, -0.295502752)) * CFrame.Angles(-0.10000000149012, 1.5707963705063, 0)
  214. obj36.FormFactor = Enum.FormFactor.Custom
  215. obj36.CanCollide = false
  216. obj36.TopSurface = Enum.SurfaceType.Smooth
  217. obj36.BottomSurface = Enum.SurfaceType.Smooth
  218. obj36.Size = Vector3.new(0.209999874, 0.200000003, 0.200000003)
  219. obj36.BrickColor = BrickColor.new("Really black")
  220. obj36.Friction = 0.30000001192093
  221. obj36.Shape = Enum.PartType.Block
  222. obj36.Name = "REPart"
  223. obj36.Parent = obj35
  224.  
  225. -- 37 - Mesh
  226. obj37 = Instance.new("BlockMesh")
  227. obj37.Scale = Vector3.new(0.5, 0.5, 1.20000005)
  228. obj37.Parent = obj36
  229.  
  230. -- 38 - RE
  231. obj38 = Instance.new("Part")
  232. obj38.CFrame = CFrame.new(Vector3.new(-1.59000504, 1.75997972, -0.295502752)) * CFrame.Angles(-0.10000000149012, 1.5707963705063, 0)
  233. obj38.FormFactor = Enum.FormFactor.Custom
  234. obj38.CanCollide = false
  235. obj38.TopSurface = Enum.SurfaceType.Smooth
  236. obj38.BottomSurface = Enum.SurfaceType.Smooth
  237. obj38.Size = Vector3.new(0.209999874, 0.200000003, 0.200000003)
  238. obj38.BrickColor = BrickColor.new("Institutional white")
  239. obj38.Friction = 0.30000001192093
  240. obj38.Shape = Enum.PartType.Block
  241. obj38.Name = "RE"
  242. obj38.Parent = obj35
  243.  
  244. -- 39 - Ears
  245. obj39 = Instance.new("Model")
  246. obj39.Name = "Ears"
  247. obj39.Parent = obj1
  248.  
  249. -- 40 - Ear1
  250. obj40 = Instance.new("WedgePart")
  251. obj40.CFrame = CFrame.new(Vector3.new(-1.45000505, 2.00999308, -0.360121965)) * CFrame.Angles(-3.1415922641754, 0, 3.141592502594)
  252. obj40.FormFactor = Enum.FormFactor.Custom
  253. obj40.CanCollide = false
  254. obj40.TopSurface = Enum.SurfaceType.Smooth
  255. obj40.Size = Vector3.new(0.200000003, 0.200000003, 0.399999976)
  256. obj40.BrickColor = BrickColor.new("Light reddish violet")
  257. obj40.Friction = 0.30000001192093
  258. obj40.Name = "Ear1"
  259. obj40.Parent = obj39
  260.  
  261. -- 41 - Ear2
  262. obj41 = Instance.new("WedgePart")
  263. obj41.CFrame = CFrame.new(Vector3.new(-1.45000494, 2.00999308, 0.379959613)) * CFrame.Angles(-0, 0, -0)
  264. obj41.FormFactor = Enum.FormFactor.Custom
  265. obj41.CanCollide = false
  266. obj41.TopSurface = Enum.SurfaceType.Smooth
  267. obj41.Size = Vector3.new(0.200000003, 0.200000003, 0.399999976)
  268. obj41.BrickColor = BrickColor.new("Light reddish violet")
  269. obj41.Friction = 0.30000001192093
  270. obj41.Name = "Ear2"
  271. obj41.Parent = obj39
  272.  
  273. -- 42 - Mouth
  274. obj42 = Instance.new("Model")
  275. obj42.Name = "Mouth"
  276. obj42.Parent = obj1
  277.  
  278. -- 43 - Nostril
  279. obj43 = Instance.new("Part")
  280. obj43.CFrame = CFrame.new(Vector3.new(-1.87000501, 1.419994, 0.14498952)) * CFrame.Angles(0, 1.5707963705063, 0)
  281. obj43.FormFactor = Enum.FormFactor.Custom
  282. obj43.CanCollide = false
  283. obj43.TopSurface = Enum.SurfaceType.Smooth
  284. obj43.BottomSurface = Enum.SurfaceType.Smooth
  285. obj43.Size = Vector3.new(0.209999874, 0.200000003, 0.400000036)
  286. obj43.BrickColor = BrickColor.new("Really black")
  287. obj43.Friction = 0.30000001192093
  288. obj43.Shape = Enum.PartType.Block
  289. obj43.Name = "Nostril"
  290. obj43.Parent = obj42
  291.  
  292. -- 44 - Mesh
  293. obj44 = Instance.new("BlockMesh")
  294. obj44.Scale = Vector3.new(0.699999988, 0.699999988, 1)
  295. obj44.Parent = obj43
  296.  
  297. -- 45 - Nose
  298. obj45 = Instance.new("Part")
  299. obj45.CFrame = CFrame.new(Vector3.new(-1.8400048, 1.31499505, -0.00503489375)) * CFrame.Angles(0, 1.5707963705063, 0)
  300. obj45.FormFactor = Enum.FormFactor.Custom
  301. obj45.CanCollide = false
  302. obj45.TopSurface = Enum.SurfaceType.Smooth
  303. obj45.BottomSurface = Enum.SurfaceType.Smooth
  304. obj45.Size = Vector3.new(0.709999859, 0.530000031, 0.400000036)
  305. obj45.BrickColor = BrickColor.new("Light reddish violet")
  306. obj45.Friction = 0.30000001192093
  307. obj45.Shape = Enum.PartType.Block
  308. obj45.Name = "Nose"
  309. obj45.Parent = obj42
  310.  
  311. -- 46 - Nostril2
  312. obj46 = Instance.new("Part")
  313. obj46.CFrame = CFrame.new(Vector3.new(-1.87000501, 1.419994, -0.15502879)) * CFrame.Angles(0, 1.5707963705063, 0)
  314. obj46.FormFactor = Enum.FormFactor.Custom
  315. obj46.CanCollide = false
  316. obj46.TopSurface = Enum.SurfaceType.Smooth
  317. obj46.BottomSurface = Enum.SurfaceType.Smooth
  318. obj46.Size = Vector3.new(0.209999874, 0.200000003, 0.400000036)
  319. obj46.BrickColor = BrickColor.new("Really black")
  320. obj46.Friction = 0.30000001192093
  321. obj46.Shape = Enum.PartType.Block
  322. obj46.Name = "Nostril2"
  323. obj46.Parent = obj42
  324.  
  325. -- 47 - Mesh
  326. obj47 = Instance.new("BlockMesh")
  327. obj47.Scale = Vector3.new(0.699999988, 0.699999988, 1)
  328. obj47.Parent = obj46
  329.  
  330. -- 48 - Tail
  331. obj48 = Instance.new("Part")
  332. obj48.CFrame = CFrame.new(Vector3.new(1.48999596, 1.48499393, 0.0250096489)) * CFrame.Angles(0, 1.5707963705063, 0)
  333. obj48.FormFactor = Enum.FormFactor.Custom
  334. obj48.CanCollide = false
  335. obj48.TopSurface = Enum.SurfaceType.Smooth
  336. obj48.FrontSurface = Enum.SurfaceType.Smooth
  337. obj48.BottomSurface = Enum.SurfaceType.Smooth
  338. obj48.Size = Vector3.new(0.329999983, 0.310000002, 1)
  339. obj48.BrickColor = BrickColor.new("Light reddish violet")
  340. obj48.Friction = 0.30000001192093
  341. obj48.Shape = Enum.PartType.Block
  342. obj48.Name = "Tail"
  343. obj48.Parent = obj1
  344.  
  345. -- 49 - FakeHead
  346. obj49 = Instance.new("Part")
  347. obj49.CFrame = CFrame.new(Vector3.new(-1.15000498, 1.40999508, 0.0099644959)) * CFrame.Angles(0, 1.5707963705063, 0)
  348. obj49.FormFactor = Enum.FormFactor.Custom
  349. obj49.CanCollide = false
  350. obj49.TopSurface = Enum.SurfaceType.Smooth
  351. obj49.BottomSurface = Enum.SurfaceType.Smooth
  352. obj49.Size = Vector3.new(1.13999987, 1, 1)
  353. obj49.BrickColor = BrickColor.new("Light reddish violet")
  354. obj49.Friction = 0.30000001192093
  355. obj49.Shape = Enum.PartType.Block
  356. obj49.Name = "FakeHead"
  357. obj49.Parent = obj1
  358.  
  359.  
  360.  
  361. -- 59 - Hooves
  362. obj59 = Instance.new("Model")
  363. obj59.Name = "Hooves"
  364. obj59.Parent = obj1
  365.  
  366. -- 60 - LLPart
  367. obj60 = Instance.new("Part")
  368. obj60.CFrame = CFrame.new(Vector3.new(1.48999703, 0.129996926, 0.409985095)) * CFrame.Angles(0, 1.5707963705063, 0)
  369. obj60.FormFactor = Enum.FormFactor.Custom
  370. obj60.CanCollide = false
  371. obj60.TopSurface = Enum.SurfaceType.Smooth
  372. obj60.BottomSurface = Enum.SurfaceType.Smooth
  373. obj60.Size = Vector3.new(0.399999976, 0.200000003, 0.599999964)
  374. obj60.BrickColor = BrickColor.new("Black")
  375. obj60.Friction = 0.30000001192093
  376. obj60.Shape = Enum.PartType.Block
  377. obj60.Name = "LLPart"
  378. obj60.Parent = obj59
  379.  
  380. -- 61 - LAPart
  381. obj61 = Instance.new("Part")
  382. obj61.CFrame = CFrame.new(Vector3.new(-0.350002944, 0.129996926, 0.409985095)) * CFrame.Angles(0, 1.5707963705063, 0)
  383. obj61.FormFactor = Enum.FormFactor.Custom
  384. obj61.CanCollide = false
  385. obj61.TopSurface = Enum.SurfaceType.Smooth
  386. obj61.BottomSurface = Enum.SurfaceType.Smooth
  387. obj61.Size = Vector3.new(0.399999976, 0.200000003, 0.599999964)
  388. obj61.BrickColor = BrickColor.new("Black")
  389. obj61.Friction = 0.30000001192093
  390. obj61.Shape = Enum.PartType.Block
  391. obj61.Name = "LAPart"
  392. obj61.Parent = obj59
  393.  
  394. -- 62 - RAPart
  395. obj62 = Instance.new("Part")
  396. obj62.CFrame = CFrame.new(Vector3.new(-0.350002944, 0.129996926, -0.389998883)) * CFrame.Angles(0, 1.5707963705063, 0)
  397. obj62.FormFactor = Enum.FormFactor.Custom
  398. obj62.CanCollide = false
  399. obj62.TopSurface = Enum.SurfaceType.Smooth
  400. obj62.BottomSurface = Enum.SurfaceType.Smooth
  401. obj62.Size = Vector3.new(0.399999976, 0.200000003, 0.599999964)
  402. obj62.BrickColor = BrickColor.new("Black")
  403. obj62.Friction = 0.30000001192093
  404. obj62.Shape = Enum.PartType.Block
  405. obj62.Name = "RAPart"
  406. obj62.Parent = obj59
  407.  
  408. -- 63 - RLPart
  409. obj63 = Instance.new("Part")
  410. obj63.CFrame = CFrame.new(Vector3.new(1.48999703, 0.129996926, -0.389998883)) * CFrame.Angles(0, 1.5707963705063, 0)
  411. obj63.FormFactor = Enum.FormFactor.Custom
  412. obj63.CanCollide = false
  413. obj63.TopSurface = Enum.SurfaceType.Smooth
  414. obj63.BottomSurface = Enum.SurfaceType.Smooth
  415. obj63.Size = Vector3.new(0.399999976, 0.200000003, 0.599999964)
  416. obj63.BrickColor = BrickColor.new("Black")
  417. obj63.Friction = 0.30000001192093
  418. obj63.Shape = Enum.PartType.Block
  419. obj63.Name = "RLPart"
  420. obj63.Parent = obj59
  421.  
  422.  
  423. -- Welds and Finalization
  424.  
  425.  
  426. -- 3 - Motor6D
  427. obj3 = Instance.new("Motor6D")
  428. obj3.Part0 = obj2
  429. obj3.Part1 = obj36
  430. obj3.Parent = obj2
  431. Weld(obj3);
  432.  
  433. -- 4 - Motor6D
  434. obj4 = Instance.new("Motor6D")
  435. obj4.Part0 = obj2
  436. obj4.Part1 = obj38
  437. obj4.Parent = obj2
  438. Weld(obj4);
  439.  
  440. -- 5 - Motor6D
  441. obj5 = Instance.new("Motor6D")
  442. obj5.Part0 = obj2
  443. obj5.Part1 = obj43
  444. obj5.Parent = obj2
  445. Weld(obj5);
  446.  
  447. -- 6 - Motor6D
  448. obj6 = Instance.new("Motor6D")
  449. obj6.Part0 = obj2
  450. obj6.Part1 = obj45
  451. obj6.Parent = obj2
  452. Weld(obj6);
  453.  
  454.  
  455. -- 7 - Motor6D
  456. obj7 = Instance.new("Motor6D")
  457. obj7.Part0 = obj2
  458. obj7.Part1 = obj46
  459. obj7.Parent = obj2
  460. Weld(obj7);
  461.  
  462.  
  463. -- 8 - Motor6D
  464. obj8 = Instance.new("Motor6D")
  465. obj8.Part0 = obj2
  466. obj8.Part1 = obj32
  467. obj8.Parent = obj2
  468. Weld(obj8);
  469.  
  470.  
  471. -- 9 - Motor6D
  472. obj9 = Instance.new("Motor6D")
  473. obj9.Part0 = obj2
  474. obj9.Part1 = obj34
  475. obj9.Parent = obj2
  476. Weld(obj9);
  477.  
  478.  
  479. -- 10 - Motor6D
  480. obj10 = Instance.new("Motor6D")
  481. obj10.Part0 = obj2
  482. obj10.Part1 = obj40
  483. obj10.Parent = obj2
  484. Weld(obj10);
  485.  
  486.  
  487. -- 11 - Motor6D
  488. obj11 = Instance.new("Motor6D")
  489. obj11.Part0 = obj2
  490. obj11.Part1 = obj41
  491. obj11.Parent = obj2
  492. Weld(obj11);
  493.  
  494.  
  495. -- 12 - Motor6D
  496. obj12 = Instance.new("Motor6D")
  497. obj12.Part0 = obj2
  498. obj12.Part1 = obj49
  499. obj12.Parent = obj2
  500. Weld(obj12);
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507. -- 17 - Right Hip
  508. obj17 = Instance.new("Motor6D")
  509. obj17.Part0 = obj13
  510. obj17.Part1 = obj23
  511. obj17.Name = "Right Hip"
  512. obj17.Parent = obj13
  513. Weld(obj17);
  514.  
  515.  
  516. -- 18 - Right Shoulder
  517. obj18 = Instance.new("Motor6D")
  518. obj18.Part0 = obj13
  519. obj18.Part1 = obj27
  520. obj18.Name = "Right Shoulder"
  521. obj18.Parent = obj13
  522. Weld(obj18);
  523.  
  524.  
  525. -- 19 - Left Hip
  526. obj19 = Instance.new("Motor6D")
  527. obj19.Part0 = obj13
  528. obj19.Part1 = obj25
  529. obj19.Name = "Left Hip"
  530. obj19.Parent = obj13
  531. Weld(obj19);
  532.  
  533.  
  534. -- 20 - Left Shoulder
  535. obj20 = Instance.new("Motor6D")
  536. obj20.Part0 = obj13
  537. obj20.Part1 = obj29
  538. obj20.Name = "Left Shoulder"
  539. obj20.Parent = obj13
  540. Weld(obj20);
  541.  
  542.  
  543. -- 21 - Neck
  544. obj21 = Instance.new("Motor6D")
  545. obj21.Part0 = obj13
  546. obj21.Part1 = obj2
  547. obj21.Name = "Neck"
  548. obj21.Parent = obj13
  549. Weld(obj21);
  550.  
  551.  
  552. -- 22 - TailWeld
  553. obj22 = Instance.new("Motor6D")
  554. obj22.Part0 = obj13
  555. obj22.Part1 = obj48
  556. obj22.Name = "TailWeld"
  557. obj22.Parent = obj13
  558. Weld(obj22);
  559.  
  560.  
  561.  
  562. -- 24 - Motor6D
  563. obj24 = Instance.new("Motor6D")
  564. obj24.Part0 = obj23
  565. obj24.Part1 = obj63
  566. obj24.Parent = obj23
  567. Weld(obj24);
  568.  
  569.  
  570.  
  571. -- 26 - Motor6D
  572. obj26 = Instance.new("Motor6D")
  573. obj26.Part0 = obj25
  574. obj26.Part1 = obj60
  575. obj26.Parent = obj25
  576. Weld(obj26);
  577.  
  578.  
  579.  
  580.  
  581.  
  582. -- 28 - Motor6D
  583. obj28 = Instance.new("Motor6D")
  584. obj28.Part0 = obj27
  585. obj28.Part1 = obj62
  586. obj28.Parent = obj27
  587. Weld(obj28);
  588.  
  589.  
  590.  
  591. -- 30 - Motor6D
  592. obj30 = Instance.new("Motor6D")
  593. obj30.Part0 = obj29
  594. obj30.Part1 = obj61
  595. obj30.Parent = obj29
  596. Weld(obj30);
  597.  
  598.  
  599.  
  600.  
  601. local Oink = Instance.new("Sound",obj13);
  602. Oink.Name = "Oink";
  603. Oink.Volume = 1;
  604. Oink.SoundId = "rbxassetid://245763014";
  605.  
  606. local Step = Instance.new("Sound",obj13);
  607. Step.Name = "Step";
  608. Step.Volume = 0.5;
  609.  
  610.  
  611.  
  612.  
  613. local Humanoid = Instance.new("Humanoid",obj1);
  614.  
  615. scan(obj1);
  616.  
  617. return obj1;
  618. end
  619.  
  620. PigClient = [==[
  621. wait();
  622.  
  623. local pig = script.Parent;
  624.  
  625. local hrp = pig:WaitForChild("HumanoidRootPart");
  626. hrp.RootJoint.C0 = hrp.RootJoint.C0*CFrame.new(0,.5,0);
  627.  
  628. local torso = pig:WaitForChild("Torso");
  629.  
  630. pig.DescendantAdded:connect(function(o)
  631.   if o:isA("Weld") or o:isA("Motor6D") or o:isA("Weld") then o:Destroy() end
  632. end)
  633.  
  634. local head = pig:WaitForChild("Head");
  635.  
  636.  
  637.  
  638.  
  639. FootSteps = {
  640.         [1] = {"185700502","185700484","185700458","185700448","185700432"},
  641.         [2] = {"187263007","187263016","187263022","187263000","187262992"},
  642.         [4] = {"187263007","187263016","187263022","187263000","187262992"},
  643.  
  644. }
  645.  
  646.  
  647.  
  648.  
  649. Fur = {}
  650. for _,v in pairs(pig:GetChildren()) do
  651.    if v:isA("BasePart") and (v.BrickColor.name:match("violet")) then
  652.      Fur[#Fur+1]={v,v.BrickColor.name};
  653.    end
  654. end
  655.  
  656.  
  657. local Sound = torso.Oink;
  658. local Terror = Sound:clone();
  659. Terror.Name = "Terror";
  660. Terror.Volume = .5;
  661. Terror.Parent = torso;
  662. Terror.SoundId = "http://roblox.com/asset?id=171412824";
  663.  
  664.  
  665. local Step = torso.Step;
  666.  
  667.  
  668.  
  669. local rs = torso["Right Shoulder"];
  670. local ls = torso["Left Shoulder"];
  671. local rh = torso["Right Hip"];
  672. local lh = torso["Left Hip"];
  673. local neck = torso["Neck"];
  674. freq = 12;
  675. rsc0 = rs.C0;
  676. lsc0 = ls.C0;
  677. rhc0 = rh.C0;
  678. lhc0 = lh.C0;
  679. neckc0 = neck.C0;
  680.  
  681. local Eyes = {};
  682. for _,v in pairs(pig:GetChildren()) do
  683.         if v.Name:match("Eye") then
  684.                 Eyes[#Eyes+1]=v;
  685.         end
  686. end
  687.  
  688. humanoid = pig:WaitForChild("Humanoid");
  689.  
  690. local rst = game:GetService("RunService").RenderStepped;
  691.  
  692. local player = game:GetService("Players").LocalPlayer;
  693. local mouse = player:GetMouse();
  694.  
  695.  
  696. local neckangle = 0;
  697. local walkspeed = 1;
  698. function clamp(v,mi,ma)
  699.         if v<mi then return mi elseif v>ma then return ma else return v; end
  700. end
  701. function stationary()
  702.         rh:SetDesiredAngle(lockedrh or 0);
  703.         rs:SetDesiredAngle(lockedrs or 0);
  704.         lh:SetDesiredAngle(lockedlh or 0);
  705.         ls:SetDesiredAngle(lockedls or 0);
  706. end
  707. local Ignore = {[1]=pig}
  708.  
  709. FollowCamera = false;
  710.  
  711.  
  712.  
  713.  local function Peck(number)
  714.         Pecking = true;
  715.         n = number or math.random(1,2);
  716.         if n == 1 then
  717.                 for i = 0, 50, 25 do
  718.                         neck.DesiredAngle = math.rad(i)
  719.                         wait(0.03)
  720.                 end
  721.                 for i = 50, 0, -25 do
  722.                         neck.DesiredAngle = math.rad(i)
  723.                         wait(0.03)
  724.                 end
  725.         end
  726.         Pecking = false;
  727. end
  728.  
  729.  
  730.  
  731.  
  732.  
  733. mouse.KeyDown:connect(function(k)
  734.         if k == "r" and not randeb then
  735.                 randeb = true;
  736.                 ran = 0;
  737.                 wait(.5);
  738.                 randeb = false;
  739.         end
  740.         if k == "k" then
  741.            FollowCamera = not FollowCamera;
  742.         end
  743.         if k == "e" and not Pecking then
  744.                 Peck(1);
  745.         end
  746.         if k == "\48" then
  747.            walkspeed =  2;
  748.            freq = 18;
  749.            humanoid.WalkSpeed = 32;
  750.         end
  751. end)
  752. mouse.KeyUp:connect(function(k)
  753.         if k == "\48" then
  754.            freq = 12;
  755.            walkspeed = 1;
  756.            humanoid.WalkSpeed = 12;
  757.         end
  758. end)
  759.  
  760.  
  761.  
  762. ran = 5;
  763. ranblink = 5;
  764. LastCheck = 0;
  765. LastBlinkCheck = 0;
  766. LastRunCheck = 0;
  767.  
  768. local asin = math.asin;
  769. local abs = math.abs;
  770. local headoriginal = neck.C0;
  771.  
  772.  
  773.  
  774.  
  775.  
  776. camera = Workspace.CurrentCamera;
  777. local neckc0 = neck.C0;
  778. local neckc1 = neck.C1;
  779. while true do
  780.    rst:wait();
  781.  
  782.  
  783.    local time = Workspace.DistributedGameTime;
  784.  
  785.    if FollowCamera then
  786.      torso.CFrame=CFrame.new(torso.Position,torso.Position+camera.CoordinateFrame.lookVector*Vector3.new(10,0,10))
  787.    end
  788.  
  789.  
  790.    local MouseX = mouse.X;
  791.    local MouseY = mouse.Y;
  792.    local d = torso.CFrame:pointToObjectSpace(mouse.UnitRay.Origin+mouse.UnitRay.Direction.unit*100);
  793.    local mouseX = asin(((MouseX/mouse.ViewSizeX)-1));
  794.    local mouseY =  asin(-d.unit.Y);
  795.    local mouseYP = asin(((MouseY/mouse.ViewSizeY)-0.5)*2);
  796.    local angleY = -mouseY -- clamp(-mouseY,-1.3,2.05);
  797.    local angleYP = -mouseYP
  798.    local angleX = -(mouseX) -- clamp(-mouseX,-1.5,1.5);
  799.    local HeadY = clamp(angleY,-0.2,0.8);
  800.    local HeadYPassive = clamp(angleYP,-0.5,.1);
  801.  
  802.    neck.C0 = neckc0*CFrame.Angles(0,angleX-.5,-HeadYPassive)
  803.    
  804.    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
  805.  
  806.     if torso.Velocity.magnitude >= 2 then Walking = true
  807.    
  808.     local sin = math.sin(time*(freq))/10;
  809.     local desangle = 1.1 * sin;
  810.     rh.DesiredAngle = lockedrh or -desangle
  811.     rs.DesiredAngle = lockedrs or -desangle  
  812.  
  813.     lh.DesiredAngle = lockedlh or desangle;
  814.     ls.DesiredAngle = lockedls or desangle;
  815.  
  816.    else
  817.    Walking = false;
  818.     rh:SetDesiredAngle(lockedrh or 0);
  819.     rs:SetDesiredAngle(lockedrs or 0);
  820.     lh:SetDesiredAngle(lockedlh or 0);
  821.     ls:SetDesiredAngle(lockedls or 0);
  822.    end
  823.  
  824.  
  825.  
  826.  
  827.  
  828.    
  829.    neck.MaxVelocity = 0.05;
  830.    ls.MaxVelocity = 0.04*walkspeed;
  831.    rs.MaxVelocity = 0.04*walkspeed;
  832.    lh.MaxVelocity = 0.04*walkspeed;
  833.    rh.MaxVelocity = 0.04*walkspeed;
  834.  
  835.    if Workspace.DistributedGameTime-LastBlinkCheck >= ranblink then
  836.           LastBlinkCheck = Workspace.DistributedGameTime
  837.           ranblink = math.random(3,8);
  838.           for _,v in pairs(Eyes) do
  839.                  v.REPart.Mesh.Scale = Vector3.new(0.5, 0.1, 1.2);
  840.           end
  841.           wait(.1)
  842.           for _,v in pairs(Eyes) do
  843.                  v.REPart.Mesh.Scale = Vector3.new(0.5, 0.5, 1.2);
  844.           end
  845.    end
  846.    if Workspace.DistributedGameTime-LastRunCheck >= .5/walkspeed and Walking then
  847.           LastRunCheck = Workspace.DistributedGameTime;
  848.           Step.SoundId = "http://roblox.com/asset?id="..FootSteps[walkspeed][math.random(1,5)];
  849.       Step:Play();
  850.    end
  851.    if Workspace.DistributedGameTime-LastCheck >= ran then
  852.           Sound.Pitch = math.random(80,120)/100;
  853.           wait();
  854.           Sound:Play();
  855.           LastCheck = Workspace.DistributedGameTime;
  856.           ran = math.random(5,15);
  857.    end
  858.    end
  859. end    
  860. ]==]
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867. function MakePlayerPig(player)
  868.    if Workspace:FindFirstChild("Com") or NLS then
  869.    local pig = SpawnPig();
  870.    pig.Parent = Workspace;
  871.    pig:MakeJoints();
  872.    pig:TranslateBy(Vector3.new(150/3,5,150/3)-pig:GetModelCFrame().p)
  873.    Workspace.CurrentCamera.CameraSubject = pig.Humanoid;
  874.    
  875.    local ch = player.Character;
  876.    ch.Humanoid:Destroy();
  877.    wait(.5);
  878.    for _,v in pairs(ch:GetChildren()) do
  879.       v:Destroy();
  880.    end
  881.    for _,v in pairs(pig:GetChildren()) do
  882.      v.Parent = ch;
  883.    end
  884.     if not NLS then Workspace.Com:FireServer(PigClient,ch,"NLS"); else NLS(PigClient,ch) end
  885.    end
  886. end
  887.  
  888. MakePlayerPig(game.Players.LocalPlayer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement