Advertisement
c00lkidd

Summon Citizen

May 22nd, 2016
591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.44 KB | None | 0 0
  1. --Run as a normal script. Not local.
  2. math.randomseed(tick())
  3.  
  4. Players_Met = {}
  5. Target = nil
  6. Tones = {
  7. Enum.ChatColor.Blue,
  8. Enum.ChatColor.Green,
  9. Enum.ChatColor.Red,
  10. }
  11.  
  12. Random_Thoughts = {
  13. "Oh boy! Such a sunny day.",
  14. "Lalalala..",
  15. "Meh.",
  16. "Hmm..",
  17. }
  18.  
  19. Neutral_Answers = {
  20. Hello = {
  21. "Hi.",
  22. "Hello.",
  23. },
  24. }
  25.  
  26. local Asset = "http://www.roblox.com/asset/?id="
  27.  
  28. 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"}
  29. Pantss = {Asset.."48121928", Asset.."13563502", Asset.."7825668", Asset.."30703758", Asset.."7825663", Asset.."19954576", Asset.."44097222", Asset.."19425981", Asset.."45506330", Asset.."19954576", Asset.."19954576"}
  30. Names = {"Joe", "Mark", "Carl", "Homer", "Kyle", "Stan", "Clyde", "Mick", "Nick", "Rick", "Peter", "Bucky", "Greg", "Eric",
  31. "Joel", "Kim", "Lenny", "Barney", "Aaron", "Allan", "Andrew", "Brian", "Chad", "Chris", "Daniel", "David",
  32. "Edward",
  33. }
  34.  
  35. function Part(P, Anch, Coll, Tran, Ref, Col, X, Y, Z)
  36. local p = Instance.new("Part")
  37. p.TopSurface = 0
  38. p.BottomSurface = 0
  39. p.Transparency = Tran
  40. p.Reflectance = Ref
  41. p.CanCollide = Coll
  42. p.Anchored = Anch
  43. p.BrickColor = BrickColor.new(Col)
  44. p.formFactor = "Custom"
  45. p.Size = Vector3.new(X,Y,Z)
  46. p.Parent = P
  47. p.Locked = true
  48. p:BreakJoints()
  49. return p
  50. end
  51.  
  52. function Weld(P0, P1, X, Y, Z, A, B, C)
  53. local w = Instance.new("Weld")
  54. w.Part0 = P0
  55. w.Part1 = P1
  56. w.C1 = CN(X, Y, Z) * CA(A, B, C)
  57. w.Parent = P0
  58. return w
  59. end
  60.  
  61. CA = CFrame.Angles
  62. CN = CFrame.new
  63. V3 = Vector3.new
  64. MR = math.rad
  65. MP = math.pi
  66. MRA = math.random
  67. MH = math.huge
  68.  
  69. Noob = nil
  70.  
  71. function MakeMotor(torso, p1, c0, c1)
  72. local mot = Instance.new("Motor6D")
  73. mot.C0 = c0
  74. mot.C1 = c1
  75. mot.Part0 = torso
  76. mot.Part1 = p1
  77. mot.Parent = torso
  78. return mot
  79. end
  80.  
  81. function Set(tab)
  82. for _,v in pairs(tab) do
  83. local motor = v[1]
  84. local vel = v[2]
  85. local des = v[3]
  86. motor.MaxVelocity = vel
  87. motor.DesiredAngle = des
  88. end
  89. end
  90.  
  91. function Animate(Hum, RSH, LSH, RH, LH)
  92. local pose = "Standing"
  93. local function sit()
  94. pose = "Seated"
  95. end
  96. local function jump()
  97. pose = "Jumping"
  98. end
  99. local function died()
  100. pose = "Dead"
  101. end
  102. local function falling()
  103. pose = "Falling"
  104. end
  105. local function climbing()
  106. pose = "Climbing"
  107. end
  108. local function run(speed)
  109. if speed > 0.5 then
  110. pose = "Running"
  111. else
  112. pose = "Standing"
  113. end
  114. end
  115. local function move(tiem)
  116. local amplitude, frequency
  117. if pose == "Seated" then
  118. 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}})
  119. return
  120. end
  121. if pose == "Jumping" then
  122. Set({{RSH, 0.3, math.pi}, {LSH, 0.3, -math.pi}, {LH, 0.3, 0}, {RH, 0.3, 0}})
  123. return
  124. end
  125. if pose == "Falling" then
  126. Set({{RSH, 0.35, math.pi}, {LSH, 0.35, -math.pi}, {LH, 0.35, 0}, {RH, 0.35, 0}})
  127. return
  128. end
  129. local climb = 0
  130. if pose == "Running" then
  131. RSH.MaxVelocity = 0.15
  132. LSH.MaxVelocity = 0.15
  133. RH.MaxVelocity = 0.15
  134. LH.MaxVelocity = 0.15
  135. amplitude = 1
  136. frequency = 8
  137. elseif pose == "Climbing" then
  138. RSH.MaxVelocity = 0.3
  139. LSH.MaxVelocity = 0.3
  140. RH.MaxVelocity = 0.15
  141. LH.MaxVelocity = 0.15
  142. amplitude = 1
  143. frequency = 8
  144. climb = math.pi
  145. else
  146. amplitude = 0.1
  147. frequency = 1
  148. end
  149. des = amplitude * math.sin(tiem*frequency)
  150. RSH.DesiredAngle = des + climb
  151. LSH.DesiredAngle = des - climb
  152. RH.DesiredAngle = -des
  153. LH.DesiredAngle = -des
  154. end
  155. Hum.Jumping:connect(jump)
  156. Hum.Running:connect(run)
  157. Hum.Seated:connect(sit)
  158. Hum.Died:connect(died)
  159. Hum.FreeFalling:connect(falling)
  160. Hum.Climbing:connect(climbing)
  161. coroutine.resume(coroutine.create(function()
  162. while pose ~= "Dead" do
  163. local _, time = wait(0.1)
  164. move(time)
  165. end
  166. end))
  167. end
  168.  
  169. function MakeNoob(pos, scale)
  170. local Name = Names[MRA(1,#Names)]
  171. local Nub = Instance.new("Model")
  172. Nub.Name = Name
  173. Noob = Nub
  174. local Torso = Part(Nub, false, false, 0, 0, "Bright blue", 2*scale, 2*scale, 1*scale)
  175. Torso.Name = "Torso"
  176. local Head = Part(Nub, false, false, 0, 0, "Bright yellow", 2*scale, 1*scale, 1*scale)
  177. Head.Name = "Head"
  178. local Neck = MakeMotor(Torso, Head, CN(0, 1*scale, 0), CN(0, -0.5*scale, 0))
  179. local HeadMesh = Instance.new("SpecialMesh",Head)
  180. HeadMesh.Scale = V3(1.25, 1.25, 1.25)
  181. local Face = Instance.new("Decal",Head)
  182. Face.Face = "Front"
  183. Face.Texture = Asset..(13038247)
  184. local Rarm = Part(Nub, false, false, 0, 0, "Bright yellow", 1*scale, 2*scale, 1*scale)
  185. Rarm.Name = "Right Arm"
  186. local Larm = Part(Nub, false, false, 0, 0, "Bright yellow", 1*scale, 2*scale, 1*scale)
  187. Larm.Name = "Left Arm"
  188. local Rleg = Part(Nub, false, false, 0, 0, "Br. yellowish green", 1*scale, 2*scale, 1*scale)
  189. Rleg.Name = "Right Leg"
  190. local Lleg = Part(Nub, false, false, 0, 0, "Br. yellowish green", 1*scale, 2*scale, 1*scale)
  191. Lleg.Name = "Left Leg"
  192. 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))
  193. 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))
  194. 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))
  195. 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))
  196. local Shirt = Instance.new("Shirt", Nub)
  197. local Pants = Instance.new("Pants", Nub)
  198. Shirt.ShirtTemplate = Shirtss[MRA(1,#Shirtss)]
  199. Pants.PantsTemplate = Pantss[MRA(1,#Pantss)]
  200. local Hum = Instance.new("Humanoid")
  201. Hum.MaxHealth = 40+(scale*60)
  202. Hum.Health = 100
  203. Hum.Parent = Nub
  204. Nub.Parent = workspace
  205. Nub:MakeJoints()
  206. Nub:MoveTo(pos)
  207. Animate(Hum,RSH,LSH,RH,LH)
  208. --[[Hum.Died:connect(function()
  209. wait(6)
  210. Nub:remove()
  211. wait(4)
  212. MakeNoob(pos, scale)
  213. end)]]
  214. 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}
  215. end
  216.  
  217. local Npc = MakeNoob(V3(MRA(-20, 20),10,MRA(-20, 20)), 1)
  218.  
  219. function Chat(msg, tone)
  220. local tone = tone
  221. if tone == nil then tone = 1 end
  222. game:GetService("Chat"):Chat(Npc.Head, msg, Tones[tone] or 1)
  223. end
  224.  
  225. wait(1.5)
  226.  
  227. Chat(("Hello! My name is %s."):format(Npc.Name))
  228.  
  229. while true do
  230.  
  231. wait(0.4)
  232. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement