Advertisement
ManOhMan

Untitled

Jul 10th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.13 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,MeshPart,Accessory,Camera,Animator,Status
  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. o4 = Instance.new("Vector3Value")
  31. o5 = Instance.new("Vector3Value")
  32. o7 = Instance.new("Vector3Value")
  33. o9 = Instance.new("Vector3Value")
  34. o11 = Instance.new("Vector3Value")
  35. o13 = Instance.new("Vector3Value")
  36. o15 = Instance.new("Vector3Value")
  37. o17 = Instance.new("Vector3Value")
  38. o19 = Instance.new("Vector3Value")
  39. o21 = Instance.new("Vector3Value")
  40. o23 = Instance.new("Vector3Value")
  41. o25 = Instance.new("Vector3Value")
  42. o27 = Instance.new("Part")
  43. o28 = Instance.new("SpecialMesh")
  44. o30 = Instance.new("Vector3Value")
  45. o33 = Instance.new("Vector3Value")
  46. o35 = Instance.new("Vector3Value")
  47. o37 = Instance.new("Vector3Value")
  48. o38 = Instance.new("Humanoid")
  49. o41 = Instance.new("Part")
  50. o42 = Instance.new("SpecialMesh")
  51. o43 = Instance.new("Vector3Value")
  52. o44 = Instance.new("Decal")
  53. o45 = Instance.new("Vector3Value")
  54. o46 = Instance.new("Weld")
  55. o47 = Instance.new("Shirt")
  56. o48 = Instance.new("Pants")
  57. o50 = Instance.new("Vector3Value")
  58. o51 = Instance.new("BodyColors")
  59. o52 = Instance.new("Script")
  60. o1.Name = ""
  61. o1.Parent = mas
  62. o1.PrimaryPart = o2
  63. o2.Name = "HumanoidRootPart"
  64. o2.Parent = o1
  65. o2.BrickColor = BrickColor.new("Fossil")
  66. o2.Transparency = 1
  67. o2.Position = Vector3.new(-16.0358047, 2.84820652, 26.2238865)
  68. o2.Rotation = Vector3.new(0, -1.08000004, 0)
  69. o2.Size = Vector3.new(2, 2, 1)
  70. o2.CFrame = CFrame.new(-16.0358047, 2.84820652, 26.2238865, 0.999822617, 0, -0.0188379921, 0, 1, 0, 0.0188379921, 0, 0.999822617)
  71. o2.Color = Color3.new(0.623529, 0.631373, 0.67451)
  72. o2.Position = Vector3.new(-16.0358047, 2.84820652, 26.2238865)
  73. o4.Name = "OriginalPosition"
  74. o4.Parent = mas
  75. o5.Name = "OriginalSize"
  76. o5.Parent = o2
  77. o5.Value = Vector3.new(2, 2, 1)
  78. o7.Name = "OriginalSize"
  79. o7.Parent = mas
  80. o7.Value = Vector3.new(0.827857256, 0.925159276, 0.877025366)
  81. o9.Name = "OriginalSize"
  82. o9.Parent = mas
  83. o9.Value = Vector3.new(0.675612688, 1.12489867, 0.826949)
  84. o11.Name = "OriginalSize"
  85. o11.Parent = mas
  86. o11.Value = Vector3.new(0.678933918, 1.34023988, 0.83825773)
  87. o13.Name = "OriginalSize"
  88. o13.Parent = mas
  89. o13.Value = Vector3.new(0.827857256, 0.925159216, 0.877025485)
  90. o15.Name = "OriginalSize"
  91. o15.Parent = mas
  92. o15.Value = Vector3.new(0.675612688, 1.12489867, 0.826949239)
  93. o17.Name = "OriginalSize"
  94. o17.Parent = mas
  95. o17.Value = Vector3.new(0.775964022, 0.955060005, 0.760477781)
  96. o19.Name = "OriginalSize"
  97. o19.Parent = mas
  98. o19.Value = Vector3.new(0.775964022, 0.955060005, 0.760477781)
  99. o21.Name = "OriginalSize"
  100. o21.Parent = mas
  101. o21.Value = Vector3.new(0.678933978, 1.34023976, 0.838257849)
  102. o23.Name = "OriginalSize"
  103. o23.Parent = mas
  104. o23.Value = Vector3.new(0.804975927, 0.456319749, 1.21525145)
  105. o25.Name = "OriginalSize"
  106. o25.Parent = mas
  107. o25.Value = Vector3.new(0.722899318, 0.919740558, 0.897220731)
  108. o27.Name = "Handle"
  109. o27.Parent = mas
  110. o27.Position = Vector3.new(-16.0358047, 4.79820633, 26.2238884)
  111. o27.Rotation = Vector3.new(0, -1.08000004, 0)
  112. o27.CanCollide = false
  113. o27.FormFactor = Enum.FormFactor.Custom
  114. o27.Size = Vector3.new(1.3400265, 1.34999824, 0.779999673)
  115. o27.CFrame = CFrame.new(-16.0358047, 4.79820633, 26.2238884, 0.999822617, 0, -0.0188379921, 0, 1, 0, 0.0188379921, 0, 0.999822617)
  116. o27.BottomSurface = Enum.SurfaceType.Smooth
  117. o27.TopSurface = Enum.SurfaceType.Smooth
  118. o27.Position = Vector3.new(-16.0358047, 4.79820633, 26.2238884)
  119. o28.Parent = o27
  120. o28.MeshId = "http://www.roblox.com/asset/?id=188004660 "
  121. o28.TextureId = "http://www.roblox.com/asset/?id=451217406"
  122. o28.MeshType = Enum.MeshType.FileMesh
  123. o30.Name = "OriginalSize"
  124. o30.Parent = o27
  125. o30.Value = Vector3.new(1.3400265, 1.34999824, 0.779999673)
  126. o33.Name = "OriginalSize"
  127. o33.Parent = mas
  128. o33.Value = Vector3.new(0.804975271, 0.456319809, 1.21525121)
  129. o35.Name = "OriginalSize"
  130. o35.Parent = mas
  131. o35.Value = Vector3.new(0.722899377, 0.919740558, 0.897220731)
  132. o37.Name = "OriginalSize"
  133. o37.Parent = mas
  134. o37.Value = Vector3.new(2.03200006, 1.86928844, 1.12989664)
  135. o38.Parent = o1
  136. o38.RightLeg = mas
  137. o38.LeftLeg = mas
  138. o38.Torso = o2
  139. o41.Name = "Head"
  140. o41.Parent = o1
  141. o41.BrickColor = BrickColor.new("Institutional white")
  142. o41.Position = Vector3.new(-16.0358047, 4.34820652, 26.2238884)
  143. o41.Rotation = Vector3.new(0, -1.08000004, 0)
  144. o41.Size = Vector3.new(2, 1, 1)
  145. o41.CFrame = CFrame.new(-16.0358047, 4.34820652, 26.2238884, 0.999822617, 0, -0.0188379921, 0, 1, 0, 0.0188379921, 0, 0.999822617)
  146. o41.BottomSurface = Enum.SurfaceType.Smooth
  147. o41.TopSurface = Enum.SurfaceType.Smooth
  148. o41.Color = Color3.new(0.972549, 0.972549, 0.972549)
  149. o41.Position = Vector3.new(-16.0358047, 4.34820652, 26.2238884)
  150. o42.Parent = o41
  151. o42.Scale = Vector3.new(1.25, 1.25, 1.25)
  152. o43.Name = "OriginalSize"
  153. o43.Parent = o42
  154. o43.Value = Vector3.new(1.25, 1.25, 1.25)
  155. o44.Name = "face"
  156. o44.Parent = o41
  157. o44.Texture = "rbxassetid://2779681178"
  158. o45.Name = "OriginalSize"
  159. o45.Parent = o41
  160. o45.Value = Vector3.new(2, 1, 1)
  161. o46.Name = "AccessoryWeld"
  162. o46.Parent = o41
  163. o46.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  164. o46.C1 = CFrame.new(0, 0.0500000007, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  165. o46.Active = true
  166. o46.Part0 = o41
  167. o46.Part1 = o27
  168. o47.Name = "Shirt"
  169. o47.Parent = o1
  170. o47.ShirtTemplate = "rbxassetid://1268378286"
  171. o48.Name = "Pants"
  172. o48.Parent = o1
  173. o48.PantsTemplate = "rbxassetid://1261244472"
  174. o50.Name = "OriginalSize"
  175. o50.Parent = mas
  176. o50.Value = Vector3.new(1.68052888, 0.508752942, 1.01567388)
  177. o51.Parent = o1
  178. o51.HeadColor = BrickColor.new("Institutional white")
  179. o51.LeftArmColor = BrickColor.new("Institutional white")
  180. o51.LeftLegColor = BrickColor.new("Really black")
  181. o51.RightArmColor = BrickColor.new("Institutional white")
  182. o51.RightLegColor = BrickColor.new("Really black")
  183. o51.TorsoColor = BrickColor.new("Institutional white")
  184. o52.Name = "Animate"
  185. o52.Parent = o1
  186. table.insert(cors,coroutine.create(function()
  187. wait()
  188. runDummyScript(function()
  189. function waitForChild(parent, childName)
  190. local child = parent:findFirstChild(childName)
  191. if child then return child end
  192. while true do
  193. child = parent.ChildAdded:wait()
  194. if child.Name==childName then return child end
  195. end
  196. end
  197.  
  198. local Figure = script.Parent
  199. local Humanoid = waitForChild(Figure, "Humanoid")
  200. local pose = "Standing"
  201.  
  202. local currentAnim = ""
  203. local currentAnimInstance = nil
  204. local currentAnimTrack = nil
  205. local currentAnimKeyframeHandler = nil
  206. local currentAnimSpeed = 1.0
  207. local animTable = {}
  208. local animNames = {
  209. idle = {
  210. { id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
  211. { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
  212. { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
  213. },
  214. walk = {
  215. { id = "http://www.roblox.com/asset/?id=507777826", weight = 10 }
  216. },
  217. run = {
  218. { id = "http://www.roblox.com/asset/?id=507767714", weight = 10 }
  219. },
  220. swim = {
  221. { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
  222. },
  223. swimidle = {
  224. { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
  225. },
  226. jump = {
  227. { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
  228. },
  229. fall = {
  230. { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
  231. },
  232. climb = {
  233. { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
  234. },
  235. sit = {
  236. { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
  237. },
  238. toolnone = {
  239. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  240. },
  241. toolslash = {
  242. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  243. -- { id = "slash.xml", weight = 10 }
  244. },
  245. toollunge = {
  246. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  247. },
  248. wave = {
  249. { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
  250. },
  251. point = {
  252. { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
  253. },
  254. dance = {
  255. { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
  256. { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
  257. { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
  258. },
  259. dance2 = {
  260. { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
  261. { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
  262. { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
  263. },
  264. dance3 = {
  265. { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
  266. { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
  267. { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
  268. },
  269. laugh = {
  270. { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
  271. },
  272. cheer = {
  273. { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
  274. },
  275. }
  276.  
  277. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  278. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  279.  
  280. math.randomseed(tick())
  281.  
  282. function configureAnimationSet(name, fileList)
  283. if (animTable[name] ~= nil) then
  284. for _, connection in pairs(animTable[name].connections) do
  285. connection:disconnect()
  286. end
  287. end
  288. animTable[name] = {}
  289. animTable[name].count = 0
  290. animTable[name].totalWeight = 0
  291. animTable[name].connections = {}
  292.  
  293. -- check for config values
  294. local config = script:FindFirstChild(name)
  295. if (config ~= nil) then
  296. -- print("Loading anims " .. name)
  297. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  298. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  299. local idx = 1
  300. for _, childPart in pairs(config:GetChildren()) do
  301. if (childPart:IsA("Animation")) then
  302. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  303. animTable[name][idx] = {}
  304. animTable[name][idx].anim = childPart
  305. local weightObject = childPart:FindFirstChild("Weight")
  306. if (weightObject == nil) then
  307. animTable[name][idx].weight = 1
  308. else
  309. animTable[name][idx].weight = weightObject.Value
  310. end
  311. animTable[name].count = animTable[name].count + 1
  312. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  313. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  314. idx = idx + 1
  315. end
  316. end
  317. end
  318.  
  319. -- fallback to defaults
  320. if (animTable[name].count <= 0) then
  321. for idx, anim in pairs(fileList) do
  322. animTable[name][idx] = {}
  323. animTable[name][idx].anim = Instance.new("Animation")
  324. animTable[name][idx].anim.Name = name
  325. animTable[name][idx].anim.AnimationId = anim.id
  326. animTable[name][idx].weight = anim.weight
  327. animTable[name].count = animTable[name].count + 1
  328. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  329. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  330. end
  331. end
  332. end
  333.  
  334. -- Setup animation objects
  335. function scriptChildModified(child)
  336. local fileList = animNames[child.Name]
  337. if (fileList ~= nil) then
  338. configureAnimationSet(child.Name, fileList)
  339. end
  340. end
  341.  
  342. script.ChildAdded:connect(scriptChildModified)
  343. script.ChildRemoved:connect(scriptChildModified)
  344.  
  345.  
  346. for name, fileList in pairs(animNames) do
  347. configureAnimationSet(name, fileList)
  348. end
  349.  
  350. -- ANIMATION
  351.  
  352. -- declarations
  353. local toolAnim = "None"
  354. local toolAnimTime = 0
  355.  
  356. local jumpAnimTime = 0
  357. local jumpAnimDuration = 0.31
  358.  
  359. local toolTransitionTime = 0.1
  360. local fallTransitionTime = 0.2
  361.  
  362. -- functions
  363.  
  364. function stopAllAnimations()
  365. local oldAnim = currentAnim
  366.  
  367. -- return to idle if finishing an emote
  368. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  369. oldAnim = "idle"
  370. end
  371.  
  372. currentAnim = ""
  373. currentAnimInstance = nil
  374. if (currentAnimKeyframeHandler ~= nil) then
  375. currentAnimKeyframeHandler:disconnect()
  376. end
  377.  
  378. if (currentAnimTrack ~= nil) then
  379. currentAnimTrack:Stop()
  380. currentAnimTrack:Destroy()
  381. currentAnimTrack = nil
  382. end
  383. return oldAnim
  384. end
  385.  
  386. function setAnimationSpeed(speed)
  387. if speed ~= currentAnimSpeed then
  388. currentAnimSpeed = speed
  389. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  390. end
  391. end
  392.  
  393. function keyFrameReachedFunc(frameName)
  394. if (frameName == "End") then
  395. -- print("Keyframe : ".. frameName)
  396.  
  397. local repeatAnim = currentAnim
  398. -- return to idle if finishing an emote
  399. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  400. repeatAnim = "idle"
  401. end
  402.  
  403. local animSpeed = currentAnimSpeed
  404. playAnimation(repeatAnim, 0.15, Humanoid)
  405. setAnimationSpeed(animSpeed)
  406. end
  407. end
  408.  
  409. -- Preload animations
  410. function playAnimation(animName, transitionTime, humanoid)
  411.  
  412. local roll = math.random(1, animTable[animName].totalWeight)
  413. local origRoll = roll
  414. local idx = 1
  415. while (roll > animTable[animName][idx].weight) do
  416. roll = roll - animTable[animName][idx].weight
  417. idx = idx + 1
  418. end
  419.  
  420. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  421.  
  422. local anim = animTable[animName][idx].anim
  423.  
  424. -- switch animation
  425. if (anim ~= currentAnimInstance) then
  426.  
  427. if (currentAnimTrack ~= nil) then
  428. currentAnimTrack:Stop(transitionTime)
  429. currentAnimTrack:Destroy()
  430. end
  431.  
  432. currentAnimSpeed = 1.0
  433.  
  434. -- load it to the humanoid; get AnimationTrack
  435. currentAnimTrack = humanoid:LoadAnimation(anim)
  436.  
  437. -- play the animation
  438. currentAnimTrack:Play(transitionTime)
  439. currentAnim = animName
  440. currentAnimInstance = anim
  441.  
  442. -- set up keyframe name triggers
  443. if (currentAnimKeyframeHandler ~= nil) then
  444. currentAnimKeyframeHandler:disconnect()
  445. end
  446. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  447.  
  448. end
  449.  
  450. end
  451.  
  452. -------------------------------------------------------------------------------------------
  453. -------------------------------------------------------------------------------------------
  454.  
  455. local toolAnimName = ""
  456. local toolAnimTrack = nil
  457. local toolAnimInstance = nil
  458. local currentToolAnimKeyframeHandler = nil
  459.  
  460. function toolKeyFrameReachedFunc(frameName)
  461. if (frameName == "End") then
  462. -- print("Keyframe : ".. frameName)
  463. playToolAnimation(toolAnimName, 0.0, Humanoid)
  464. end
  465. end
  466.  
  467.  
  468. function playToolAnimation(animName, transitionTime, humanoid)
  469.  
  470. local roll = math.random(1, animTable[animName].totalWeight)
  471. local origRoll = roll
  472. local idx = 1
  473. while (roll > animTable[animName][idx].weight) do
  474. roll = roll - animTable[animName][idx].weight
  475. idx = idx + 1
  476. end
  477. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  478. local anim = animTable[animName][idx].anim
  479.  
  480. if (toolAnimInstance ~= anim) then
  481.  
  482. if (toolAnimTrack ~= nil) then
  483. toolAnimTrack:Stop()
  484. toolAnimTrack:Destroy()
  485. transitionTime = 0
  486. end
  487.  
  488. -- load it to the humanoid; get AnimationTrack
  489. toolAnimTrack = humanoid:LoadAnimation(anim)
  490.  
  491. -- play the animation
  492. toolAnimTrack:Play(transitionTime)
  493. toolAnimName = animName
  494. toolAnimInstance = anim
  495.  
  496. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  497. end
  498. end
  499.  
  500. function stopToolAnimations()
  501. local oldAnim = toolAnimName
  502.  
  503. if (currentToolAnimKeyframeHandler ~= nil) then
  504. currentToolAnimKeyframeHandler:disconnect()
  505. end
  506.  
  507. toolAnimName = ""
  508. toolAnimInstance = nil
  509. if (toolAnimTrack ~= nil) then
  510. toolAnimTrack:Stop()
  511. toolAnimTrack:Destroy()
  512. toolAnimTrack = nil
  513. end
  514.  
  515.  
  516. return oldAnim
  517. end
  518.  
  519. -------------------------------------------------------------------------------------------
  520. -------------------------------------------------------------------------------------------
  521.  
  522.  
  523. function onRunning(speed)
  524. if speed > 0.01 then
  525. local scale = 15.0
  526. playAnimation("walk", 0.1, Humanoid)
  527. setAnimationSpeed(speed / scale)
  528. pose = "Running"
  529. else
  530. if emoteNames[currentAnim] == nil then
  531. playAnimation("idle", 0.1, Humanoid)
  532. pose = "Standing"
  533. end
  534. end
  535. end
  536.  
  537. function onDied()
  538. pose = "Dead"
  539. end
  540.  
  541. function onJumping()
  542. playAnimation("jump", 0.1, Humanoid)
  543. jumpAnimTime = jumpAnimDuration
  544. pose = "Jumping"
  545. end
  546.  
  547. function onClimbing(speed)
  548. local scale = 5.0
  549. playAnimation("climb", 0.1, Humanoid)
  550. setAnimationSpeed(speed / scale)
  551. pose = "Climbing"
  552. end
  553.  
  554. function onGettingUp()
  555. pose = "GettingUp"
  556. end
  557.  
  558. function onFreeFall()
  559. if (jumpAnimTime <= 0) then
  560. playAnimation("fall", fallTransitionTime, Humanoid)
  561. end
  562. pose = "FreeFall"
  563. end
  564.  
  565. function onFallingDown()
  566. pose = "FallingDown"
  567. end
  568.  
  569. function onSeated()
  570. pose = "Seated"
  571. end
  572.  
  573. function onPlatformStanding()
  574. pose = "PlatformStanding"
  575. end
  576.  
  577. function onSwimming(speed)
  578. if speed > 1.00 then
  579. local scale = 10.0
  580. playAnimation("swim", 0.4, Humanoid)
  581. setAnimationSpeed(speed / scale)
  582. pose = "Swimming"
  583. else
  584. playAnimation("swimidle", 0.4, Humanoid)
  585. pose = "Standing"
  586. end
  587. end
  588.  
  589. function getTool()
  590. for _, kid in ipairs(Figure:GetChildren()) do
  591. if kid.className == "Tool" then return kid end
  592. end
  593. return nil
  594. end
  595.  
  596. function getToolAnim(tool)
  597. for _, c in ipairs(tool:GetChildren()) do
  598. if c.Name == "toolanim" and c.className == "StringValue" then
  599. return c
  600. end
  601. end
  602. return nil
  603. end
  604.  
  605. function animateTool()
  606.  
  607. if (toolAnim == "None") then
  608. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  609. return
  610. end
  611.  
  612. if (toolAnim == "Slash") then
  613. playToolAnimation("toolslash", 0, Humanoid)
  614. return
  615. end
  616.  
  617. if (toolAnim == "Lunge") then
  618. playToolAnimation("toollunge", 0, Humanoid)
  619. return
  620. end
  621. end
  622.  
  623. function moveSit()
  624. RightShoulder.MaxVelocity = 0.15
  625. LeftShoulder.MaxVelocity = 0.15
  626. RightShoulder:SetDesiredAngle(3.14 /2)
  627. LeftShoulder:SetDesiredAngle(-3.14 /2)
  628. RightHip:SetDesiredAngle(3.14 /2)
  629. LeftHip:SetDesiredAngle(-3.14 /2)
  630. end
  631.  
  632. local lastTick = 0
  633.  
  634. function move(time)
  635. local amplitude = 1
  636. local frequency = 1
  637. local deltaTime = time - lastTick
  638. lastTick = time
  639.  
  640. local climbFudge = 0
  641. local setAngles = false
  642.  
  643. if (jumpAnimTime > 0) then
  644. jumpAnimTime = jumpAnimTime - deltaTime
  645. end
  646.  
  647. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  648. playAnimation("fall", fallTransitionTime, Humanoid)
  649. elseif (pose == "Seated") then
  650. playAnimation("sit", 0.5, Humanoid)
  651. return
  652. elseif (pose == "Running") then
  653. playAnimation("walk", 0.1, Humanoid)
  654. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  655. stopAllAnimations()
  656. amplitude = 0.1
  657. frequency = 1
  658. setAngles = true
  659. end
  660.  
  661. -- Tool Animation handling
  662. local tool = getTool()
  663. if tool and (tool.RequiresHandle or tool:FindFirstChild("Handle")) then
  664.  
  665. animStringValueObject = getToolAnim(tool)
  666.  
  667. if animStringValueObject then
  668. toolAnim = animStringValueObject.Value
  669. -- message recieved, delete StringValue
  670. animStringValueObject.Parent = nil
  671. toolAnimTime = time + .3
  672. end
  673.  
  674. if time > toolAnimTime then
  675. toolAnimTime = 0
  676. toolAnim = "None"
  677. end
  678.  
  679. animateTool()
  680. else
  681. stopToolAnimations()
  682. toolAnim = "None"
  683. toolAnimInstance = nil
  684. toolAnimTime = 0
  685. end
  686. end
  687.  
  688. -- connect events
  689. Humanoid.Died:connect(onDied)
  690. Humanoid.Running:connect(onRunning)
  691. Humanoid.Jumping:connect(onJumping)
  692. Humanoid.Climbing:connect(onClimbing)
  693. Humanoid.GettingUp:connect(onGettingUp)
  694. Humanoid.FreeFalling:connect(onFreeFall)
  695. Humanoid.FallingDown:connect(onFallingDown)
  696. Humanoid.Seated:connect(onSeated)
  697. Humanoid.PlatformStanding:connect(onPlatformStanding)
  698. Humanoid.Swimming:connect(onSwimming)
  699.  
  700. -- setup emote chat hook
  701. Game.Players.LocalPlayer.Chatted:connect(function(msg)
  702. local emote = ""
  703. if (string.sub(msg, 1, 3) == "/e ") then
  704. emote = string.sub(msg, 4)
  705. elseif (string.sub(msg, 1, 7) == "/emote ") then
  706. emote = string.sub(msg, 8)
  707. end
  708.  
  709. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  710. playAnimation(emote, 0.1, Humanoid)
  711. end
  712. -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
  713. end)
  714.  
  715.  
  716. -- main program
  717.  
  718. local runService = game:service("RunService");
  719.  
  720. -- print("bottom")
  721.  
  722. -- initialize to idle
  723. playAnimation("idle", 0.1, Humanoid)
  724. pose = "Standing"
  725.  
  726. while Figure.Parent~=nil do
  727. local _, time = wait(0.1)
  728. move(time)
  729. end
  730.  
  731.  
  732.  
  733. end,o52)
  734. end))
  735. mas.Parent = workspace
  736. mas:MakeJoints()
  737. local mas1 = mas:GetChildren()
  738. for i=1,#mas1 do
  739. mas1[i].Parent = workspace
  740. ypcall(function() mas1[i]:MakeJoints() end)
  741. end
  742. mas:Destroy()
  743. for i=1,#cors do
  744. coroutine.resume(cors[i])
  745. end
  746.  
  747. game:GetService("Lighting").Ambient = Color3.new(0, 0, 0)
  748. game:GetService("Lighting").Brightness = 2
  749. game:GetService("Lighting").ColorShift_Bottom = Color3.new(0, 0, 0)
  750. game:GetService("Lighting").ColorShift_Top = Color3.new(0, 0, 0)
  751. game:GetService("Lighting").GlobalShadows = true
  752. game:GetService("Lighting").OutdoorAmbient = Color3.new(0.501961, 0.501961, 0.501961)
  753. game:GetService("Lighting").Outlines = false
  754. game:GetService("Lighting").GeographicLatitude = 41.733299255371
  755. game:GetService("Lighting").TimeOfDay = "14:00:00"
  756. game:GetService("Lighting").FogColor = Color3.new(0.752941, 0.752941, 0.752941)
  757. game:GetService("Lighting").FogEnd = 100000
  758. game:GetService("Lighting").FogStart = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement