Advertisement
sawgamer1

Untitled

Jun 24th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 73.42 KB | None | 0 0
  1. --Created with PenguinAnonymous's compiler
  2. --PenguinAnonymous is not responsible for damages caused to your game
  3. --This plugin does not remove things
  4. --PenguinAnonymous cannot be held resonsible for manual deletion for the purpose of testing
  5. --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
  6. --Thank you for using my plugin and enjoy :)
  7. --It is free to use
  8. --If you use this plugin to create your own, please give me credit
  9. --Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
  10. --Errors: Attachment,Animator,Status,MeshPart
  11. local runDummyScript = function(f,scri)
  12. local oldenv = getfenv(f)
  13. local newenv = setmetatable({}, {
  14. __index = function(_, k)
  15. if k:lower() == 'script' then
  16. return scri
  17. else
  18. return oldenv[k]
  19. end
  20. end
  21. })
  22. setfenv(f, newenv)
  23. ypcall(function() f() end)
  24. end
  25. cors = {}
  26. mas = Instance.new("Model",game:GetService("Lighting"))
  27. mas.Name = "CompiledModel"
  28. o1 = Instance.new("Model")
  29. o2 = Instance.new("Part")
  30. o3 = Instance.new("Vector3Value")
  31. o4 = Instance.new("Part")
  32. o5 = Instance.new("Vector3Value")
  33. o6 = Instance.new("Part")
  34. o7 = Instance.new("Vector3Value")
  35. o8 = Instance.new("Script")
  36. o9 = Instance.new("Part")
  37. o10 = Instance.new("Script")
  38. o11 = Instance.new("Vector3Value")
  39. o12 = Instance.new("Backpack")
  40. o13 = Instance.new("Script")
  41. o14 = Instance.new("ObjectValue")
  42. o15 = Instance.new("BindableEvent")
  43. o16 = Instance.new("Script")
  44. o17 = Instance.new("Script")
  45. o18 = Instance.new("Script")
  46. o19 = Instance.new("Model")
  47. o20 = Instance.new("Script")
  48. o21 = Instance.new("StringValue")
  49. o22 = Instance.new("Animation")
  50. o23 = Instance.new("StringValue")
  51. o24 = Instance.new("Animation")
  52. o25 = Instance.new("StringValue")
  53. o26 = Instance.new("Animation")
  54. o27 = Instance.new("StringValue")
  55. o28 = Instance.new("Animation")
  56. o29 = Instance.new("StringValue")
  57. o30 = Instance.new("Animation")
  58. o31 = Instance.new("StringValue")
  59. o32 = Instance.new("Animation")
  60. o33 = Instance.new("StringValue")
  61. o34 = Instance.new("Animation")
  62. o35 = Instance.new("StringValue")
  63. o36 = Instance.new("Animation")
  64. o37 = Instance.new("StringValue")
  65. o38 = Instance.new("Animation")
  66. o39 = Instance.new("StringValue")
  67. o40 = Instance.new("Animation")
  68. o41 = Instance.new("StringValue")
  69. o42 = Instance.new("Animation")
  70. o43 = Instance.new("StringValue")
  71. o44 = Instance.new("Animation")
  72. o45 = Instance.new("StringValue")
  73. o46 = Instance.new("Animation")
  74. o47 = Instance.new("NumberValue")
  75. o48 = Instance.new("Animation")
  76. o49 = Instance.new("NumberValue")
  77. o50 = Instance.new("Animation")
  78. o51 = Instance.new("NumberValue")
  79. o52 = Instance.new("Animation")
  80. o53 = Instance.new("NumberValue")
  81. o54 = Instance.new("Animation")
  82. o55 = Instance.new("NumberValue")
  83. o56 = Instance.new("StringValue")
  84. o57 = Instance.new("Animation")
  85. o58 = Instance.new("StringValue")
  86. o59 = Instance.new("Animation")
  87. o60 = Instance.new("NumberValue")
  88. o61 = Instance.new("Animation")
  89. o62 = Instance.new("NumberValue")
  90. o63 = Instance.new("Animation")
  91. o64 = Instance.new("NumberValue")
  92. o65 = Instance.new("StringValue")
  93. o66 = Instance.new("Animation")
  94. o67 = Instance.new("NumberValue")
  95. o68 = Instance.new("Animation")
  96. o69 = Instance.new("NumberValue")
  97. o70 = Instance.new("Animation")
  98. o71 = Instance.new("NumberValue")
  99. o72 = Instance.new("StringValue")
  100. o73 = Instance.new("Animation")
  101. o74 = Instance.new("NumberValue")
  102. o75 = Instance.new("Animation")
  103. o76 = Instance.new("NumberValue")
  104. o77 = Instance.new("Animation")
  105. o78 = Instance.new("NumberValue")
  106. o79 = Instance.new("StringValue")
  107. o80 = Instance.new("Animation")
  108. o81 = Instance.new("StringValue")
  109. o82 = Instance.new("Animation")
  110. o83 = Instance.new("Part")
  111. o84 = Instance.new("BlockMesh")
  112. o85 = Instance.new("Decal")
  113. o86 = Instance.new("Decal")
  114. o87 = Instance.new("Decal")
  115. o88 = Instance.new("Decal")
  116. o89 = Instance.new("Decal")
  117. o90 = Instance.new("Decal")
  118. o91 = Instance.new("Vector3Value")
  119. o92 = Instance.new("Script")
  120. o93 = Instance.new("StringValue")
  121. o94 = Instance.new("Animation")
  122. o95 = Instance.new("StringValue")
  123. o96 = Instance.new("Animation")
  124. o97 = Instance.new("StringValue")
  125. o98 = Instance.new("Animation")
  126. o99 = Instance.new("StringValue")
  127. o100 = Instance.new("Animation")
  128. o101 = Instance.new("StringValue")
  129. o102 = Instance.new("Animation")
  130. o103 = Instance.new("StringValue")
  131. o104 = Instance.new("Animation")
  132. o105 = Instance.new("StringValue")
  133. o106 = Instance.new("Animation")
  134. o107 = Instance.new("StringValue")
  135. o108 = Instance.new("Animation")
  136. o109 = Instance.new("NumberValue")
  137. o110 = Instance.new("Animation")
  138. o111 = Instance.new("NumberValue")
  139. o112 = Instance.new("StringValue")
  140. o113 = Instance.new("Animation")
  141. o114 = Instance.new("StringValue")
  142. o115 = Instance.new("Animation")
  143. o116 = Instance.new("Part")
  144. o117 = Instance.new("Motor6D")
  145. o118 = Instance.new("Vector3Value")
  146. o120 = Instance.new("Vector3Value")
  147. o122 = Instance.new("Vector3Value")
  148. o124 = Instance.new("Vector3Value")
  149. o126 = Instance.new("Vector3Value")
  150. o128 = Instance.new("Vector3Value")
  151. o129 = Instance.new("Humanoid")
  152. o130 = Instance.new("NumberValue")
  153. o131 = Instance.new("Script")
  154. o132 = Instance.new("NumberValue")
  155. o133 = Instance.new("NumberValue")
  156. o134 = Instance.new("NumberValue")
  157. o138 = Instance.new("Motor6D")
  158. o139 = Instance.new("Vector3Value")
  159. o141 = Instance.new("Vector3Value")
  160. o143 = Instance.new("Vector3Value")
  161. o145 = Instance.new("Vector3Value")
  162. o147 = Instance.new("Vector3Value")
  163. o149 = Instance.new("Vector3Value")
  164. o151 = Instance.new("Vector3Value")
  165. o153 = Instance.new("Vector3Value")
  166. o155 = Instance.new("Motor6D")
  167. o156 = Instance.new("Vector3Value")
  168. o158 = Instance.new("Vector3Value")
  169. o160 = Instance.new("Vector3Value")
  170. o162 = Instance.new("Motor6D")
  171. o163 = Instance.new("Vector3Value")
  172. o165 = Instance.new("Vector3Value")
  173. o167 = Instance.new("Vector3Value")
  174. o169 = Instance.new("Motor6D")
  175. o170 = Instance.new("Vector3Value")
  176. o172 = Instance.new("Vector3Value")
  177. o174 = Instance.new("Motor6D")
  178. o175 = Instance.new("Vector3Value")
  179. o177 = Instance.new("Vector3Value")
  180. o179 = Instance.new("Vector3Value")
  181. o181 = Instance.new("Motor6D")
  182. o182 = Instance.new("Vector3Value")
  183. o184 = Instance.new("Vector3Value")
  184. o186 = Instance.new("Vector3Value")
  185. o188 = Instance.new("Motor6D")
  186. o189 = Instance.new("Vector3Value")
  187. o191 = Instance.new("Vector3Value")
  188. o193 = Instance.new("Motor6D")
  189. o194 = Instance.new("Vector3Value")
  190. o196 = Instance.new("Vector3Value")
  191. o198 = Instance.new("Vector3Value")
  192. o200 = Instance.new("Vector3Value")
  193. o202 = Instance.new("Vector3Value")
  194. o204 = Instance.new("Vector3Value")
  195. o206 = Instance.new("Vector3Value")
  196. o208 = Instance.new("Vector3Value")
  197. o210 = Instance.new("Vector3Value")
  198. o212 = Instance.new("Vector3Value")
  199. o214 = Instance.new("Motor6D")
  200. o215 = Instance.new("Vector3Value")
  201. o217 = Instance.new("Vector3Value")
  202. o219 = Instance.new("Vector3Value")
  203. o221 = Instance.new("Vector3Value")
  204. o223 = Instance.new("Motor6D")
  205. o224 = Instance.new("Vector3Value")
  206. o226 = Instance.new("Vector3Value")
  207. o228 = Instance.new("Vector3Value")
  208. o230 = Instance.new("Motor6D")
  209. o231 = Instance.new("Vector3Value")
  210. o233 = Instance.new("Vector3Value")
  211. o235 = Instance.new("Vector3Value")
  212. o237 = Instance.new("Motor6D")
  213. o238 = Instance.new("Vector3Value")
  214. o240 = Instance.new("Vector3Value")
  215. o242 = Instance.new("Vector3Value")
  216. o244 = Instance.new("Vector3Value")
  217. o246 = Instance.new("Motor6D")
  218. o247 = Instance.new("Vector3Value")
  219. o249 = Instance.new("Vector3Value")
  220. o251 = Instance.new("Vector3Value")
  221. o253 = Instance.new("Motor6D")
  222. o254 = Instance.new("Vector3Value")
  223. o256 = Instance.new("Vector3Value")
  224. o258 = Instance.new("Vector3Value")
  225. o259 = Instance.new("Part")
  226. o260 = Instance.new("Vector3Value")
  227. o262 = Instance.new("Vector3Value")
  228. o263 = Instance.new("Shirt")
  229. o264 = Instance.new("Pants")
  230. o265 = Instance.new("Part")
  231. o266 = Instance.new("SpecialMesh")
  232. o267 = Instance.new("Script")
  233. o268 = Instance.new("Vector3Value")
  234. o269 = Instance.new("Decal")
  235. o1.Name = "Zombie Pigman [R15] Simon3676"
  236. o1.Parent = mas
  237. o1.PrimaryPart = o259
  238. o2.Name = "Fake Arm"
  239. o2.Parent = o1
  240. o2.BrickColor = BrickColor.new("Medium red")
  241. o2.Position = Vector3.new(-143.200302, 3.5000124, -94.6897202)
  242. o2.Rotation = Vector3.new(0, -90, 0)
  243. o2.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  244. o2.CanCollide = false
  245. o2.Size = Vector3.new(1, 1, 1)
  246. o2.CFrame = CFrame.new(-143.200302, 3.5000124, -94.6897202, -1.17795313e-13, 7.92996531e-08, -1, -3.67371271e-08, 1, -7.92996531e-08, 1, -3.67371271e-08, 1.17697003e-13)
  247. o2.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  248. o2.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  249. o2.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  250. o2.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  251. o2.RightSurface = Enum.SurfaceType.Weld
  252. o2.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  253. o2.Color = Color3.new(0.854902, 0.52549, 0.478431)
  254. o2.Position = Vector3.new(-143.200302, 3.5000124, -94.6897202)
  255. o2.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  256. o3.Name = "OriginalSize"
  257. o3.Parent = o2
  258. o3.Value = Vector3.new(1, 1, 1)
  259. o4.Name = "Fake Arm"
  260. o4.Parent = o1
  261. o4.BrickColor = BrickColor.new("Medium red")
  262. o4.Position = Vector3.new(-140.199936, 3.50000381, -94.6897202)
  263. o4.Rotation = Vector3.new(0, -90, 0)
  264. o4.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  265. o4.CanCollide = false
  266. o4.Size = Vector3.new(1, 1, 1)
  267. o4.CFrame = CFrame.new(-140.199936, 3.50000381, -94.6897202, -6.85475982e-14, 4.68588901e-08, -1, -2.17082992e-08, 1, -4.68588901e-08, 1, -2.17082992e-08, 6.85475982e-14)
  268. o4.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  269. o4.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  270. o4.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  271. o4.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  272. o4.RightSurface = Enum.SurfaceType.Weld
  273. o4.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  274. o4.Color = Color3.new(0.854902, 0.52549, 0.478431)
  275. o4.Position = Vector3.new(-140.199936, 3.50000381, -94.6897202)
  276. o4.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  277. o5.Name = "OriginalSize"
  278. o5.Parent = o4
  279. o5.Value = Vector3.new(1, 1, 1)
  280. o6.Name = "Fake Arm"
  281. o6.Parent = o1
  282. o6.BrickColor = BrickColor.new("Medium red")
  283. o6.Position = Vector3.new(-140.199875, 3.50000381, -93.6896591)
  284. o6.Rotation = Vector3.new(0, 90, 0)
  285. o6.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  286. o6.CanCollide = false
  287. o6.Size = Vector3.new(1, 1, 1)
  288. o6.CFrame = CFrame.new(-140.199875, 3.50000381, -93.6896591, 2.62440792e-14, 1.802265e-08, 1, 8.3493461e-09, 1, 1.802265e-08, -1, -8.3493461e-09, -2.62440792e-14)
  289. o6.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  290. o6.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  291. o6.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  292. o6.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  293. o6.RightSurface = Enum.SurfaceType.Weld
  294. o6.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  295. o6.Color = Color3.new(0.854902, 0.52549, 0.478431)
  296. o6.Position = Vector3.new(-140.199875, 3.50000381, -93.6896591)
  297. o6.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  298. o7.Name = "OriginalSize"
  299. o7.Parent = o6
  300. o7.Value = Vector3.new(1, 1, 1)
  301. o8.Parent = o6
  302. table.insert(cors,coroutine.create(function()
  303. wait()
  304. runDummyScript(function()
  305. function onTouched(part)
  306.  
  307. local h = part.Parent:findFirstChild("Humanoid")
  308.  
  309. if h~=nil then
  310.  
  311. h.Health = h.Health - 1
  312.  
  313. end
  314.  
  315. end
  316.  
  317.  
  318.  
  319. script.Parent.Touched:connect(onTouched)
  320. end,o8)
  321. end))
  322. o9.Name = "Fake Arm"
  323. o9.Parent = o1
  324. o9.BrickColor = BrickColor.new("Medium red")
  325. o9.Position = Vector3.new(-143.199875, 3.50000858, -93.6896591)
  326. o9.Rotation = Vector3.new(0, 90, 0)
  327. o9.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  328. o9.CanCollide = false
  329. o9.Size = Vector3.new(1, 1, 1)
  330. o9.CFrame = CFrame.new(-143.199875, 3.50000858, -93.6896591, 4.24941285e-14, 2.88362401e-08, 1, 1.33589548e-08, 1, 2.88362365e-08, -1, -1.33589548e-08, -4.2395815e-14)
  331. o9.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  332. o9.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  333. o9.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  334. o9.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  335. o9.RightSurface = Enum.SurfaceType.Weld
  336. o9.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  337. o9.Color = Color3.new(0.854902, 0.52549, 0.478431)
  338. o9.Position = Vector3.new(-143.199875, 3.50000858, -93.6896591)
  339. o9.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  340. o10.Parent = o9
  341. table.insert(cors,coroutine.create(function()
  342. wait()
  343. runDummyScript(function()
  344. function onTouched(part)
  345.  
  346. local h = part.Parent:findFirstChild("Humanoid")
  347.  
  348. if h~=nil then
  349.  
  350. h.Health = h.Health - 1
  351.  
  352. end
  353.  
  354. end
  355.  
  356.  
  357.  
  358. script.Parent.Touched:connect(onTouched)
  359. end,o10)
  360. end))
  361. o11.Name = "OriginalSize"
  362. o11.Parent = o9
  363. o11.Value = Vector3.new(1, 1, 1)
  364. o12.Name = "AI"
  365. o12.Parent = o1
  366. o13.Name = "WeaponFiring"
  367. o13.Parent = o12
  368. table.insert(cors,coroutine.create(function()
  369. wait()
  370. runDummyScript(function()
  371. local target = script.Parent:WaitForChild("Target")
  372. local torso = script.Parent.Parent:WaitForChild("Torso")
  373. local down = script.Parent:WaitForChild("MouseDown")
  374.  
  375. function handler(new)
  376. if target.Value then
  377. while target.Value == new do
  378. if target.Value and target.Value.Parent == nil then
  379. target.Value = nil
  380. return
  381. end
  382. local look = (new.Torso.Position-torso.Position).unit * 300
  383. local hit = workspace:FindPartOnRayWithIgnoreList(Ray.new(torso.Position,look),{script.Parent.Parent,new.Parent})
  384. if not hit or (new.Torso.Position-torso.Position).magnitude < 10 then
  385. down:Fire(new.Torso.Position)
  386. end
  387. wait(0.2)
  388. end
  389. end
  390. end
  391.  
  392. target.Changed:connect(handler)
  393.  
  394. if target.Value then
  395. handler(target.Value)
  396. end
  397. end,o13)
  398. end))
  399. o14.Name = "Target"
  400. o14.Parent = o12
  401. o15.Name = "MouseDown"
  402. o15.Parent = o12
  403. o16.Name = "Pathfinding"
  404. o16.Parent = o12
  405. table.insert(cors,coroutine.create(function()
  406. wait()
  407. runDummyScript(function()
  408. debugMode = false
  409. targetNPCs = false
  410.  
  411. --
  412.  
  413. h = script.Parent.Parent:WaitForChild("Humanoid")
  414. pathService = game:GetService("PathfindingService")
  415. targetV = script.Parent:WaitForChild("Target")
  416.  
  417. function closestTargetAndPath()
  418. local humanoids = {}
  419. if targetNPCs then
  420. local function recurse(o)
  421. for _,obj in pairs(o:GetChildren()) do
  422. if obj:IsA("Model") then
  423. if obj:findFirstChild("Humanoid") and obj:findFirstChild("Torso") and obj.Humanoid ~= h and obj.Humanoid.Health > 0 and not obj:findFirstChild("ForceField") then
  424. table.insert(humanoids,obj.Humanoid)
  425. end
  426. end
  427. recurse(obj)
  428. end
  429. end
  430. recurse(workspace)
  431. else
  432. for _,v in pairs(game.Players:GetPlayers()) do
  433. if v.Character and v.Character:findFirstChild("HumanoidRootPart") and v.Character:findFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 and not v:findFirstChild("ForceField") then
  434. table.insert(humanoids,v.Character.Humanoid)
  435. end
  436. end
  437. end
  438. local closest,path,dist
  439. for _,humanoid in pairs(humanoids) do
  440. local myPath = pathService:ComputeRawPathAsync(h.Torso.Position,humanoid.Torso.Position,500)
  441. if myPath.Status ~= Enum.PathStatus.FailFinishNotEmpty then
  442. -- Now that we have a successful path, we need to figure out how far we need to actually travel to reach this point.
  443. local myDist = 0
  444. local previous = h.Torso.Position
  445. for _,point in pairs(myPath:GetPointCoordinates()) do
  446. myDist = myDist + (point-previous).magnitude
  447. previous = point
  448. end
  449. if not dist or myDist < dist then -- if true, this is the closest path so far.
  450. closest = humanoid
  451. path = myPath
  452. dist = myDist
  453. end
  454. end
  455. end
  456. return closest,path
  457. end
  458.  
  459. function goToPos(loc)
  460. h:MoveTo(loc)
  461. local distance = (loc-h.Torso.Position).magnitude
  462. local start = tick()
  463. while distance > 4 do
  464. if tick()-start > distance/h.WalkSpeed then -- Something may have gone wrong. Just break.
  465. break
  466. end
  467. distance = (loc-h.Torso.Position).magnitude
  468. wait()
  469. end
  470. end
  471.  
  472. while wait() do
  473. local target,path = closestTargetAndPath()
  474. local didBreak = false
  475. local targetStart
  476. if target and h.Torso then
  477. targetV.Value = target
  478. targetStart = target.Torso.Position
  479. roaming = false
  480. local previous = h.Torso.Position
  481. local points = path:GetPointCoordinates()
  482. local s = #points > 1 and 2 or 1
  483. for i = s,#points do
  484. local point = points[i]
  485. if didBreak then
  486. break
  487. end
  488. if target and target.Torso and target.Health > 0 then
  489. if (target.Torso.Position-targetStart).magnitude < 1.5 then
  490. local pos = previous:lerp(point,.5)
  491. local moveDir = ((pos - h.Torso.Position).unit * 2)
  492. goToPos(previous:lerp(point,.5))
  493. previous = point
  494. end
  495. else
  496. didBreak = true
  497. break
  498. end
  499. end
  500. else
  501. targetV.Value = nil
  502. end
  503. if not didBreak and targetStart then
  504. goToPos(targetStart)
  505. end
  506. end
  507. end,o16)
  508. end))
  509. o17.Name = "R15 Ragdoller"
  510. o17.Parent = o1
  511. table.insert(cors,coroutine.create(function()
  512. wait()
  513. runDummyScript(function()
  514. local character = script.Parent
  515.  
  516. function recurse(root,callback,i)
  517. i= i or 0
  518. for _,v in pairs(root:GetChildren()) do
  519. i = i + 1
  520. callback(i,v)
  521.  
  522. if #v:GetChildren() > 0 then
  523. i = recurse(v,callback,i)
  524. end
  525. end
  526.  
  527. return i
  528. end
  529.  
  530. function ragdollJoint(part0, part1, attachmentName, className, properties)
  531. attachmentName = attachmentName.."RigAttachment"
  532. local constraint = Instance.new(className.."Constraint")
  533. constraint.Attachment0 = part0:FindFirstChild(attachmentName)
  534. constraint.Attachment1 = part1:FindFirstChild(attachmentName)
  535. constraint.Name = "RagdollConstraint"..part1.Name
  536.  
  537. for _,propertyData in next,properties or {} do
  538. constraint[propertyData[1]] = propertyData[2]
  539. end
  540.  
  541. constraint.Parent = character
  542. end
  543.  
  544. function getAttachment0(attachmentName)
  545. for _,child in next,character:GetChildren() do
  546. local attachment = child:FindFirstChild(attachmentName)
  547. if attachment then
  548. return attachment
  549. end
  550. end
  551. end
  552.  
  553. character:WaitForChild("Humanoid").Died:connect(function()
  554. local camera = workspace.CurrentCamera
  555. if camera.CameraSubject == character.Humanoid then--If developer isn't controlling camera
  556. camera.CameraSubject = character.UpperTorso
  557. end
  558.  
  559. --Make it so ragdoll can't collide with invisible HRP, but don't let HRP fall through map and be destroyed in process
  560. character.HumanoidRootPart.Anchored = true
  561. character.HumanoidRootPart.CanCollide = false
  562.  
  563. --Helps to fix constraint spasms
  564. recurse(character, function(_,v)
  565. if v:IsA("Attachment") then
  566. v.Axis = Vector3.new(0, 1, 0)
  567. v.SecondaryAxis = Vector3.new(0, 0, 1)
  568. v.Rotation = Vector3.new(0, 0, 0)
  569. end
  570. end)
  571.  
  572. --Re-attach hats
  573. for _,child in next,character:GetChildren() do
  574. if child:IsA("Accoutrement") then
  575. --Loop through all parts instead of only checking for one to be forwards-compatible in the event
  576. --ROBLOX implements multi-part accessories
  577. for _,part in next,child:GetChildren() do
  578. if part:IsA("BasePart") then
  579. local attachment1 = part:FindFirstChildOfClass("Attachment")
  580. local attachment0 = getAttachment0(attachment1.Name)
  581. if attachment0 and attachment1 then
  582. --Shouldn't use constraints for this, but have to because of a ROBLOX idiosyncrasy where
  583. --joints connecting a character are perpetually deleted while the character is dead
  584. local constraint = Instance.new("HingeConstraint")
  585. constraint.Attachment0 = attachment0
  586. constraint.Attachment1 = attachment1
  587. constraint.LimitsEnabled = true
  588. constraint.UpperAngle = 0 --Simulate weld by making it difficult for constraint to move
  589. constraint.LowerAngle = 0
  590. constraint.Parent = character
  591. end
  592. end
  593. end
  594. end
  595. end
  596.  
  597. ragdollJoint(character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", {
  598. {"LimitsEnabled",true};
  599. {"UpperAngle",5};
  600. })
  601. ragdollJoint(character.UpperTorso, character.Head, "Neck", "BallSocket", {
  602. {"LimitsEnabled",true};
  603. {"UpperAngle",15};
  604. })
  605.  
  606. local handProperties = {
  607. {"LimitsEnabled", true};
  608. {"UpperAngle",0};
  609. {"LowerAngle",0};
  610. }
  611. ragdollJoint(character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties)
  612. ragdollJoint(character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties)
  613.  
  614. local shinProperties = {
  615. {"LimitsEnabled", true};
  616. {"UpperAngle", 0};
  617. {"LowerAngle", -75};
  618. }
  619. ragdollJoint(character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties)
  620. ragdollJoint(character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties)
  621.  
  622. local footProperties = {
  623. {"LimitsEnabled", true};
  624. {"UpperAngle", 15};
  625. {"LowerAngle", -45};
  626. }
  627. ragdollJoint(character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties)
  628. ragdollJoint(character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties)
  629.  
  630. --TODO fix ability for socket to turn backwards whenn ConeConstraints are shipped
  631. ragdollJoint(character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket")
  632. ragdollJoint(character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket")
  633. ragdollJoint(character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket")
  634. ragdollJoint(character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket")
  635. ragdollJoint(character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket")
  636. ragdollJoint(character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket")
  637. end)
  638. end,o17)
  639. end))
  640. o18.Name = "Respawn"
  641. o18.Parent = o1
  642. table.insert(cors,coroutine.create(function()
  643. wait()
  644. runDummyScript(function()
  645. name="Humanoid"
  646.  
  647. robo=script.Parent:clone()
  648.  
  649. while true do
  650. wait(5)
  651. if script.Parent.Humanoid.Health<1 then
  652. robot=robo:clone()
  653. robot.Parent=script.Parent.Parent
  654. robot:makeJoints()
  655. script.Parent:remove()
  656. end
  657. end
  658.  
  659.  
  660.  
  661.  
  662. end,o18)
  663. end))
  664. o19.Name = "DebugPathDraw"
  665. o19.Parent = o1
  666. o20.Name = "Animate"
  667. o20.Parent = o1
  668. table.insert(cors,coroutine.create(function()
  669. wait()
  670. runDummyScript(function()
  671. function waitForChild(parent, childName)
  672. local child = parent:findFirstChild(childName)
  673. if child then return child end
  674. while true do
  675. child = parent.ChildAdded:wait()
  676. if child.Name==childName then return child end
  677. end
  678. end
  679.  
  680. local Figure = script.Parent
  681. local Humanoid = waitForChild(Figure, "Humanoid")
  682. local pose = "Standing"
  683.  
  684. local currentAnim = ""
  685. local currentAnimInstance = nil
  686. local currentAnimTrack = nil
  687. local currentAnimKeyframeHandler = nil
  688. local currentAnimSpeed = 1.0
  689. local animTable = {}
  690. local animNames = {
  691. idle = {
  692. { id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
  693. { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
  694. { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
  695. },
  696. walk = {
  697. { id = "http://www.roblox.com/asset/?id=507777826", weight = 10 }
  698. },
  699. run = {
  700. { id = "http://www.roblox.com/asset/?id=507767714", weight = 10 }
  701. },
  702. swim = {
  703. { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
  704. },
  705. swimidle = {
  706. { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
  707. },
  708. jump = {
  709. { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
  710. },
  711. fall = {
  712. { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
  713. },
  714. climb = {
  715. { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
  716. },
  717. sit = {
  718. { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
  719. },
  720. toolnone = {
  721. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  722. },
  723. toolslash = {
  724. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  725. -- { id = "slash.xml", weight = 10 }
  726. },
  727. toollunge = {
  728. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  729. },
  730. wave = {
  731. { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
  732. },
  733. point = {
  734. { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
  735. },
  736. dance = {
  737. { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
  738. { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
  739. { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
  740. },
  741. dance2 = {
  742. { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
  743. { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
  744. { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
  745. },
  746. dance3 = {
  747. { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
  748. { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
  749. { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
  750. },
  751. laugh = {
  752. { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
  753. },
  754. cheer = {
  755. { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
  756. },
  757. }
  758.  
  759. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  760. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  761.  
  762. math.randomseed(tick())
  763.  
  764. function configureAnimationSet(name, fileList)
  765. if (animTable[name] ~= nil) then
  766. for _, connection in pairs(animTable[name].connections) do
  767. connection:disconnect()
  768. end
  769. end
  770. animTable[name] = {}
  771. animTable[name].count = 0
  772. animTable[name].totalWeight = 0
  773. animTable[name].connections = {}
  774.  
  775. -- check for config values
  776. local config = script:FindFirstChild(name)
  777. if (config ~= nil) then
  778. -- print("Loading anims " .. name)
  779. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  780. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  781. local idx = 1
  782. for _, childPart in pairs(config:GetChildren()) do
  783. if (childPart:IsA("Animation")) then
  784. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  785. animTable[name][idx] = {}
  786. animTable[name][idx].anim = childPart
  787. local weightObject = childPart:FindFirstChild("Weight")
  788. if (weightObject == nil) then
  789. animTable[name][idx].weight = 1
  790. else
  791. animTable[name][idx].weight = weightObject.Value
  792. end
  793. animTable[name].count = animTable[name].count + 1
  794. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  795. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  796. idx = idx + 1
  797. end
  798. end
  799. end
  800.  
  801. -- fallback to defaults
  802. if (animTable[name].count <= 0) then
  803. for idx, anim in pairs(fileList) do
  804. animTable[name][idx] = {}
  805. animTable[name][idx].anim = Instance.new("Animation")
  806. animTable[name][idx].anim.Name = name
  807. animTable[name][idx].anim.AnimationId = anim.id
  808. animTable[name][idx].weight = anim.weight
  809. animTable[name].count = animTable[name].count + 1
  810. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  811. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  812. end
  813. end
  814. end
  815.  
  816. -- Setup animation objects
  817. function scriptChildModified(child)
  818. local fileList = animNames[child.Name]
  819. if (fileList ~= nil) then
  820. configureAnimationSet(child.Name, fileList)
  821. end
  822. end
  823.  
  824. script.ChildAdded:connect(scriptChildModified)
  825. script.ChildRemoved:connect(scriptChildModified)
  826.  
  827.  
  828. for name, fileList in pairs(animNames) do
  829. configureAnimationSet(name, fileList)
  830. end
  831.  
  832. -- ANIMATION
  833.  
  834. -- declarations
  835. local toolAnim = "None"
  836. local toolAnimTime = 0
  837.  
  838. local jumpAnimTime = 0
  839. local jumpAnimDuration = 0.31
  840.  
  841. local toolTransitionTime = 0.1
  842. local fallTransitionTime = 0.2
  843.  
  844. -- functions
  845.  
  846. function stopAllAnimations()
  847. local oldAnim = currentAnim
  848.  
  849. -- return to idle if finishing an emote
  850. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  851. oldAnim = "idle"
  852. end
  853.  
  854. currentAnim = ""
  855. currentAnimInstance = nil
  856. if (currentAnimKeyframeHandler ~= nil) then
  857. currentAnimKeyframeHandler:disconnect()
  858. end
  859.  
  860. if (currentAnimTrack ~= nil) then
  861. currentAnimTrack:Stop()
  862. currentAnimTrack:Destroy()
  863. currentAnimTrack = nil
  864. end
  865. return oldAnim
  866. end
  867.  
  868. function setAnimationSpeed(speed)
  869. if speed ~= currentAnimSpeed then
  870. currentAnimSpeed = speed
  871. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  872. end
  873. end
  874.  
  875. function keyFrameReachedFunc(frameName)
  876. if (frameName == "End") then
  877. -- print("Keyframe : ".. frameName)
  878.  
  879. local repeatAnim = currentAnim
  880. -- return to idle if finishing an emote
  881. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  882. repeatAnim = "idle"
  883. end
  884.  
  885. local animSpeed = currentAnimSpeed
  886. playAnimation(repeatAnim, 0.15, Humanoid)
  887. setAnimationSpeed(animSpeed)
  888. end
  889. end
  890.  
  891. -- Preload animations
  892. function playAnimation(animName, transitionTime, humanoid)
  893.  
  894. local roll = math.random(1, animTable[animName].totalWeight)
  895. local origRoll = roll
  896. local idx = 1
  897. while (roll > animTable[animName][idx].weight) do
  898. roll = roll - animTable[animName][idx].weight
  899. idx = idx + 1
  900. end
  901.  
  902. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  903.  
  904. local anim = animTable[animName][idx].anim
  905.  
  906. -- switch animation
  907. if (anim ~= currentAnimInstance) then
  908.  
  909. if (currentAnimTrack ~= nil) then
  910. currentAnimTrack:Stop(transitionTime)
  911. currentAnimTrack:Destroy()
  912. end
  913.  
  914. currentAnimSpeed = 1.0
  915.  
  916. -- load it to the humanoid; get AnimationTrack
  917. currentAnimTrack = humanoid:LoadAnimation(anim)
  918.  
  919. -- play the animation
  920. currentAnimTrack:Play(transitionTime)
  921. currentAnim = animName
  922. currentAnimInstance = anim
  923.  
  924. -- set up keyframe name triggers
  925. if (currentAnimKeyframeHandler ~= nil) then
  926. currentAnimKeyframeHandler:disconnect()
  927. end
  928. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  929.  
  930. end
  931.  
  932. end
  933.  
  934. -------------------------------------------------------------------------------------------
  935. -------------------------------------------------------------------------------------------
  936.  
  937. local toolAnimName = ""
  938. local toolAnimTrack = nil
  939. local toolAnimInstance = nil
  940. local currentToolAnimKeyframeHandler = nil
  941.  
  942. function toolKeyFrameReachedFunc(frameName)
  943. if (frameName == "End") then
  944. -- print("Keyframe : ".. frameName)
  945. playToolAnimation(toolAnimName, 0.0, Humanoid)
  946. end
  947. end
  948.  
  949.  
  950. function playToolAnimation(animName, transitionTime, humanoid)
  951.  
  952. local roll = math.random(1, animTable[animName].totalWeight)
  953. local origRoll = roll
  954. local idx = 1
  955. while (roll > animTable[animName][idx].weight) do
  956. roll = roll - animTable[animName][idx].weight
  957. idx = idx + 1
  958. end
  959. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  960. local anim = animTable[animName][idx].anim
  961.  
  962. if (toolAnimInstance ~= anim) then
  963.  
  964. if (toolAnimTrack ~= nil) then
  965. toolAnimTrack:Stop()
  966. toolAnimTrack:Destroy()
  967. transitionTime = 0
  968. end
  969.  
  970. -- load it to the humanoid; get AnimationTrack
  971. toolAnimTrack = humanoid:LoadAnimation(anim)
  972.  
  973. -- play the animation
  974. toolAnimTrack:Play(transitionTime)
  975. toolAnimName = animName
  976. toolAnimInstance = anim
  977.  
  978. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  979. end
  980. end
  981.  
  982. function stopToolAnimations()
  983. local oldAnim = toolAnimName
  984.  
  985. if (currentToolAnimKeyframeHandler ~= nil) then
  986. currentToolAnimKeyframeHandler:disconnect()
  987. end
  988.  
  989. toolAnimName = ""
  990. toolAnimInstance = nil
  991. if (toolAnimTrack ~= nil) then
  992. toolAnimTrack:Stop()
  993. toolAnimTrack:Destroy()
  994. toolAnimTrack = nil
  995. end
  996.  
  997.  
  998. return oldAnim
  999. end
  1000.  
  1001. -------------------------------------------------------------------------------------------
  1002. -------------------------------------------------------------------------------------------
  1003.  
  1004.  
  1005. function onRunning(speed)
  1006. if speed > 0.01 then
  1007. local scale = 15.0
  1008. playAnimation("walk", 0.1, Humanoid)
  1009. setAnimationSpeed(speed / scale)
  1010. pose = "Running"
  1011. else
  1012. playAnimation("idle", 0.1, Humanoid)
  1013. pose = "Standing"
  1014. end
  1015. end
  1016.  
  1017. function onDied()
  1018. pose = "Dead"
  1019. end
  1020.  
  1021. function onJumping()
  1022. playAnimation("jump", 0.1, Humanoid)
  1023. jumpAnimTime = jumpAnimDuration
  1024. pose = "Jumping"
  1025. end
  1026.  
  1027. function onClimbing(speed)
  1028. local scale = 5.0
  1029. playAnimation("climb", 0.1, Humanoid)
  1030. setAnimationSpeed(speed / scale)
  1031. pose = "Climbing"
  1032. end
  1033.  
  1034. function onGettingUp()
  1035. pose = "GettingUp"
  1036. end
  1037.  
  1038. function onFreeFall()
  1039. if (jumpAnimTime <= 0) then
  1040. playAnimation("fall", fallTransitionTime, Humanoid)
  1041. end
  1042. pose = "FreeFall"
  1043. end
  1044.  
  1045. function onFallingDown()
  1046. pose = "FallingDown"
  1047. end
  1048.  
  1049. function onSeated()
  1050. pose = "Seated"
  1051. end
  1052.  
  1053. function onPlatformStanding()
  1054. pose = "PlatformStanding"
  1055. end
  1056.  
  1057. function onSwimming(speed)
  1058. if speed > 1.00 then
  1059. local scale = 10.0
  1060. playAnimation("swim", 0.4, Humanoid)
  1061. setAnimationSpeed(speed / scale)
  1062. pose = "Swimming"
  1063. else
  1064. playAnimation("swimidle", 0.4, Humanoid)
  1065. pose = "Standing"
  1066. end
  1067. end
  1068.  
  1069. function getTool()
  1070. for _, kid in ipairs(Figure:GetChildren()) do
  1071. if kid.className == "Tool" then return kid end
  1072. end
  1073. return nil
  1074. end
  1075.  
  1076. function getToolAnim(tool)
  1077. for _, c in ipairs(tool:GetChildren()) do
  1078. if c.Name == "toolanim" and c.className == "StringValue" then
  1079. return c
  1080. end
  1081. end
  1082. return nil
  1083. end
  1084.  
  1085. function animateTool()
  1086.  
  1087. if (toolAnim == "None") then
  1088. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1089. return
  1090. end
  1091.  
  1092. if (toolAnim == "Slash") then
  1093. playToolAnimation("toolslash", 0, Humanoid)
  1094. return
  1095. end
  1096.  
  1097. if (toolAnim == "Lunge") then
  1098. playToolAnimation("toollunge", 0, Humanoid)
  1099. return
  1100. end
  1101. end
  1102.  
  1103. function moveSit()
  1104. RightShoulder.MaxVelocity = 0.15
  1105. LeftShoulder.MaxVelocity = 0.15
  1106. RightShoulder:SetDesiredAngle(3.14 /2)
  1107. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1108. RightHip:SetDesiredAngle(3.14 /2)
  1109. LeftHip:SetDesiredAngle(-3.14 /2)
  1110. end
  1111.  
  1112. local lastTick = 0
  1113.  
  1114. function move(time)
  1115. local amplitude = 1
  1116. local frequency = 1
  1117. local deltaTime = time - lastTick
  1118. lastTick = time
  1119.  
  1120. local climbFudge = 0
  1121. local setAngles = false
  1122.  
  1123. if (jumpAnimTime > 0) then
  1124. jumpAnimTime = jumpAnimTime - deltaTime
  1125. end
  1126.  
  1127. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1128. playAnimation("fall", fallTransitionTime, Humanoid)
  1129. elseif (pose == "Seated") then
  1130. playAnimation("sit", 0.5, Humanoid)
  1131. return
  1132. elseif (pose == "Running") then
  1133. playAnimation("walk", 0.1, Humanoid)
  1134. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1135. stopAllAnimations()
  1136. amplitude = 0.1
  1137. frequency = 1
  1138. setAngles = true
  1139. end
  1140.  
  1141. -- Tool Animation handling
  1142. local tool = getTool()
  1143. if tool then
  1144.  
  1145. animStringValueObject = getToolAnim(tool)
  1146.  
  1147. if animStringValueObject then
  1148. toolAnim = animStringValueObject.Value
  1149. -- message recieved, delete StringValue
  1150. animStringValueObject.Parent = nil
  1151. toolAnimTime = time + .3
  1152. end
  1153.  
  1154. if time > toolAnimTime then
  1155. toolAnimTime = 0
  1156. toolAnim = "None"
  1157. end
  1158.  
  1159. animateTool()
  1160. else
  1161. stopToolAnimations()
  1162. toolAnim = "None"
  1163. toolAnimInstance = nil
  1164. toolAnimTime = 0
  1165. end
  1166. end
  1167.  
  1168. -- connect events
  1169. Humanoid.Died:connect(onDied)
  1170. Humanoid.Running:connect(onRunning)
  1171. Humanoid.Jumping:connect(onJumping)
  1172. Humanoid.Climbing:connect(onClimbing)
  1173. Humanoid.GettingUp:connect(onGettingUp)
  1174. Humanoid.FreeFalling:connect(onFreeFall)
  1175. Humanoid.FallingDown:connect(onFallingDown)
  1176. Humanoid.Seated:connect(onSeated)
  1177. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1178. Humanoid.Swimming:connect(onSwimming)
  1179.  
  1180. -- setup emote chat hook
  1181. script.msg.Changed:connect(function(msg)
  1182. script.msg.Value = ""
  1183. local emote = ""
  1184. if (string.sub(msg, 1, 3) == "/e ") then
  1185. emote = string.sub(msg, 4)
  1186. elseif (string.sub(msg, 1, 7) == "/emote ") then
  1187. emote = string.sub(msg, 8)
  1188. end
  1189.  
  1190. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1191. playAnimation(emote, 0.1, Humanoid)
  1192. end
  1193. -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
  1194. end)
  1195.  
  1196.  
  1197. -- main program
  1198.  
  1199. local runService = game:service("RunService");
  1200.  
  1201. -- print("bottom")
  1202.  
  1203. -- initialize to idle
  1204. playAnimation("idle", 0.1, Humanoid)
  1205. pose = "Standing"
  1206.  
  1207. while Figure.Parent~=nil do
  1208. local _, time = wait(0.1)
  1209. move(time)
  1210. end
  1211.  
  1212.  
  1213.  
  1214. end,o20)
  1215. end))
  1216. o21.Name = "wave"
  1217. o21.Parent = o20
  1218. o22.Name = "WaveAnim"
  1219. o22.Parent = o21
  1220. o22.AnimationId = "http://www.roblox.com/asset/?id=507770239"
  1221. o23.Name = "walk"
  1222. o23.Parent = o20
  1223. o24.Name = "WalkAnim"
  1224. o24.Parent = o23
  1225. o24.AnimationId = "http://www.roblox.com/asset/?id=845403856"
  1226. o25.Name = "toolslash"
  1227. o25.Parent = o20
  1228. o26.Name = "ToolSlashAnim"
  1229. o26.Parent = o25
  1230. o26.AnimationId = "http://www.roblox.com/asset/?id=522635514"
  1231. o27.Name = "toolnone"
  1232. o27.Parent = o20
  1233. o28.Name = "ToolNoneAnim"
  1234. o28.Parent = o27
  1235. o28.AnimationId = "http://www.roblox.com/asset/?id=507768375"
  1236. o29.Name = "toollunge"
  1237. o29.Parent = o20
  1238. o30.Name = "ToolLungeAnim"
  1239. o30.Parent = o29
  1240. o30.AnimationId = "http://www.roblox.com/asset/?id=522638767"
  1241. o31.Name = "swimidle"
  1242. o31.Parent = o20
  1243. o32.Name = "SwimIdle"
  1244. o32.Parent = o31
  1245. o32.AnimationId = "http://www.roblox.com/asset/?id=845403127"
  1246. o33.Name = "swim"
  1247. o33.Parent = o20
  1248. o34.Name = "Swim"
  1249. o34.Parent = o33
  1250. o34.AnimationId = "http://www.roblox.com/asset/?id=845401742"
  1251. o35.Name = "sit"
  1252. o35.Parent = o20
  1253. o36.Name = "SitAnim"
  1254. o36.Parent = o35
  1255. o36.AnimationId = "http://www.roblox.com/asset/?id=507768133"
  1256. o37.Name = "run"
  1257. o37.Parent = o20
  1258. o38.Name = "RunAnim"
  1259. o38.Parent = o37
  1260. o38.AnimationId = "http://www.roblox.com/asset/?id=845386501"
  1261. o39.Name = "point"
  1262. o39.Parent = o20
  1263. o40.Name = "PointAnim"
  1264. o40.Parent = o39
  1265. o40.AnimationId = "http://www.roblox.com/asset/?id=507770453"
  1266. o41.Name = "laugh"
  1267. o41.Parent = o20
  1268. o42.Name = "LaughAnim"
  1269. o42.Parent = o41
  1270. o42.AnimationId = "http://www.roblox.com/asset/?id=507770818"
  1271. o43.Name = "jump"
  1272. o43.Parent = o20
  1273. o44.Name = "!ID!"
  1274. o44.Parent = o43
  1275. o44.AnimationId = "http://www.roblox.com/asset/?id=845398858"
  1276. o45.Name = "idle"
  1277. o45.Parent = o20
  1278. o46.Name = "WaveAnim"
  1279. o46.Parent = o45
  1280. o46.AnimationId = "http://www.roblox.com/asset/?id=507770239"
  1281. o47.Name = "Weight"
  1282. o47.Parent = o46
  1283. o47.Value = 1
  1284. o48.Name = "PointAnim"
  1285. o48.Parent = o45
  1286. o48.AnimationId = "http://www.roblox.com/asset/?id=507770453"
  1287. o49.Name = "Weight"
  1288. o49.Parent = o48
  1289. o49.Value = 1
  1290. o50.Name = "CheerAnim"
  1291. o50.Parent = o45
  1292. o50.AnimationId = "http://www.roblox.com/asset/?id=507770677"
  1293. o51.Name = "Weight"
  1294. o51.Parent = o50
  1295. o51.Value = 1
  1296. o52.Name = "Animation2"
  1297. o52.Parent = o45
  1298. o52.AnimationId = "http://www.roblox.com/asset/?id=845400520"
  1299. o53.Name = "Weight"
  1300. o53.Parent = o52
  1301. o53.Value = 1
  1302. o54.Name = "Animation1"
  1303. o54.Parent = o45
  1304. o54.AnimationId = "http://www.roblox.com/asset/?id=845397899"
  1305. o55.Name = "Weight"
  1306. o55.Parent = o54
  1307. o55.Value = 9
  1308. o56.Name = "fall"
  1309. o56.Parent = o20
  1310. o57.Name = "FallAnim"
  1311. o57.Parent = o56
  1312. o57.AnimationId = "http://www.roblox.com/asset/?id=845396048"
  1313. o58.Name = "dance3"
  1314. o58.Parent = o20
  1315. o59.Name = "Animation3"
  1316. o59.Parent = o58
  1317. o59.AnimationId = "http://www.roblox.com/asset/?id=507777623"
  1318. o60.Name = "Weight"
  1319. o60.Parent = o59
  1320. o60.Value = 10
  1321. o61.Name = "Animation2"
  1322. o61.Parent = o58
  1323. o61.AnimationId = "http://www.roblox.com/asset/?id=507777451"
  1324. o62.Name = "Weight"
  1325. o62.Parent = o61
  1326. o62.Value = 10
  1327. o63.Name = "Animation1"
  1328. o63.Parent = o58
  1329. o63.AnimationId = "http://www.roblox.com/asset/?id=507777268"
  1330. o64.Name = "Weight"
  1331. o64.Parent = o63
  1332. o64.Value = 10
  1333. o65.Name = "dance2"
  1334. o65.Parent = o20
  1335. o66.Name = "Animation3"
  1336. o66.Parent = o65
  1337. o66.AnimationId = "http://www.roblox.com/asset/?id=507776879"
  1338. o67.Name = "Weight"
  1339. o67.Parent = o66
  1340. o67.Value = 10
  1341. o68.Name = "Animation2"
  1342. o68.Parent = o65
  1343. o68.AnimationId = "http://www.roblox.com/asset/?id=507776720"
  1344. o69.Name = "Weight"
  1345. o69.Parent = o68
  1346. o69.Value = 10
  1347. o70.Name = "Animation1"
  1348. o70.Parent = o65
  1349. o70.AnimationId = "http://www.roblox.com/asset/?id=507776043"
  1350. o71.Name = "Weight"
  1351. o71.Parent = o70
  1352. o71.Value = 10
  1353. o72.Name = "dance"
  1354. o72.Parent = o20
  1355. o73.Name = "Animation3"
  1356. o73.Parent = o72
  1357. o73.AnimationId = "http://www.roblox.com/asset/?id=507772104"
  1358. o74.Name = "Weight"
  1359. o74.Parent = o73
  1360. o74.Value = 10
  1361. o75.Name = "Animation2"
  1362. o75.Parent = o72
  1363. o75.AnimationId = "http://www.roblox.com/asset/?id=507771955"
  1364. o76.Name = "Weight"
  1365. o76.Parent = o75
  1366. o76.Value = 10
  1367. o77.Name = "Animation1"
  1368. o77.Parent = o72
  1369. o77.AnimationId = "http://www.roblox.com/asset/?id=507771019"
  1370. o78.Name = "Weight"
  1371. o78.Parent = o77
  1372. o78.Value = 10
  1373. o79.Name = "climb"
  1374. o79.Parent = o20
  1375. o80.Name = "ClimbAnim"
  1376. o80.Parent = o79
  1377. o80.AnimationId = "http://www.roblox.com/asset/?id=845392038"
  1378. o81.Name = "cheer"
  1379. o81.Parent = o20
  1380. o82.Name = "CheerAnim"
  1381. o82.Parent = o81
  1382. o82.AnimationId = "http://www.roblox.com/asset/?id=507770677"
  1383. o83.Parent = o1
  1384. o83.BrickColor = BrickColor.new("Medium red")
  1385. o83.Position = Vector3.new(-141.699875, 5.50001335, -94.6899338)
  1386. o83.Rotation = Vector3.new(-180, 0, -180)
  1387. o83.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  1388. o83.Size = Vector3.new(1.99999988, 1, 1)
  1389. o83.CFrame = CFrame.new(-141.699875, 5.50001335, -94.6899338, -1, 1.802265e-08, 2.62440792e-14, -1.802265e-08, 1, 8.3493461e-09, 2.62440792e-14, -8.3493461e-09, -1)
  1390. o83.BottomSurface = Enum.SurfaceType.Weld
  1391. o83.Color = Color3.new(0.854902, 0.52549, 0.478431)
  1392. o83.Position = Vector3.new(-141.699875, 5.50001335, -94.6899338)
  1393. o83.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  1394. o84.Parent = o83
  1395. o84.Offset = Vector3.new(0, -0.800000012, 0)
  1396. o84.Scale = Vector3.new(0.800000012, 1.60000002, 1.60000002)
  1397. o85.Parent = o83
  1398. o85.Texture = "http://www.roblox.com/asset/?id=46658894"
  1399. o85.Face = Enum.NormalId.Right
  1400. o86.Parent = o83
  1401. o86.Texture = "http://www.roblox.com/asset/?id=46658894"
  1402. o86.Face = Enum.NormalId.Top
  1403. o87.Parent = o83
  1404. o87.Texture = "http://www.roblox.com/asset/?id=46658862"
  1405. o87.Face = Enum.NormalId.Left
  1406. o88.Parent = o83
  1407. o88.Texture = "http://www.roblox.com/asset/?id=46659296"
  1408. o88.Face = Enum.NormalId.Bottom
  1409. o89.Parent = o83
  1410. o89.Texture = "http://www.roblox.com/asset/?id=46658950"
  1411. o89.Face = Enum.NormalId.Back
  1412. o90.Parent = o83
  1413. o90.Texture = "http://www.roblox.com/asset/?id=46658714"
  1414. o91.Name = "OriginalSize"
  1415. o91.Parent = o83
  1416. o91.Value = Vector3.new(1.99999988, 1, 1)
  1417. o92.Parent = o1
  1418. table.insert(cors,coroutine.create(function()
  1419. wait()
  1420. runDummyScript(function()
  1421. function waitForChild(parent, childName)
  1422. local child = parent:findFirstChild(childName)
  1423. if child then return child end
  1424. while true do
  1425. child = parent.ChildAdded:wait()
  1426. if child.Name==childName then return child end
  1427. end
  1428. end
  1429.  
  1430. local Figure = script.Parent
  1431. local Humanoid = waitForChild(Figure, "Humanoid")
  1432. local pose = "Standing"
  1433.  
  1434. local currentAnim = ""
  1435. local currentAnimInstance = nil
  1436. local currentAnimTrack = nil
  1437. local currentAnimKeyframeHandler = nil
  1438. local currentAnimSpeed = 1.0
  1439. local animTable = {}
  1440. local animNames = {
  1441. idle = {
  1442. { id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
  1443. { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
  1444. { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
  1445. },
  1446. walk = {
  1447. { id = "http://www.roblox.com/asset/?id=507777826", weight = 10 }
  1448. },
  1449. run = {
  1450. { id = "http://www.roblox.com/asset/?id=507767714", weight = 10 }
  1451. },
  1452. swim = {
  1453. { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
  1454. },
  1455. swimidle = {
  1456. { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
  1457. },
  1458. jump = {
  1459. { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
  1460. },
  1461. fall = {
  1462. { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
  1463. },
  1464. climb = {
  1465. { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
  1466. },
  1467. sit = {
  1468. { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
  1469. },
  1470. toolnone = {
  1471. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  1472. },
  1473. toolslash = {
  1474. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  1475. -- { id = "slash.xml", weight = 10 }
  1476. },
  1477. toollunge = {
  1478. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  1479. },
  1480. wave = {
  1481. { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
  1482. },
  1483. point = {
  1484. { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
  1485. },
  1486. dance = {
  1487. { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
  1488. { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
  1489. { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
  1490. },
  1491. dance2 = {
  1492. { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
  1493. { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
  1494. { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
  1495. },
  1496. dance3 = {
  1497. { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
  1498. { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
  1499. { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
  1500. },
  1501. laugh = {
  1502. { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
  1503. },
  1504. cheer = {
  1505. { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
  1506. },
  1507. }
  1508.  
  1509. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  1510. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  1511.  
  1512. math.randomseed(tick())
  1513.  
  1514. function configureAnimationSet(name, fileList)
  1515. if (animTable[name] ~= nil) then
  1516. for _, connection in pairs(animTable[name].connections) do
  1517. connection:disconnect()
  1518. end
  1519. end
  1520. animTable[name] = {}
  1521. animTable[name].count = 0
  1522. animTable[name].totalWeight = 0
  1523. animTable[name].connections = {}
  1524.  
  1525. -- check for config values
  1526. local config = script:FindFirstChild(name)
  1527. if (config ~= nil) then
  1528. -- print("Loading anims " .. name)
  1529. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  1530. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  1531. local idx = 1
  1532. for _, childPart in pairs(config:GetChildren()) do
  1533. if (childPart:IsA("Animation")) then
  1534. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  1535. animTable[name][idx] = {}
  1536. animTable[name][idx].anim = childPart
  1537. local weightObject = childPart:FindFirstChild("Weight")
  1538. if (weightObject == nil) then
  1539. animTable[name][idx].weight = 1
  1540. else
  1541. animTable[name][idx].weight = weightObject.Value
  1542. end
  1543. animTable[name].count = animTable[name].count + 1
  1544. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1545. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1546. idx = idx + 1
  1547. end
  1548. end
  1549. end
  1550.  
  1551. -- fallback to defaults
  1552. if (animTable[name].count <= 0) then
  1553. for idx, anim in pairs(fileList) do
  1554. animTable[name][idx] = {}
  1555. animTable[name][idx].anim = Instance.new("Animation")
  1556. animTable[name][idx].anim.Name = name
  1557. animTable[name][idx].anim.AnimationId = anim.id
  1558. animTable[name][idx].weight = anim.weight
  1559. animTable[name].count = animTable[name].count + 1
  1560. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1561. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1562. end
  1563. end
  1564. end
  1565.  
  1566. -- Setup animation objects
  1567. function scriptChildModified(child)
  1568. local fileList = animNames[child.Name]
  1569. if (fileList ~= nil) then
  1570. configureAnimationSet(child.Name, fileList)
  1571. end
  1572. end
  1573.  
  1574. script.ChildAdded:connect(scriptChildModified)
  1575. script.ChildRemoved:connect(scriptChildModified)
  1576.  
  1577.  
  1578. for name, fileList in pairs(animNames) do
  1579. configureAnimationSet(name, fileList)
  1580. end
  1581.  
  1582. -- ANIMATION
  1583.  
  1584. -- declarations
  1585. local toolAnim = "None"
  1586. local toolAnimTime = 0
  1587.  
  1588. local jumpAnimTime = 0
  1589. local jumpAnimDuration = 0.31
  1590.  
  1591. local toolTransitionTime = 0.1
  1592. local fallTransitionTime = 0.2
  1593.  
  1594. -- functions
  1595.  
  1596. function stopAllAnimations()
  1597. local oldAnim = currentAnim
  1598.  
  1599. -- return to idle if finishing an emote
  1600. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1601. oldAnim = "idle"
  1602. end
  1603.  
  1604. currentAnim = ""
  1605. currentAnimInstance = nil
  1606. if (currentAnimKeyframeHandler ~= nil) then
  1607. currentAnimKeyframeHandler:disconnect()
  1608. end
  1609.  
  1610. if (currentAnimTrack ~= nil) then
  1611. currentAnimTrack:Stop()
  1612. currentAnimTrack:Destroy()
  1613. currentAnimTrack = nil
  1614. end
  1615. return oldAnim
  1616. end
  1617.  
  1618. function setAnimationSpeed(speed)
  1619. if speed ~= currentAnimSpeed then
  1620. currentAnimSpeed = speed
  1621. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1622. end
  1623. end
  1624.  
  1625. function keyFrameReachedFunc(frameName)
  1626. if (frameName == "End") then
  1627. -- print("Keyframe : ".. frameName)
  1628.  
  1629. local repeatAnim = currentAnim
  1630. -- return to idle if finishing an emote
  1631. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1632. repeatAnim = "idle"
  1633. end
  1634.  
  1635. local animSpeed = currentAnimSpeed
  1636. playAnimation(repeatAnim, 0.15, Humanoid)
  1637. setAnimationSpeed(animSpeed)
  1638. end
  1639. end
  1640.  
  1641. -- Preload animations
  1642. function playAnimation(animName, transitionTime, humanoid)
  1643.  
  1644. local roll = math.random(1, animTable[animName].totalWeight)
  1645. local origRoll = roll
  1646. local idx = 1
  1647. while (roll > animTable[animName][idx].weight) do
  1648. roll = roll - animTable[animName][idx].weight
  1649. idx = idx + 1
  1650. end
  1651.  
  1652. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1653.  
  1654. local anim = animTable[animName][idx].anim
  1655.  
  1656. -- switch animation
  1657. if (anim ~= currentAnimInstance) then
  1658.  
  1659. if (currentAnimTrack ~= nil) then
  1660. currentAnimTrack:Stop(transitionTime)
  1661. currentAnimTrack:Destroy()
  1662. end
  1663.  
  1664. currentAnimSpeed = 1.0
  1665.  
  1666. -- load it to the humanoid; get AnimationTrack
  1667. currentAnimTrack = humanoid:LoadAnimation(anim)
  1668.  
  1669. -- play the animation
  1670. currentAnimTrack:Play(transitionTime)
  1671. currentAnim = animName
  1672. currentAnimInstance = anim
  1673.  
  1674. -- set up keyframe name triggers
  1675. if (currentAnimKeyframeHandler ~= nil) then
  1676. currentAnimKeyframeHandler:disconnect()
  1677. end
  1678. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1679.  
  1680. end
  1681.  
  1682. end
  1683.  
  1684. -------------------------------------------------------------------------------------------
  1685. -------------------------------------------------------------------------------------------
  1686.  
  1687. local toolAnimName = ""
  1688. local toolAnimTrack = nil
  1689. local toolAnimInstance = nil
  1690. local currentToolAnimKeyframeHandler = nil
  1691.  
  1692. function toolKeyFrameReachedFunc(frameName)
  1693. if (frameName == "End") then
  1694. -- print("Keyframe : ".. frameName)
  1695. playToolAnimation(toolAnimName, 0.0, Humanoid)
  1696. end
  1697. end
  1698.  
  1699.  
  1700. function playToolAnimation(animName, transitionTime, humanoid)
  1701.  
  1702. local roll = math.random(1, animTable[animName].totalWeight)
  1703. local origRoll = roll
  1704. local idx = 1
  1705. while (roll > animTable[animName][idx].weight) do
  1706. roll = roll - animTable[animName][idx].weight
  1707. idx = idx + 1
  1708. end
  1709. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1710. local anim = animTable[animName][idx].anim
  1711.  
  1712. if (toolAnimInstance ~= anim) then
  1713.  
  1714. if (toolAnimTrack ~= nil) then
  1715. toolAnimTrack:Stop()
  1716. toolAnimTrack:Destroy()
  1717. transitionTime = 0
  1718. end
  1719.  
  1720. -- load it to the humanoid; get AnimationTrack
  1721. toolAnimTrack = humanoid:LoadAnimation(anim)
  1722.  
  1723. -- play the animation
  1724. toolAnimTrack:Play(transitionTime)
  1725. toolAnimName = animName
  1726. toolAnimInstance = anim
  1727.  
  1728. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1729. end
  1730. end
  1731.  
  1732. function stopToolAnimations()
  1733. local oldAnim = toolAnimName
  1734.  
  1735. if (currentToolAnimKeyframeHandler ~= nil) then
  1736. currentToolAnimKeyframeHandler:disconnect()
  1737. end
  1738.  
  1739. toolAnimName = ""
  1740. toolAnimInstance = nil
  1741. if (toolAnimTrack ~= nil) then
  1742. toolAnimTrack:Stop()
  1743. toolAnimTrack:Destroy()
  1744. toolAnimTrack = nil
  1745. end
  1746.  
  1747.  
  1748. return oldAnim
  1749. end
  1750.  
  1751. -------------------------------------------------------------------------------------------
  1752. -------------------------------------------------------------------------------------------
  1753.  
  1754.  
  1755. function onRunning(speed)
  1756. if speed > 0.01 then
  1757. local scale = 15.0
  1758. playAnimation("walk", 0.1, Humanoid)
  1759. setAnimationSpeed(speed / scale)
  1760. pose = "Running"
  1761. else
  1762. if emoteNames[currentAnim] == nil then
  1763. playAnimation("idle", 0.1, Humanoid)
  1764. pose = "Standing"
  1765. end
  1766. end
  1767. end
  1768.  
  1769. function onDied()
  1770. pose = "Dead"
  1771. end
  1772.  
  1773. function onJumping()
  1774. playAnimation("jump", 0.1, Humanoid)
  1775. jumpAnimTime = jumpAnimDuration
  1776. pose = "Jumping"
  1777. end
  1778.  
  1779. function onClimbing(speed)
  1780. local scale = 5.0
  1781. playAnimation("climb", 0.1, Humanoid)
  1782. setAnimationSpeed(speed / scale)
  1783. pose = "Climbing"
  1784. end
  1785.  
  1786. function onGettingUp()
  1787. pose = "GettingUp"
  1788. end
  1789.  
  1790. function onFreeFall()
  1791. if (jumpAnimTime <= 0) then
  1792. playAnimation("fall", fallTransitionTime, Humanoid)
  1793. end
  1794. pose = "FreeFall"
  1795. end
  1796.  
  1797. function onFallingDown()
  1798. pose = "FallingDown"
  1799. end
  1800.  
  1801. function onSeated()
  1802. pose = "Seated"
  1803. end
  1804.  
  1805. function onPlatformStanding()
  1806. pose = "PlatformStanding"
  1807. end
  1808.  
  1809. function onSwimming(speed)
  1810. if speed > 1.00 then
  1811. local scale = 10.0
  1812. playAnimation("swim", 0.4, Humanoid)
  1813. setAnimationSpeed(speed / scale)
  1814. pose = "Swimming"
  1815. else
  1816. playAnimation("swimidle", 0.4, Humanoid)
  1817. pose = "Standing"
  1818. end
  1819. end
  1820.  
  1821. function getTool()
  1822. for _, kid in ipairs(Figure:GetChildren()) do
  1823. if kid.className == "Tool" then return kid end
  1824. end
  1825. return nil
  1826. end
  1827.  
  1828. function getToolAnim(tool)
  1829. for _, c in ipairs(tool:GetChildren()) do
  1830. if c.Name == "toolanim" and c.className == "StringValue" then
  1831. return c
  1832. end
  1833. end
  1834. return nil
  1835. end
  1836.  
  1837. function animateTool()
  1838.  
  1839. if (toolAnim == "None") then
  1840. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1841. return
  1842. end
  1843.  
  1844. if (toolAnim == "Slash") then
  1845. playToolAnimation("toolslash", 0, Humanoid)
  1846. return
  1847. end
  1848.  
  1849. if (toolAnim == "Lunge") then
  1850. playToolAnimation("toollunge", 0, Humanoid)
  1851. return
  1852. end
  1853. end
  1854.  
  1855. function moveSit()
  1856. RightShoulder.MaxVelocity = 0.15
  1857. LeftShoulder.MaxVelocity = 0.15
  1858. RightShoulder:SetDesiredAngle(3.14 /2)
  1859. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1860. RightHip:SetDesiredAngle(3.14 /2)
  1861. LeftHip:SetDesiredAngle(-3.14 /2)
  1862. end
  1863.  
  1864. local lastTick = 0
  1865.  
  1866. function move(time)
  1867. local amplitude = 1
  1868. local frequency = 1
  1869. local deltaTime = time - lastTick
  1870. lastTick = time
  1871.  
  1872. local climbFudge = 0
  1873. local setAngles = false
  1874.  
  1875. if (jumpAnimTime > 0) then
  1876. jumpAnimTime = jumpAnimTime - deltaTime
  1877. end
  1878.  
  1879. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1880. playAnimation("fall", fallTransitionTime, Humanoid)
  1881. elseif (pose == "Seated") then
  1882. playAnimation("sit", 0.5, Humanoid)
  1883. return
  1884. elseif (pose == "Running") then
  1885. playAnimation("walk", 0.1, Humanoid)
  1886. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1887. stopAllAnimations()
  1888. amplitude = 0.1
  1889. frequency = 1
  1890. setAngles = true
  1891. end
  1892.  
  1893. -- Tool Animation handling
  1894. local tool = getTool()
  1895. if tool and (tool.RequiresHandle or tool:FindFirstChild("Handle")) then
  1896.  
  1897. animStringValueObject = getToolAnim(tool)
  1898.  
  1899. if animStringValueObject then
  1900. toolAnim = animStringValueObject.Value
  1901. -- message recieved, delete StringValue
  1902. animStringValueObject.Parent = nil
  1903. toolAnimTime = time + .3
  1904. end
  1905.  
  1906. if time > toolAnimTime then
  1907. toolAnimTime = 0
  1908. toolAnim = "None"
  1909. end
  1910.  
  1911. animateTool()
  1912. else
  1913. stopToolAnimations()
  1914. toolAnim = "None"
  1915. toolAnimInstance = nil
  1916. toolAnimTime = 0
  1917. end
  1918. end
  1919.  
  1920. -- connect events
  1921. Humanoid.Died:connect(onDied)
  1922. Humanoid.Running:connect(onRunning)
  1923. Humanoid.Jumping:connect(onJumping)
  1924. Humanoid.Climbing:connect(onClimbing)
  1925. Humanoid.GettingUp:connect(onGettingUp)
  1926. Humanoid.FreeFalling:connect(onFreeFall)
  1927. Humanoid.FallingDown:connect(onFallingDown)
  1928. Humanoid.Seated:connect(onSeated)
  1929. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1930. Humanoid.Swimming:connect(onSwimming)
  1931.  
  1932. -- setup emote chat hook
  1933. --Game.Players.LocalPlayer.Chatted:connect(function(msg)
  1934. -- local emote = ""
  1935. -- if (string.sub(msg, 1, 3) == "/e ") then
  1936. -- emote = string.sub(msg, 4)
  1937. -- elseif (string.sub(msg, 1, 7) == "/emote ") then
  1938. -- emote = string.sub(msg, 8)
  1939. -- end
  1940. --
  1941. -- if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1942. -- playAnimation(emote, 0.1, Humanoid)
  1943. -- end
  1944. -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
  1945. --end)
  1946.  
  1947.  
  1948. -- main program
  1949.  
  1950. local runService = game:service("RunService");
  1951.  
  1952. -- print("bottom")
  1953.  
  1954. -- initialize to idle
  1955. playAnimation("idle", 0.1, Humanoid)
  1956. pose = "Standing"
  1957.  
  1958. while Figure.Parent~=nil do
  1959. local _, time = wait(0.1)
  1960. move(time)
  1961. end
  1962.  
  1963.  
  1964.  
  1965. end,o92)
  1966. end))
  1967. o93.Name = "walk"
  1968. o93.Parent = o92
  1969. o94.Name = "RunAnim"
  1970. o94.Parent = o93
  1971. o94.AnimationId = "http://www.roblox.com/asset/?id=507777826"
  1972. o95.Name = "toolnone"
  1973. o95.Parent = o92
  1974. o96.Name = "ToolNoneAnim"
  1975. o96.Parent = o95
  1976. o96.AnimationId = "http://www.roblox.com/asset/?id=507768375"
  1977. o97.Name = "swimidle"
  1978. o97.Parent = o92
  1979. o98.Name = "SwimIdle"
  1980. o98.Parent = o97
  1981. o98.AnimationId = "http://www.roblox.com/asset/?id=481825862"
  1982. o99.Name = "swim"
  1983. o99.Parent = o92
  1984. o100.Name = "Swim"
  1985. o100.Parent = o99
  1986. o100.AnimationId = "http://www.roblox.com/asset/?id=507784897"
  1987. o101.Name = "sit"
  1988. o101.Parent = o92
  1989. o102.Name = "SitAnim"
  1990. o102.Parent = o101
  1991. o102.AnimationId = "http://www.roblox.com/asset/?id=507768133"
  1992. o103.Name = "run"
  1993. o103.Parent = o92
  1994. o104.Name = "RunAnim"
  1995. o104.Parent = o103
  1996. o104.AnimationId = "http://www.roblox.com/asset/?id=5077677142"
  1997. o105.Name = "jump"
  1998. o105.Parent = o92
  1999. o106.Name = "JumpAnim"
  2000. o106.Parent = o105
  2001. o106.AnimationId = "http://www.roblox.com/asset/?id=507765000"
  2002. o107.Name = "idle"
  2003. o107.Parent = o92
  2004. o108.Name = "Animation2"
  2005. o108.Parent = o107
  2006. o108.AnimationId = "http://www.roblox.com/asset/?id=507766666"
  2007. o109.Name = "Weight"
  2008. o109.Parent = o108
  2009. o109.Value = 1
  2010. o110.Name = "Animation1"
  2011. o110.Parent = o107
  2012. o110.AnimationId = "http://www.roblox.com/asset/?id=507766388"
  2013. o111.Name = "Weight"
  2014. o111.Parent = o110
  2015. o111.Value = 9
  2016. o112.Name = "fall"
  2017. o112.Parent = o92
  2018. o113.Name = "FallAnim"
  2019. o113.Parent = o112
  2020. o113.AnimationId = "http://www.roblox.com/asset/?id=507767968"
  2021. o114.Name = "climb"
  2022. o114.Parent = o92
  2023. o115.Name = "ClimbAnim"
  2024. o115.Parent = o114
  2025. o115.AnimationId = "http://www.roblox.com/asset/?id=507765644"
  2026. o116.Name = "Head"
  2027. o116.Parent = o1
  2028. o116.BrickColor = BrickColor.new("Medium red")
  2029. o116.Transparency = 1
  2030. o116.Position = Vector3.new(-141.699875, 4.50001431, -94.6899338)
  2031. o116.Rotation = Vector3.new(-180, 0, -180)
  2032. o116.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  2033. o116.Size = Vector3.new(2, 1, 1)
  2034. o116.CFrame = CFrame.new(-141.699875, 4.50001431, -94.6899338, -1, 3.60453001e-09, 5.23677781e-15, -3.60453001e-09, 1, 1.66986913e-09, 5.23677781e-15, -1.66986913e-09, -1)
  2035. o116.BottomSurface = Enum.SurfaceType.Smooth
  2036. o116.TopSurface = Enum.SurfaceType.Smooth
  2037. o116.Color = Color3.new(0.854902, 0.52549, 0.478431)
  2038. o116.Position = Vector3.new(-141.699875, 4.50001431, -94.6899338)
  2039. o116.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  2040. o117.Name = "Neck"
  2041. o117.Parent = o116
  2042. o117.C0 = CFrame.new(-5.96046448e-08, 0.800001502, 1.19209304e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2043. o117.C1 = CFrame.new(-0, -0.500000119, -0.000272244215, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2044. o117.Part0 = mas
  2045. o117.Part1 = o116
  2046. o118.Name = "OriginalSize"
  2047. o118.Parent = o116
  2048. o118.Value = Vector3.new(2, 1, 1)
  2049. o120.Name = "OriginalPosition"
  2050. o120.Parent = mas
  2051. o120.Value = Vector3.new(-0, -0.500000119, -0.000272244215)
  2052. o122.Name = "OriginalPosition"
  2053. o122.Parent = mas
  2054. o122.Value = Vector3.new(8.65851391e-09, 0.599999905, -0.000272244215)
  2055. o124.Name = "OriginalPosition"
  2056. o124.Parent = mas
  2057. o124.Value = Vector3.new(8.65851391e-09, 0.599999905, -0.000272244215)
  2058. o126.Name = "OriginalPosition"
  2059. o126.Parent = mas
  2060. o126.Value = Vector3.new(3.93568822e-09, 0, -0.600272298)
  2061. o128.Name = "OriginalPosition"
  2062. o128.Parent = mas
  2063. o128.Value = Vector3.new(3.93568822e-09, 0, -0.000272244215)
  2064. o129.Parent = o1
  2065. o129.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  2066. o129.Torso = o259
  2067. o129.Health = 200
  2068. o129.MaxHealth = 200
  2069. o129.WalkSpeed = 10
  2070. o130.Name = "HeadScale"
  2071. o130.Parent = o129
  2072. o130.Value = 1
  2073. o131.Name = "Despawn"
  2074. o131.Parent = o129
  2075. table.insert(cors,coroutine.create(function()
  2076. wait()
  2077. runDummyScript(function()
  2078. local tn = script.Parent.Parent;
  2079.  
  2080. script.Parent.Died:connect(function()
  2081. wait(10)
  2082. tn:remove()
  2083. end)
  2084. end,o131)
  2085. end))
  2086. o132.Name = "BodyWidthScale"
  2087. o132.Parent = o129
  2088. o132.Value = 1
  2089. o133.Name = "BodyHeightScale"
  2090. o133.Parent = o129
  2091. o133.Value = 1
  2092. o134.Name = "BodyDepthScale"
  2093. o134.Parent = o129
  2094. o134.Value = 1
  2095. o138.Name = "Root"
  2096. o138.Parent = mas
  2097. o138.C1 = CFrame.new(-1.1920946e-07, 0.150000036, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2098. o138.Part0 = o259
  2099. o138.Part1 = mas
  2100. o139.Name = "OriginalSize"
  2101. o139.Parent = mas
  2102. o139.Value = Vector3.new(1.99999976, 0.399999976, 1.00000012)
  2103. o141.Name = "OriginalPosition"
  2104. o141.Parent = mas
  2105. o141.Value = Vector3.new(0, -0.200000018, 0.50000006)
  2106. o143.Name = "OriginalPosition"
  2107. o143.Parent = mas
  2108. o143.Value = Vector3.new(0, -0.200000018, -0.50000006)
  2109. o145.Name = "OriginalPosition"
  2110. o145.Parent = mas
  2111. o145.Value = Vector3.new(0, -0.200000018, 0)
  2112. o147.Name = "OriginalPosition"
  2113. o147.Parent = mas
  2114. o147.Value = Vector3.new(0.500000477, -0.199999973, -0)
  2115. o149.Name = "OriginalPosition"
  2116. o149.Parent = mas
  2117. o149.Value = Vector3.new(-0.500000775, -0.199999973, -0)
  2118. o151.Name = "OriginalPosition"
  2119. o151.Parent = mas
  2120. o151.Value = Vector3.new(-1.1920946e-07, 0.550000072, 7.64462615e-20)
  2121. o153.Name = "OriginalPosition"
  2122. o153.Parent = mas
  2123. o153.Value = Vector3.new(-1.1920946e-07, 0.150000036, -0)
  2124. o155.Name = "RightHip"
  2125. o155.Parent = mas
  2126. o155.C0 = CFrame.new(0.500000477, -0.199999973, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2127. o155.C1 = CFrame.new(-0, 0.500001431, -1.04308256e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2128. o155.Part0 = mas
  2129. o155.Part1 = mas
  2130. o156.Name = "OriginalSize"
  2131. o156.Parent = mas
  2132. o156.Value = Vector3.new(1.00000048, 1.49999976, 0.999999881)
  2133. o158.Name = "OriginalPosition"
  2134. o158.Parent = mas
  2135. o158.Value = Vector3.new(-0, -0.300000697, 4.36005757e-05)
  2136. o160.Name = "OriginalPosition"
  2137. o160.Parent = mas
  2138. o160.Value = Vector3.new(-0, 0.500001431, -1.04308256e-07)
  2139. o162.Name = "RightKnee"
  2140. o162.Parent = mas
  2141. o162.C0 = CFrame.new(-0, -0.300000697, 4.36005757e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2142. o162.C1 = CFrame.new(-0, 0.249999642, 4.35260117e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2143. o162.Part0 = mas
  2144. o162.Part1 = mas
  2145. o163.Name = "OriginalSize"
  2146. o163.Parent = mas
  2147. o163.Value = Vector3.new(0.99999994, 1.50000036, 1.00000012)
  2148. o165.Name = "OriginalPosition"
  2149. o165.Parent = mas
  2150. o165.Value = Vector3.new(-0, -0.750000477, 9.82746424e-05)
  2151. o167.Name = "OriginalPosition"
  2152. o167.Parent = mas
  2153. o167.Value = Vector3.new(-0, 0.249999642, 4.35260117e-05)
  2154. o169.Name = "RightAnkle"
  2155. o169.Parent = mas
  2156. o169.C0 = CFrame.new(-0, -0.750000477, 9.82746424e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2157. o169.C1 = CFrame.new(-0, 0.0499997139, 9.8453449e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2158. o169.Part0 = mas
  2159. o169.Part1 = mas
  2160. o170.Name = "OriginalSize"
  2161. o170.Parent = mas
  2162. o170.Value = Vector3.new(0.99999994, 0.300000191, 1)
  2163. o172.Name = "OriginalPosition"
  2164. o172.Parent = mas
  2165. o172.Value = Vector3.new(-0, 0.0499997139, 9.8453449e-05)
  2166. o174.Name = "LeftHip"
  2167. o174.Parent = mas
  2168. o174.C0 = CFrame.new(-0.500000775, -0.199999973, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2169. o174.C1 = CFrame.new(5.96046448e-08, 0.500001431, -1.63913029e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2170. o174.Part0 = mas
  2171. o174.Part1 = mas
  2172. o175.Name = "OriginalSize"
  2173. o175.Parent = mas
  2174. o175.Value = Vector3.new(1.00000036, 1.49999976, 0.999999881)
  2175. o177.Name = "OriginalPosition"
  2176. o177.Parent = mas
  2177. o177.Value = Vector3.new(5.96046448e-08, -0.300000697, -1.63913029e-07)
  2178. o179.Name = "OriginalPosition"
  2179. o179.Parent = mas
  2180. o179.Value = Vector3.new(5.96046448e-08, 0.500001431, -1.63913029e-07)
  2181. o181.Name = "LeftKnee"
  2182. o181.Parent = mas
  2183. o181.C0 = CFrame.new(5.96046448e-08, -0.300000697, -1.63913029e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2184. o181.C1 = CFrame.new(-0, 0.249999642, -1.78813934e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2185. o181.Part0 = mas
  2186. o181.Part1 = mas
  2187. o182.Name = "OriginalSize"
  2188. o182.Parent = mas
  2189. o182.Value = Vector3.new(0.99999994, 1.50000036, 1.00000012)
  2190. o184.Name = "OriginalPosition"
  2191. o184.Parent = mas
  2192. o184.Value = Vector3.new(-1.78813934e-07, -0.749997616, 6.29340548e-07)
  2193. o186.Name = "OriginalPosition"
  2194. o186.Parent = mas
  2195. o186.Value = Vector3.new(-0, 0.249999642, -1.78813934e-07)
  2196. o188.Name = "LeftAnkle"
  2197. o188.Parent = mas
  2198. o188.C0 = CFrame.new(-1.78813934e-07, -0.749997616, 6.29340548e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2199. o188.C1 = CFrame.new(-2.38418579e-07, 0.0500025749, 8.08154539e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2200. o188.Part0 = mas
  2201. o188.Part1 = mas
  2202. o189.Name = "OriginalSize"
  2203. o189.Parent = mas
  2204. o189.Value = Vector3.new(1, 0.300000191, 1)
  2205. o191.Name = "OriginalPosition"
  2206. o191.Parent = mas
  2207. o191.Value = Vector3.new(-2.38418579e-07, 0.0500025749, 8.08154539e-07)
  2208. o193.Name = "Waist"
  2209. o193.Parent = mas
  2210. o193.C0 = CFrame.new(-1.1920946e-07, 0.550000072, 7.64462615e-20, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2211. o193.C1 = CFrame.new(-5.96046448e-08, -0.450000763, 1.19209304e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2212. o193.Part0 = mas
  2213. o193.Part1 = mas
  2214. o194.Name = "OriginalSize"
  2215. o194.Parent = mas
  2216. o194.Value = Vector3.new(2, 1.60000014, 1.00000036)
  2217. o196.Name = "OriginalPosition"
  2218. o196.Parent = mas
  2219. o196.Value = Vector3.new(0, 0.800001562, 0)
  2220. o198.Name = "OriginalPosition"
  2221. o198.Parent = mas
  2222. o198.Value = Vector3.new(0.999999881, 0.800001502, 4.61296032e-08)
  2223. o200.Name = "OriginalPosition"
  2224. o200.Parent = mas
  2225. o200.Value = Vector3.new(-0.999999762, 0.80000174, -7.27397449e-08)
  2226. o202.Name = "OriginalPosition"
  2227. o202.Parent = mas
  2228. o202.Value = Vector3.new(-5.96046448e-08, -0.200000435, 0.50000006)
  2229. o204.Name = "OriginalPosition"
  2230. o204.Parent = mas
  2231. o204.Value = Vector3.new(-5.96046448e-08, -0.200000435, -0.499999881)
  2232. o206.Name = "OriginalPosition"
  2233. o206.Parent = mas
  2234. o206.Value = Vector3.new(1.24998033, 0.550001383, 1.19209304e-07)
  2235. o208.Name = "OriginalPosition"
  2236. o208.Parent = mas
  2237. o208.Value = Vector3.new(-1.24989128, 0.550001383, 1.19209304e-07)
  2238. o210.Name = "OriginalPosition"
  2239. o210.Parent = mas
  2240. o210.Value = Vector3.new(-5.96046448e-08, 0.800001502, 1.19209304e-07)
  2241. o212.Name = "OriginalPosition"
  2242. o212.Parent = mas
  2243. o212.Value = Vector3.new(-5.96046448e-08, -0.450000763, 1.19209304e-07)
  2244. o214.Name = "RightShoulder"
  2245. o214.Parent = mas
  2246. o214.C0 = CFrame.new(1.24998033, 0.550001383, 1.19209304e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2247. o214.C1 = CFrame.new(-0.250020057, 0.450000584, 8.94069672e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2248. o214.Part0 = mas
  2249. o214.Part1 = mas
  2250. o215.Name = "OriginalSize"
  2251. o215.Parent = mas
  2252. o215.Value = Vector3.new(0.999999642, 1.40000033, 0.99999994)
  2253. o217.Name = "OriginalPosition"
  2254. o217.Parent = mas
  2255. o217.Value = Vector3.new(-9.53673634e-07, 0.700001776, -2.70968332e-08)
  2256. o219.Name = "OriginalPosition"
  2257. o219.Parent = mas
  2258. o219.Value = Vector3.new(-5.96046107e-07, -0.200000554, 8.94069672e-08)
  2259. o221.Name = "OriginalPosition"
  2260. o221.Parent = mas
  2261. o221.Value = Vector3.new(-0.250020057, 0.450000584, 8.94069672e-08)
  2262. o223.Name = "RightElbow"
  2263. o223.Parent = mas
  2264. o223.C0 = CFrame.new(-5.96046107e-07, -0.200000554, 8.94069672e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2265. o223.C1 = CFrame.new(1.1920929e-07, 0.25000006, 7.64462615e-20, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2266. o223.Part0 = mas
  2267. o223.Part1 = mas
  2268. o224.Name = "OriginalSize"
  2269. o224.Parent = mas
  2270. o224.Value = Vector3.new(0.999999762, 1.20000029, 1)
  2271. o226.Name = "OriginalPosition"
  2272. o226.Parent = mas
  2273. o226.Value = Vector3.new(1.1920929e-07, -0.549999952, -6.86244794e-18)
  2274. o228.Name = "OriginalPosition"
  2275. o228.Parent = mas
  2276. o228.Value = Vector3.new(1.1920929e-07, 0.25000006, 7.64462615e-20)
  2277. o230.Name = "RightWrist"
  2278. o230.Parent = mas
  2279. o230.C0 = CFrame.new(1.1920929e-07, -0.549999952, -6.86244794e-18, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2280. o230.C1 = CFrame.new(3.57628267e-07, 0.150000006, 5.96047656e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2281. o230.Part0 = mas
  2282. o230.Part1 = mas
  2283. o231.Name = "OriginalSize"
  2284. o231.Parent = mas
  2285. o231.Value = Vector3.new(0.999999881, 0.299999982, 0.999999881)
  2286. o233.Name = "OriginalPosition"
  2287. o233.Parent = mas
  2288. o233.Value = Vector3.new(0, -0.149999648, -1.46306377e-07)
  2289. o235.Name = "OriginalPosition"
  2290. o235.Parent = mas
  2291. o235.Value = Vector3.new(3.57628267e-07, 0.150000006, 5.96047656e-08)
  2292. o237.Name = "LeftShoulder"
  2293. o237.Parent = mas
  2294. o237.C0 = CFrame.new(-1.24989128, 0.550001383, 1.19209304e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2295. o237.C1 = CFrame.new(0.250109166, 0.450000584, 8.94069672e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2296. o237.Part0 = mas
  2297. o237.Part1 = mas
  2298. o238.Name = "OriginalSize"
  2299. o238.Parent = mas
  2300. o238.Value = Vector3.new(0.999999762, 1.40000033, 0.99999994)
  2301. o240.Name = "OriginalPosition"
  2302. o240.Parent = mas
  2303. o240.Value = Vector3.new(2.38418579e-07, 0.700001776, -2.70968332e-08)
  2304. o242.Name = "OriginalPosition"
  2305. o242.Parent = mas
  2306. o242.Value = Vector3.new(0.000479102135, -0.200000554, 8.94069672e-08)
  2307. o244.Name = "OriginalPosition"
  2308. o244.Parent = mas
  2309. o244.Value = Vector3.new(0.250109166, 0.450000584, 8.94069672e-08)
  2310. o246.Name = "LeftElbow"
  2311. o246.Parent = mas
  2312. o246.C0 = CFrame.new(0.000479102135, -0.200000554, 8.94069672e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2313. o246.C1 = CFrame.new(0.00047850603, 0.25000006, 7.64462615e-20, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2314. o246.Part0 = mas
  2315. o246.Part1 = mas
  2316. o247.Name = "OriginalSize"
  2317. o247.Parent = mas
  2318. o247.Value = Vector3.new(0.999999762, 1.20000029, 1)
  2319. o249.Name = "OriginalPosition"
  2320. o249.Parent = mas
  2321. o249.Value = Vector3.new(0.00047850603, -0.549999952, 7.64462615e-20)
  2322. o251.Name = "OriginalPosition"
  2323. o251.Parent = mas
  2324. o251.Value = Vector3.new(0.00047850603, 0.25000006, 7.64462615e-20)
  2325. o253.Name = "LeftWrist"
  2326. o253.Parent = mas
  2327. o253.C0 = CFrame.new(0.00047850603, -0.549999952, 7.64462615e-20, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2328. o253.C1 = CFrame.new(0.000478863687, 0.150000006, 5.96047656e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2329. o253.Part0 = mas
  2330. o253.Part1 = mas
  2331. o254.Name = "OriginalSize"
  2332. o254.Parent = mas
  2333. o254.Value = Vector3.new(0.999999762, 0.299999982, 0.999999881)
  2334. o256.Name = "OriginalPosition"
  2335. o256.Parent = mas
  2336. o256.Value = Vector3.new(-1.1920929e-07, -0.149999648, -1.46306377e-07)
  2337. o258.Name = "OriginalPosition"
  2338. o258.Parent = mas
  2339. o258.Value = Vector3.new(0.000478863687, 0.150000006, 5.96047656e-08)
  2340. o259.Name = "HumanoidRootPart"
  2341. o259.Parent = o1
  2342. o259.Material = Enum.Material.Marble
  2343. o259.BrickColor = BrickColor.new("Medium red")
  2344. o259.Transparency = 1
  2345. o259.Position = Vector3.new(-141.699875, 2.35001206, -94.6896591)
  2346. o259.Rotation = Vector3.new(-180, 0, -180)
  2347. o259.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  2348. o259.Size = Vector3.new(2, 2, 1)
  2349. o259.CFrame = CFrame.new(-141.699875, 2.35001206, -94.6896591, -1, 3.60453001e-09, 5.23677781e-15, -3.60453001e-09, 1, 1.66986913e-09, 5.23677781e-15, -1.66986913e-09, -1)
  2350. o259.Color = Color3.new(0.854902, 0.52549, 0.478431)
  2351. o259.Position = Vector3.new(-141.699875, 2.35001206, -94.6896591)
  2352. o259.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  2353. o260.Name = "OriginalSize"
  2354. o260.Parent = o259
  2355. o260.Value = Vector3.new(2, 2, 1)
  2356. o262.Name = "OriginalPosition"
  2357. o262.Parent = mas
  2358. o263.Parent = o1
  2359. o263.ShirtTemplate = "http://www.roblox.com/asset/?ID=46657872"
  2360. o264.Parent = o1
  2361. o264.PantsTemplate = "http://www.roblox.com/asset/?ID=46657911"
  2362. o265.Name = "Golden Sword"
  2363. o265.Parent = o1
  2364. o265.BrickColor = BrickColor.new("Institutional white")
  2365. o265.Position = Vector3.new(-143.224899, 5.00000858, -93.1146469)
  2366. o265.Rotation = Vector3.new(90, 0, 0)
  2367. o265.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  2368. o265.CanCollide = false
  2369. o265.FormFactor = Enum.FormFactor.Custom
  2370. o265.Size = Vector3.new(0.25, 0.149999991, 5)
  2371. o265.CFrame = CFrame.new(-143.224899, 5.00000858, -93.1146469, 1, -2.646272e-08, -1.41778443e-07, 3.48435094e-08, -4.34165912e-08, -1, 2.64624589e-08, 1, 3.8407002e-08)
  2372. o265.BottomSurface = Enum.SurfaceType.Weld
  2373. o265.TopSurface = Enum.SurfaceType.Smooth
  2374. o265.Color = Color3.new(0.972549, 0.972549, 0.972549)
  2375. o265.Position = Vector3.new(-143.224899, 5.00000858, -93.1146469)
  2376. o265.Velocity = Vector3.new(-1.40129846e-45, 0, 1.40129846e-45)
  2377. o266.Parent = o265
  2378. o266.MeshId = "http://www.roblox.com/asset/?id=361629844"
  2379. o266.Scale = Vector3.new(4.5, 4.5, 4.5)
  2380. o266.TextureId = "rbxgameasset://Images/Golden Sword (1)"
  2381. o266.MeshType = Enum.MeshType.FileMesh
  2382. o267.Parent = o265
  2383. table.insert(cors,coroutine.create(function()
  2384. wait()
  2385. runDummyScript(function()
  2386. function onTouched(part)
  2387.  
  2388. local h = part.Parent:findFirstChild("Humanoid")
  2389.  
  2390. if h~=nil then
  2391.  
  2392. h.Health = h.Health - 3
  2393.  
  2394. end
  2395.  
  2396. end
  2397.  
  2398.  
  2399.  
  2400. script.Parent.Touched:connect(onTouched)
  2401. end,o267)
  2402. end))
  2403. o268.Name = "OriginalSize"
  2404. o268.Parent = o265
  2405. o268.Value = Vector3.new(0.25, 0.149999991, 5)
  2406. o269.Parent = o265
  2407. o269.Texture = "http://www.roblox.com/asset/?id=925962048"
  2408. o269.Face = Enum.NormalId.Top
  2409. mas.Parent = workspace
  2410. mas:MakeJoints()
  2411. local mas1 = mas:GetChildren()
  2412. for i=1,#mas1 do
  2413. mas1[i].Parent = workspace
  2414. ypcall(function() mas1[i]:MakeJoints() end)
  2415. end
  2416. mas:Destroy()
  2417. for i=1,#cors do
  2418. coroutine.resume(cors[i])
  2419. end
  2420.  
  2421. game:GetService("Lighting").Ambient = Color3.new(0.498039, 0.498039, 0.498039)
  2422. game:GetService("Lighting").Brightness = 5
  2423. game:GetService("Lighting").ColorShift_Bottom = Color3.new(1, 1, 1)
  2424. game:GetService("Lighting").ColorShift_Top = Color3.new(1, 1, 1)
  2425. game:GetService("Lighting").GlobalShadows = true
  2426. game:GetService("Lighting").OutdoorAmbient = Color3.new(0.631373, 0.631373, 0.631373)
  2427. game:GetService("Lighting").Outlines = false
  2428. game:GetService("Lighting").GeographicLatitude = 41.733299255371
  2429. game:GetService("Lighting").TimeOfDay = "16:00:00"
  2430. game:GetService("Lighting").FogColor = Color3.new(0, -7.50588, 0)
  2431. game:GetService("Lighting").FogEnd = 1.0000000037683e+14
  2432. game:GetService("Lighting").FogStart = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement