Advertisement
ManOhMan

Untitled

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