Advertisement
pklo

Untitled

Mar 6th, 2016
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.75 KB | None | 0 0
  1.  
  2. function Part(P, Anch, Coll, Tran, Ref, Col, X, Y, Z)
  3. local p = Instance.new("Part")
  4. p.TopSurface = 0
  5. p.BottomSurface = 0
  6. p.Transparency = Tran
  7. p.Reflectance = Ref
  8. p.CanCollide = Coll
  9. p.Anchored = Anch
  10. p.BrickColor = BrickColor.new(Col)
  11. p.formFactor = "Custom"
  12. p.Size = Vector3.new(X,Y,Z)
  13. p.Parent = P
  14. p.Locked = true
  15. p:BreakJoints()
  16. return p
  17. end
  18.  
  19. function Weld(P0, P1, X, Y, Z, A, B, C)
  20. local w = Instance.new("Weld")
  21. w.Part0 = P0
  22. w.Part1 = P1
  23. w.C1 = CN(X, Y, Z) * CA(A, B, C)
  24. w.Parent = P0
  25. return w
  26. end
  27.  
  28. CA = CFrame.Angles
  29. CN = CFrame.new
  30. V3 = Vector3.new
  31. MR = math.rad
  32. MP = math.pi
  33. MRA = math.random
  34. MH = math.huge
  35.  
  36. Asset = "http://www.roblox.com/asset/?id="
  37. Noob = nil
  38.  
  39. function MakeMotor(torso, p1, c0, c1)
  40. local mot = Instance.new("Motor6D")
  41. mot.C0 = c0
  42. mot.C1 = c1
  43. mot.Part0 = torso
  44. mot.Part1 = p1
  45. mot.Parent = torso
  46. return mot
  47. end
  48.  
  49. function Set(tab)
  50. for _,v in pairs(tab) do
  51. local motor = v[1]
  52. local vel = v[2]
  53. local des = v[3]
  54. motor.MaxVelocity = vel
  55. motor.DesiredAngle = des
  56. end
  57. end
  58.  
  59. function Animate(Hum, RSH, LSH, RH, LH)
  60. local pose = "Standing"
  61. local function sit()
  62. pose = "Seated"
  63. end
  64. local function jump()
  65. pose = "Jumping"
  66. end
  67. local function died()
  68. pose = "Dead"
  69. end
  70. local function falling()
  71. pose = "Falling"
  72. end
  73. local function climbing()
  74. pose = "Climbing"
  75. end
  76. local function run(speed)
  77. if speed > 0.5 then
  78. pose = "Running"
  79. else
  80. pose = "Standing"
  81. end
  82. end
  83. local function move(tiem)
  84. local amplitude, frequency
  85. if pose == "Seated" then
  86. Set({{RSH, 0.15, math.pi/2}, {LSH, 0.15, -math.pi/2}, {LH, 0.15, math.pi/2}, {RH, 0.15, -math.pi/2}})
  87. return
  88. end
  89. if pose == "Jumping" then
  90. Set({{RSH, 0.3, math.pi}, {LSH, 0.3, -math.pi}, {LH, 0.3, 0}, {RH, 0.3, 0}})
  91. return
  92. end
  93. if pose == "Falling" then
  94. Set({{RSH, 0.35, math.pi}, {LSH, 0.35, -math.pi}, {LH, 0.35, 0}, {RH, 0.35, 0}})
  95. return
  96. end
  97. local climb = 0
  98. if pose == "Running" then
  99. RSH.MaxVelocity = 0.15
  100. LSH.MaxVelocity = 0.15
  101. amplitude = 1
  102. frequency = 8
  103. elseif pose == "Climbing" then
  104. RSH.MaxVelocity = 0.3
  105. LSH.MaxVelocity = 0.3
  106. amplitude = 1
  107. frequency = 8
  108. climb = math.pi
  109. else
  110. amplitude = 0.1
  111. frequency = 1
  112. end
  113. des = amplitude * math.sin(tiem*frequency)
  114. RSH.DesiredAngle = des + climb
  115. LSH.DesiredAngle = des - climb
  116. RH.DesiredAngle = -des
  117. LH.DesiredAngle = -des
  118. end
  119. Hum.Jumping:connect(jump)
  120. Hum.Running:connect(run)
  121. Hum.Seated:connect(sit)
  122. Hum.Died:connect(died)
  123. Hum.FreeFalling:connect(falling)
  124. Hum.Climbing:connect(climbing)
  125. coroutine.resume(coroutine.create(function()
  126. while pose ~= "Dead" do
  127. local _, time = wait(0.1)
  128. move(time)
  129. end
  130. end))
  131. end
  132.  
  133. function MakeNoob(pos, scale)
  134. local Nub = Instance.new("Model")
  135. Nub.Name = "Narb"
  136. Noob = Nub
  137. local Torso = Part(Nub, false, false, 0, 0, "Bright blue", 2*scale, 2*scale, 1*scale)
  138. Torso.Name = "Torso"
  139. local Head = Part(Nub, false, false, 0, 0, "Bright yellow", 2*scale, 1*scale, 1*scale)
  140. Head.Name = "Head"
  141. local Neck = MakeMotor(Torso, Head, CN(0, 1*scale, 0), CN(0, -0.5*scale, 0))
  142. local HeadMesh = Instance.new("SpecialMesh",Head)
  143. HeadMesh.Scale = V3(1.25, 1.25, 1.25)
  144. local Face = Instance.new("Decal",Head)
  145. Face.Face = "Front"
  146. Face.Texture = Asset..(13038247)
  147. local Rarm = Part(Nub, false, false, 0, 0, "Bright yellow", 1*scale, 2*scale, 1*scale)
  148. Rarm.Name = "Right Arm"
  149. local Larm = Part(Nub, false, false, 0, 0, "Bright yellow", 1*scale, 2*scale, 1*scale)
  150. Larm.Name = "Left Arm"
  151. local Rleg = Part(Nub, false, false, 0, 0, "Br. yellowish green", 1*scale, 2*scale, 1*scale)
  152. Rleg.Name = "Right Leg"
  153. local Lleg = Part(Nub, false, false, 0, 0, "Br. yellowish green", 1*scale, 2*scale, 1*scale)
  154. Lleg.Name = "Left Leg"
  155. local RSH = MakeMotor(Torso, Rarm, CN(1*scale, 0.5*scale, 0) * CA(0, MR(90), 0), CN(-0.5*scale, 0.5*scale, 0) * CA(0, MR(90), 0))
  156. local LSH = MakeMotor(Torso, Larm, CN(-1*scale, 0.5*scale, 0) * CA(0, MR(-90), 0), CN(0.5*scale, 0.5*scale, 0) * CA(0, MR(-90), 0))
  157. local RH = MakeMotor(Torso, Rleg, CN(0.5*scale, -1*scale, 0) * CA(0, MR(-90), 0), CN(0, 1*scale, 0) * CA(0, MR(-90), 0))
  158. local LH = MakeMotor(Torso, Lleg, CN(-0.5*scale, -1*scale, 0) * CA(0, MR(90), 0), CN(0, 1*scale, 0) * CA(0, MR(90), 0))
  159. local Hum = Instance.new("Humanoid")
  160. Hum.MaxHealth = 40+(scale*60)
  161. Hum.Health = Hum.MaxHealth
  162. coroutine.resume(coroutine.create(function(Humanoid)
  163. wait(1)
  164. Humanoid.Health=Humanoid.MaxHealth
  165. Humanoid:TakeDamage(1)
  166. end),Hum)
  167. Hum.Parent = Nub
  168. Nub.Parent = workspace
  169. Nub:MakeJoints()
  170. Nub:MoveTo(pos)
  171. Animate(Hum,RSH,LSH,RH,LH)
  172. Hum.Died:connect(function()
  173. Hum.Parent=nil
  174.  
  175. Torsoie=Torso
  176. local Headeh = Head
  177. if Headeh then
  178. -- if math.random(1,5)~=1 then
  179. local Neckeh = Instance.new("Weld")
  180. Neckeh.Name = "Neck"
  181. Neckeh.Part0 = Torsoie
  182. Neckeh.Part1 = Headeh
  183. Neckeh.C0 = CFrame.new(0, 1.5*scale, 0)
  184. Neckeh.C1 = CFrame.new()
  185. Neckeh.Parent = Torsoie
  186. -- end
  187. end
  188. local Limb = Rarm
  189. if Limb then
  190.  
  191. Limb.CFrame = Torsoie.CFrame * CFrame.new(1.5, 0, 0)
  192. local Joint = Instance.new("Glue")
  193. Joint.Name = "RightShoulder"
  194. Joint.Part0 = Torsoie
  195. Joint.Part1 = Limb
  196. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  197. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  198. Joint.Parent = Torsoie
  199.  
  200. local B = Instance.new("Part")
  201. B.TopSurface = 0
  202. B.BottomSurface = 0
  203. B.formFactor = "Symmetric"
  204. B.Size = Vector3.new(1, 1, 1)
  205. B.Transparency = 1
  206. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  207. B.Parent = Nub
  208. local W = Instance.new("Weld")
  209. W.Part0 = Limb
  210. W.Part1 = B
  211. W.C0 = CFrame.new(0, -0.5, 0)
  212. W.Parent = Limb
  213.  
  214. end
  215. local Limb = Larm
  216. if Limb then
  217.  
  218. Limb.CFrame = Torsoie.CFrame * CFrame.new(-1.5, 0, 0)
  219. local Joint = Instance.new("Glue")
  220. Joint.Name = "LeftShoulder"
  221. Joint.Part0 = Torsoie
  222. Joint.Part1 = Limb
  223. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  224. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  225. Joint.Parent = Torsoie
  226.  
  227. local B = Instance.new("Part")
  228. B.TopSurface = 0
  229. B.BottomSurface = 0
  230. B.formFactor = "Symmetric"
  231. B.Size = Vector3.new(1, 1, 1)
  232. B.Transparency = 1
  233. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  234. B.Parent = Nub
  235. local W = Instance.new("Weld")
  236. W.Part0 = Limb
  237. W.Part1 = B
  238. W.C0 = CFrame.new(0, -0.5, 0)
  239. W.Parent = Limb
  240.  
  241. end
  242. local Limb = Rleg
  243. if Limb then
  244.  
  245. Limb.CFrame = Torsoie.CFrame * CFrame.new(0.5, -2, 0)
  246. local Joint = Instance.new("Glue")
  247. Joint.Name = "RightHip"
  248. Joint.Part0 = Torsoie
  249. Joint.Part1 = Limb
  250. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  251. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  252. Joint.Parent = Torsoie
  253.  
  254. local B = Instance.new("Part")
  255. B.TopSurface = 0
  256. B.BottomSurface = 0
  257. B.formFactor = "Symmetric"
  258. B.Size = Vector3.new(1, 1, 1)
  259. B.Transparency = 1
  260. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  261. B.Parent = Nub
  262. local W = Instance.new("Weld")
  263. W.Part0 = Limb
  264. W.Part1 = B
  265. W.C0 = CFrame.new(0, -0.5, 0)
  266. W.Parent = Limb
  267.  
  268. end
  269. local Limb = Lleg
  270. if Limb then
  271.  
  272. Limb.CFrame = Torsoie.CFrame * CFrame.new(-0.5, -2, 0)
  273. local Joint = Instance.new("Glue")
  274. Joint.Name = "LeftHip"
  275. Joint.Part0 = Torsoie
  276. Joint.Part1 = Limb
  277. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  278. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  279. Joint.Parent = Torsoie
  280.  
  281. local B = Instance.new("Part")
  282. B.TopSurface = 0
  283. B.BottomSurface = 0
  284. B.formFactor = "Symmetric"
  285. B.Size = Vector3.new(1, 1, 1)
  286. B.Transparency = 1
  287. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  288. B.Parent = Nub
  289. local W = Instance.new("Weld")
  290. W.Part0 = Limb
  291. W.Part1 = B
  292. W.C0 = CFrame.new(0, -0.5, 0)
  293. W.Parent = Limb
  294.  
  295. end
  296.  
  297. wait(6)
  298. Nub.Parent=nil
  299. wait(4)
  300. MakeNoob(pos, scale)
  301. end)
  302. return Nub
  303. end
  304. for i = 1, 11 do
  305. local nub = MakeNoob(V3(MRA(-40, 40),10,MRA(-40, 40)), 1)
  306. end
  307. -- mediafire
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement