Advertisement
memberhero

Untitled

May 5th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.84 KB | None | 0 0
  1. math.randomseed(tick())
  2.  
  3.  
  4.  
  5. Players_Met = {}
  6.  
  7. Target = nil
  8.  
  9. Tones = {
  10.  
  11. Enum.ChatColor.Blue,
  12.  
  13. Enum.ChatColor.Green,
  14.  
  15. Enum.ChatColor.Red,
  16.  
  17. }
  18.  
  19.  
  20.  
  21. Random_Thoughts = {
  22.  
  23. "Oh boy! Such a sunny day.",
  24.  
  25. "Lalalala..",
  26.  
  27. "Meh.",
  28.  
  29. "Hmm..",
  30.  
  31. }
  32.  
  33.  
  34.  
  35. Neutral_Answers = {
  36.  
  37. Hello = {
  38.  
  39. "Hi.",
  40.  
  41. "Hello.",
  42.  
  43. },
  44.  
  45. }
  46.  
  47. local Asset = "http://www.roblox.com/asset/?id="
  48.  
  49.  
  50.  
  51. Shirtss = {Asset.."48121909", Asset.."13563477", Asset.."7825492", Asset.."49299226", Asset.."49299226", Asset.."25813650", Asset.."7825464", Asset.."50629907", Asset.."44096838", Asset.."19423653", Asset.."45506671", Asset.."50629907", Asset.."50629907"}
  52.  
  53. Pantss = {Asset.."48121928", Asset.."13563502", Asset.."7825668", Asset.."30703758", Asset.."7825663", Asset.."19954576", Asset.."44097222", Asset.."19425981", Asset.."45506330", Asset.."19954576", Asset.."19954576"}
  54.  
  55. Names = {"Joe", "Mark", "Carl", "Homer", "Kyle", "Stan", "Clyde", "Mick", "Nick", "Rick", "Peter", "Bucky", "Greg", "Eric",
  56.  
  57. "Joel", "Kim", "Lenny", "Barney", "Aaron", "Allan", "Andrew", "Brian", "Chad", "Chris", "Daniel", "David",
  58.  
  59. "Edward",
  60.  
  61. }
  62.  
  63.  
  64.  
  65. function Part(P, Anch, Coll, Tran, Ref, Col, X, Y, Z)
  66.  
  67. local p = Instance.new("Part")
  68.  
  69. p.TopSurface = 0
  70.  
  71. p.BottomSurface = 0
  72.  
  73. p.Transparency = Tran
  74.  
  75. p.Reflectance = Ref
  76.  
  77. p.CanCollide = Coll
  78.  
  79. p.Anchored = Anch
  80.  
  81. p.BrickColor = BrickColor.new(Col)
  82.  
  83. p.formFactor = "Custom"
  84.  
  85. p.Size = Vector3.new(X,Y,Z)
  86.  
  87. p.Parent = P
  88.  
  89. p.Locked = true
  90.  
  91. p:BreakJoints()
  92.  
  93. return p
  94.  
  95. end
  96.  
  97.  
  98.  
  99. function Weld(P0, P1, X, Y, Z, A, B, C)
  100.  
  101. local w = Instance.new("Weld")
  102.  
  103. w.Part0 = P0
  104.  
  105. w.Part1 = P1
  106.  
  107. w.C1 = CN(X, Y, Z) * CA(A, B, C)
  108.  
  109. w.Parent = P0
  110.  
  111. return w
  112.  
  113. end
  114.  
  115.  
  116.  
  117. CA = CFrame.Angles
  118.  
  119. CN = CFrame.new
  120.  
  121. V3 = Vector3.new
  122.  
  123. MR = math.rad
  124.  
  125. MP = math.pi
  126.  
  127. MRA = math.random
  128.  
  129. MH = math.huge
  130.  
  131.  
  132.  
  133. Noob = nil
  134.  
  135.  
  136.  
  137. function MakeMotor(torso, p1, c0, c1)
  138.  
  139. local mot = Instance.new("Motor6D")
  140.  
  141. mot.C0 = c0
  142.  
  143. mot.C1 = c1
  144.  
  145. mot.Part0 = torso
  146.  
  147. mot.Part1 = p1
  148.  
  149. mot.Parent = torso
  150.  
  151. return mot
  152.  
  153. end
  154.  
  155.  
  156.  
  157. function Set(tab)
  158.  
  159. for _,v in pairs(tab) do
  160.  
  161. local motor = v[1]
  162.  
  163. local vel = v[2]
  164.  
  165. local des = v[3]
  166.  
  167. motor.MaxVelocity = vel
  168.  
  169. motor.DesiredAngle = des
  170.  
  171. end
  172.  
  173. end
  174.  
  175.  
  176.  
  177. function Animate(Hum, RSH, LSH, RH, LH)
  178.  
  179. local pose = "Standing"
  180.  
  181. local function sit()
  182.  
  183. pose = "Seated"
  184.  
  185. end
  186.  
  187. local function jump()
  188.  
  189. pose = "Jumping"
  190.  
  191. end
  192.  
  193. local function died()
  194.  
  195. pose = "Dead"
  196.  
  197. end
  198.  
  199. local function falling()
  200.  
  201. pose = "Falling"
  202.  
  203. end
  204.  
  205. local function climbing()
  206.  
  207. pose = "Climbing"
  208.  
  209. end
  210.  
  211. local function run(speed)
  212.  
  213. if speed > 0.5 then
  214.  
  215. pose = "Running"
  216.  
  217. else
  218.  
  219. pose = "Standing"
  220.  
  221. end
  222.  
  223. end
  224.  
  225. local function move(tiem)
  226.  
  227. local amplitude, frequency
  228.  
  229. if pose == "Seated" then
  230.  
  231. 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}})
  232.  
  233. return
  234.  
  235. end
  236.  
  237. if pose == "Jumping" then
  238.  
  239. Set({{RSH, 0.3, math.pi}, {LSH, 0.3, -math.pi}, {LH, 0.3, 0}, {RH, 0.3, 0}})
  240.  
  241. return
  242.  
  243. end
  244.  
  245. if pose == "Falling" then
  246.  
  247. Set({{RSH, 0.35, math.pi}, {LSH, 0.35, -math.pi}, {LH, 0.35, 0}, {RH, 0.35, 0}})
  248.  
  249. return
  250.  
  251. end
  252.  
  253. local climb = 0
  254.  
  255. if pose == "Running" then
  256.  
  257. RSH.MaxVelocity = 0.15
  258.  
  259. LSH.MaxVelocity = 0.15
  260.  
  261. RH.MaxVelocity = 0.15
  262.  
  263. LH.MaxVelocity = 0.15
  264.  
  265. amplitude = 1
  266.  
  267. frequency = 8
  268.  
  269. elseif pose == "Climbing" then
  270.  
  271. RSH.MaxVelocity = 0.3
  272.  
  273. LSH.MaxVelocity = 0.3
  274.  
  275. RH.MaxVelocity = 0.15
  276.  
  277. LH.MaxVelocity = 0.15
  278.  
  279. amplitude = 1
  280.  
  281. frequency = 8
  282.  
  283. climb = math.pi
  284.  
  285. else
  286.  
  287. amplitude = 0.1
  288.  
  289. frequency = 1
  290.  
  291. end
  292.  
  293. des = amplitude * math.sin(tiem*frequency)
  294.  
  295. RSH.DesiredAngle = des + climb
  296.  
  297. LSH.DesiredAngle = des - climb
  298.  
  299. RH.DesiredAngle = -des
  300.  
  301. LH.DesiredAngle = -des
  302.  
  303. end
  304.  
  305. Hum.Jumping:connect(jump)
  306.  
  307. Hum.Running:connect(run)
  308.  
  309. Hum.Seated:connect(sit)
  310.  
  311. Hum.Died:connect(died)
  312.  
  313. Hum.FreeFalling:connect(falling)
  314.  
  315. Hum.Climbing:connect(climbing)
  316.  
  317. coroutine.resume(coroutine.create(function()
  318.  
  319. while pose ~= "Dead" do
  320.  
  321. local _, time = wait(0.1)
  322.  
  323. move(time)
  324.  
  325. end
  326.  
  327. end))
  328.  
  329. end
  330.  
  331.  
  332.  
  333. function MakeNoob(pos, scale)
  334.  
  335. local Name = Names[MRA(1,#Names)]
  336.  
  337. local Nub = Instance.new("Model")
  338.  
  339. Nub.Name = Name
  340.  
  341. Noob = Nub
  342.  
  343. local Torso = Part(Nub, false, false, 0, 0, "Bright blue", 2*scale, 2*scale, 1*scale)
  344.  
  345. Torso.Name = "Torso"
  346.  
  347. local Head = Part(Nub, false, false, 0, 0, "Bright yellow", 2*scale, 1*scale, 1*scale)
  348.  
  349. Head.Name = "Head"
  350.  
  351. local Neck = MakeMotor(Torso, Head, CN(0, 1*scale, 0), CN(0, -0.5*scale, 0))
  352.  
  353. local HeadMesh = Instance.new("SpecialMesh",Head)
  354.  
  355. HeadMesh.Scale = V3(1.25, 1.25, 1.25)
  356.  
  357. local Face = Instance.new("Decal",Head)
  358.  
  359. Face.Face = "Front"
  360.  
  361. Face.Texture = Asset..(13038247)
  362.  
  363. local Rarm = Part(Nub, false, false, 0, 0, "Bright yellow", 1*scale, 2*scale, 1*scale)
  364.  
  365. Rarm.Name = "Right Arm"
  366.  
  367. local Larm = Part(Nub, false, false, 0, 0, "Bright yellow", 1*scale, 2*scale, 1*scale)
  368.  
  369. Larm.Name = "Left Arm"
  370.  
  371. local Rleg = Part(Nub, false, false, 0, 0, "Br. yellowish green", 1*scale, 2*scale, 1*scale)
  372.  
  373. Rleg.Name = "Right Leg"
  374.  
  375. local Lleg = Part(Nub, false, false, 0, 0, "Br. yellowish green", 1*scale, 2*scale, 1*scale)
  376.  
  377. Lleg.Name = "Left Leg"
  378.  
  379. 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))
  380.  
  381. 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))
  382.  
  383. 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))
  384.  
  385. 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))
  386.  
  387. local Shirt = Instance.new("Shirt", Nub)
  388.  
  389. local Pants = Instance.new("Pants", Nub)
  390.  
  391. Shirt.ShirtTemplate = Shirtss[MRA(1,#Shirtss)]
  392.  
  393. Pants.PantsTemplate = Pantss[MRA(1,#Pantss)]
  394.  
  395. local Hum = Instance.new("Humanoid")
  396.  
  397. Hum.MaxHealth = 40+(scale*60)
  398.  
  399. Hum.Health = 100
  400.  
  401. Hum.Parent = Nub
  402.  
  403. Nub.Parent = workspace
  404.  
  405. Nub:MakeJoints()
  406.  
  407. Nub:MoveTo(pos)
  408.  
  409. Animate(Hum,RSH,LSH,RH,LH)
  410.  
  411. --[[Hum.Died:connect(function()
  412.  
  413. wait(6)
  414.  
  415. Nub:remove()
  416.  
  417. wait(4)
  418.  
  419. MakeNoob(pos, scale)
  420.  
  421. end)]]
  422.  
  423. return {Name = Name, Model = Nub, Humanoid = Hum, Torso = Torso, Head = Head, Rarm = Rarm, Larm = Larm, Rleg = Rleg, Lleg = Lleg, RSH = RSH, LSH = LSH, RH = RH, LH = LH, Neck = Neck}
  424.  
  425. end
  426.  
  427.  
  428.  
  429. local Npc = MakeNoob(V3(MRA(-20, 20),10,MRA(-20, 20)), 1)
  430.  
  431.  
  432.  
  433. function Chat(msg, tone)
  434.  
  435. local tone = tone
  436.  
  437. if tone == nil then tone = 1 end
  438.  
  439. game:GetService("Chat"):Chat(Npc.Head, msg, Tones[tone] or 1)
  440.  
  441. end
  442.  
  443.  
  444.  
  445. wait(1.5)
  446.  
  447.  
  448.  
  449. Chat(("Hello! My name is %s."):format(Npc.Name))
  450.  
  451.  
  452.  
  453. while true do
  454.  
  455.  
  456.  
  457. wait(0.4)
  458.  
  459. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement