Advertisement
waconline

Rake

Feb 15th, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.71 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. function sandbox(var,func)
  153. local env = getfenv(func)
  154. local newenv = setmetatable({},{
  155. __index = function(self,k)
  156. if k=="script" then
  157. return var
  158. else
  159. return env[k]
  160. end
  161. end,
  162. })
  163. setfenv(func,newenv)
  164. return func
  165. end
  166. cors = {}
  167. mas = Instance.new("Model",game:GetService("Lighting"))
  168. Model0 = Instance.new("Model")
  169. Part1 = Instance.new("Part")
  170. Decal2 = Instance.new("Decal")
  171. SpecialMesh3 = Instance.new("SpecialMesh")
  172. Sound4 = Instance.new("Sound")
  173. Sound5 = Instance.new("Sound")
  174. Sound6 = Instance.new("Sound")
  175. Part7 = Instance.new("Part")
  176. Motor6D8 = Instance.new("Motor6D")
  177. Part9 = Instance.new("Part")
  178. SpecialMesh10 = Instance.new("SpecialMesh")
  179. Part11 = Instance.new("Part")
  180. SpecialMesh12 = Instance.new("SpecialMesh")
  181. Part13 = Instance.new("Part")
  182. SpecialMesh14 = Instance.new("SpecialMesh")
  183. Part15 = Instance.new("Part")
  184. SpecialMesh16 = Instance.new("SpecialMesh")
  185. Humanoid17 = Instance.new("Humanoid")
  186. Model18 = Instance.new("Model")
  187. Part19 = Instance.new("Part")
  188. Decal20 = Instance.new("Decal")
  189. Motor6D21 = Instance.new("Motor6D")
  190. Motor6D22 = Instance.new("Motor6D")
  191. Motor6D23 = Instance.new("Motor6D")
  192. Motor6D24 = Instance.new("Motor6D")
  193. Motor6D25 = Instance.new("Motor6D")
  194. SpecialMesh26 = Instance.new("SpecialMesh")
  195. Script27 = Instance.new("Script")
  196. BodyColors28 = Instance.new("BodyColors")
  197. Script29 = Instance.new("Script")
  198. ScreenGui30 = Instance.new("ScreenGui")
  199. Script31 = Instance.new("Script")
  200. Sound32 = Instance.new("Sound")
  201. Frame33 = Instance.new("Frame")
  202. Script34 = Instance.new("Script")
  203. Script35 = Instance.new("Script")
  204. Script36 = Instance.new("Script")
  205. StringValue37 = Instance.new("StringValue")
  206. Animation38 = Instance.new("Animation")
  207. StringValue39 = Instance.new("StringValue")
  208. Animation40 = Instance.new("Animation")
  209. StringValue41 = Instance.new("StringValue")
  210. Animation42 = Instance.new("Animation")
  211. NumberValue43 = Instance.new("NumberValue")
  212. Animation44 = Instance.new("Animation")
  213. NumberValue45 = Instance.new("NumberValue")
  214. StringValue46 = Instance.new("StringValue")
  215. Animation47 = Instance.new("Animation")
  216. StringValue48 = Instance.new("StringValue")
  217. Animation49 = Instance.new("Animation")
  218. StringValue50 = Instance.new("StringValue")
  219. Animation51 = Instance.new("Animation")
  220. StringValue52 = Instance.new("StringValue")
  221. Animation53 = Instance.new("Animation")
  222. StringValue54 = Instance.new("StringValue")
  223. Animation55 = Instance.new("Animation")
  224. Script56 = Instance.new("Script")
  225. Animation57 = Instance.new("Animation")
  226. Camera58 = Instance.new("Camera")
  227. Model0.Name = "GhostAbomination"
  228. Model0.Parent = mas
  229. Model0.PrimaryPart = Part1
  230. Part1.Name = "Head"
  231. Part1.Parent = Model0
  232. Part1.CFrame = CFrame.new(61.767746, -159.101074, -74.5056076, 0.0413627587, 0.999141395, -0.00233228342, -0.98481977, 0.0411634967, 0.168628141, 0.168579355, -0.0046780468, 0.985676885)
  233. Part1.Orientation = Vector3.new(-9.71000004, -0.140000001, -87.6100006)
  234. Part1.Position = Vector3.new(61.767746, -159.101074, -74.5056076)
  235. Part1.Rotation = Vector3.new(-9.71000004, -0.129999995, -87.6299973)
  236. Part1.Color = Color3.new(1, 0.8, 0.6)
  237. Part1.Size = Vector3.new(2, 1, 1)
  238. Part1.BrickColor = BrickColor.new("Pastel brown")
  239. Part1.CustomPhysicalProperties = 0.699999988, 0, 0, 1, 1
  240. Part1.Elasticity = 0
  241. Part1.Friction = 0
  242. Part1.Locked = true
  243. Part1.TopSurface = Enum.SurfaceType.Smooth
  244. Part1.brickColor = BrickColor.new("Pastel brown")
  245. Part1.FormFactor = Enum.FormFactor.Symmetric
  246. Part1.formFactor = Enum.FormFactor.Symmetric
  247. Decal2.Name = "face"
  248. Decal2.Parent = Part1
  249. SpecialMesh3.Parent = Part1
  250. SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=126601774"
  251. SpecialMesh3.Scale = Vector3.new(1.25, 1.25, 1.25)
  252. SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=189929079"
  253. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  254. Sound4.Name = "2"
  255. Sound4.Parent = Part1
  256. Sound4.SoundId = "rbxassetid://209120562"
  257. Sound4.Volume = 1
  258. Sound5.Name = "1"
  259. Sound5.Parent = Part1
  260. Sound5.SoundId = "rbxassetid://209120562"
  261. Sound5.Volume = 1
  262. Sound6.Name = "slv_die"
  263. Sound6.Parent = Part1
  264. Sound6.SoundId = "rbxassetid://209120593"
  265. Sound6.Volume = 1
  266. Part7.Name = "HumanoidRootPart"
  267. Part7.Parent = Model0
  268. Part7.CFrame = CFrame.new(62.3288956, -159.123993, -71.9343872, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  269. Part7.Position = Vector3.new(62.3288956, -159.123993, -71.9343872)
  270. Part7.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  271. Part7.Transparency = 1
  272. Part7.Size = Vector3.new(2, 2, 1)
  273. Part7.BottomSurface = Enum.SurfaceType.Smooth
  274. Part7.BrickColor = BrickColor.new("Bright blue")
  275. Part7.CustomPhysicalProperties = 0.699999988, 0, 0, 1, 1
  276. Part7.Elasticity = 0
  277. Part7.Friction = 0
  278. Part7.LeftParamA = 0
  279. Part7.LeftParamB = 0
  280. Part7.Locked = true
  281. Part7.RightParamA = 0
  282. Part7.RightParamB = 0
  283. Part7.TopSurface = Enum.SurfaceType.Smooth
  284. Part7.brickColor = BrickColor.new("Bright blue")
  285. Part7.FormFactor = Enum.FormFactor.Symmetric
  286. Part7.formFactor = Enum.FormFactor.Symmetric
  287. Motor6D8.Name = "RootJoint"
  288. Motor6D8.Parent = Part7
  289. Motor6D8.MaxVelocity = 0.10000000149012
  290. Motor6D8.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  291. Motor6D8.C1 = CFrame.new(0, -9.31322575e-10, -0.332509816, -1, -0, 0, 0, -0.999699414, -0.0245158393, 0, -0.0245158393, 0.999699414)
  292. Motor6D8.Part0 = Part7
  293. Motor6D8.Part1 = Part19
  294. Motor6D8.part1 = Part19
  295. Part9.Name = "Right Leg"
  296. Part9.Parent = Model0
  297. Part9.CFrame = CFrame.new(62.8288956, -160.761353, -71.8360062, 1, -2.77511552e-16, 4.95461293e-18, 2.7747235e-16, 0.999977767, 0.00666642748, -6.80451304e-18, -0.00666642748, 0.999977767)
  298. Part9.Orientation = Vector3.new(-0.379999995, 0, 0)
  299. Part9.Position = Vector3.new(62.8288956, -160.761353, -71.8360062)
  300. Part9.Rotation = Vector3.new(-0.379999995, 0, 0)
  301. Part9.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  302. Part9.Size = Vector3.new(1, 2, 1)
  303. Part9.BottomSurface = Enum.SurfaceType.Smooth
  304. Part9.BrickColor = BrickColor.new("Really black")
  305. Part9.CanCollide = false
  306. Part9.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
  307. Part9.Elasticity = 0
  308. Part9.Friction = 2
  309. Part9.Locked = true
  310. Part9.brickColor = BrickColor.new("Really black")
  311. Part9.FormFactor = Enum.FormFactor.Symmetric
  312. Part9.formFactor = Enum.FormFactor.Symmetric
  313. SpecialMesh10.Parent = Part9
  314. SpecialMesh10.MeshId = "http://www.roblox.com/asset/?id=152167904"
  315. SpecialMesh10.Scale = Vector3.new(0.400000006, 0.300000012, 0.600000024)
  316. SpecialMesh10.TextureId = "http://www.roblox.com/asset/?id=189963280"
  317. SpecialMesh10.MeshType = Enum.MeshType.FileMesh
  318. Part11.Name = "Left Leg"
  319. Part11.Parent = Model0
  320. Part11.CFrame = CFrame.new(61.8288956, -160.801682, -73.5468674, 1, 3.09405701e-09, -1.09643787e-10, -3.09542281e-09, 0.998503089, -0.0546938851, -5.97463676e-11, 0.0546938851, 0.998503089)
  321. Part11.Orientation = Vector3.new(3.1400001, 0, 0)
  322. Part11.Position = Vector3.new(61.8288956, -160.801682, -73.5468674)
  323. Part11.Rotation = Vector3.new(3.1400001, 0, 0)
  324. Part11.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  325. Part11.Size = Vector3.new(1, 2, 1)
  326. Part11.BottomSurface = Enum.SurfaceType.Smooth
  327. Part11.BrickColor = BrickColor.new("Really black")
  328. Part11.CanCollide = false
  329. Part11.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
  330. Part11.Elasticity = 0
  331. Part11.Friction = 2
  332. Part11.Locked = true
  333. Part11.brickColor = BrickColor.new("Really black")
  334. Part11.FormFactor = Enum.FormFactor.Symmetric
  335. Part11.formFactor = Enum.FormFactor.Symmetric
  336. SpecialMesh12.Parent = Part11
  337. SpecialMesh12.MeshId = "http://www.roblox.com/asset/?id=152167845"
  338. SpecialMesh12.Scale = Vector3.new(0.400000006, 0.300000012, 0.600000024)
  339. SpecialMesh12.TextureId = "http://www.roblox.com/asset/?id=189963280"
  340. SpecialMesh12.MeshType = Enum.MeshType.FileMesh
  341. Part13.Name = "Right Arm"
  342. Part13.Parent = Model0
  343. Part13.CFrame = CFrame.new(62.566452, -159.759781, -72.2535553, 1, 1.90852524e-16, 3.91499941e-15, 3.59224005e-15, -0.444252521, -0.895901442, 1.56826308e-15, 0.895901442, -0.444252521)
  344. Part13.Orientation = Vector3.new(63.6199989, 180, 180)
  345. Part13.Position = Vector3.new(62.566452, -159.759781, -72.2535553)
  346. Part13.Rotation = Vector3.new(116.379997, 0, 0)
  347. Part13.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  348. Part13.Size = Vector3.new(1, 2, 1)
  349. Part13.BrickColor = BrickColor.new("Really black")
  350. Part13.CanCollide = false
  351. Part13.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
  352. Part13.Elasticity = 0
  353. Part13.Friction = 2
  354. Part13.Locked = true
  355. Part13.brickColor = BrickColor.new("Really black")
  356. Part13.FormFactor = Enum.FormFactor.Symmetric
  357. Part13.formFactor = Enum.FormFactor.Symmetric
  358. SpecialMesh14.Parent = Part13
  359. SpecialMesh14.MeshId = "http://www.roblox.com/asset/?id=152066055"
  360. SpecialMesh14.Scale = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  361. SpecialMesh14.TextureId = "http://www.roblox.com/asset/?id=189963280"
  362. SpecialMesh14.MeshType = Enum.MeshType.FileMesh
  363. Part15.Name = "Left Arm"
  364. Part15.Parent = Model0
  365. Part15.CFrame = CFrame.new(61.0088577, -159.243515, -72.8943329, 0.229391053, 0.410681158, 0.882451594, 0.973329604, -0.0939662457, -0.209283918, -0.00302830525, 0.906924069, -0.421283066)
  366. Part15.Orientation = Vector3.new(12.0799999, 115.519997, 95.5100021)
  367. Part15.Position = Vector3.new(61.0088577, -159.243515, -72.8943329)
  368. Part15.Rotation = Vector3.new(153.580002, 61.9399986, -60.8100014)
  369. Part15.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  370. Part15.Size = Vector3.new(1, 2, 1)
  371. Part15.BrickColor = BrickColor.new("Really black")
  372. Part15.CanCollide = false
  373. Part15.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
  374. Part15.Elasticity = 0
  375. Part15.Friction = 2
  376. Part15.Locked = true
  377. Part15.brickColor = BrickColor.new("Really black")
  378. Part15.FormFactor = Enum.FormFactor.Symmetric
  379. Part15.formFactor = Enum.FormFactor.Symmetric
  380. SpecialMesh16.Parent = Part15
  381. SpecialMesh16.MeshId = "http://www.roblox.com/asset/?id=152167765"
  382. SpecialMesh16.Scale = Vector3.new(0.200000003, 1, 0.200000003)
  383. SpecialMesh16.TextureId = "http://www.roblox.com/asset/?id=189963280"
  384. SpecialMesh16.MeshType = Enum.MeshType.FileMesh
  385. Humanoid17.Parent = Model0
  386. Humanoid17.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  387. Humanoid17.Health = 500
  388. Humanoid17.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  389. Humanoid17.LeftLeg = Part11
  390. Humanoid17.MaxHealth = 500
  391. Humanoid17.NameOcclusion = Enum.NameOcclusion.EnemyOcclusion
  392. Humanoid17.RightLeg = Part9
  393. Humanoid17.Torso = Part7
  394. Humanoid17.WalkSpeed = 10
  395. Humanoid17.maxHealth = 500
  396. Model18.Name = "Status"
  397. Model18.Parent = Humanoid17
  398. Part19.Name = "Torso"
  399. Part19.Parent = Model0
  400. Part19.CFrame = CFrame.new(62.3288956, -158.79158, -71.9425354, 1, -0, 0, 0, -0.0245158393, 0.999699414, 0, -0.999699414, -0.0245158393)
  401. Part19.Orientation = Vector3.new(-88.5999985, 180, 180)
  402. Part19.Position = Vector3.new(62.3288956, -158.79158, -71.9425354)
  403. Part19.Rotation = Vector3.new(-91.4000015, 0, 0)
  404. Part19.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  405. Part19.Size = Vector3.new(2, 2, 1)
  406. Part19.BrickColor = BrickColor.new("Really black")
  407. Part19.CustomPhysicalProperties = 0.699999988, 2, 0, 1, 1
  408. Part19.Elasticity = 0
  409. Part19.Friction = 2
  410. Part19.LeftParamA = 0
  411. Part19.LeftParamB = 0
  412. Part19.LeftSurface = Enum.SurfaceType.Weld
  413. Part19.Locked = true
  414. Part19.RightParamA = 0
  415. Part19.RightParamB = 0
  416. Part19.RightSurface = Enum.SurfaceType.Weld
  417. Part19.brickColor = BrickColor.new("Really black")
  418. Part19.FormFactor = Enum.FormFactor.Symmetric
  419. Part19.formFactor = Enum.FormFactor.Symmetric
  420. Decal20.Name = "roblox"
  421. Decal20.Parent = Part19
  422. Decal20.Texture = "http://www.roblox.com/asset/?id=47730520"
  423. Motor6D21.Name = "Neck"
  424. Motor6D21.Parent = Part19
  425. Motor6D21.MaxVelocity = 0.10000000149012
  426. Motor6D21.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  427. Motor6D21.C1 = CFrame.new(0.00611115014, 0.565083683, 1.58772755, -0.0413627587, -0.9886567, -0.14438501, -0.999141395, 0.0412658118, 0.00366748311, 0.00233228342, 0.144412771, -0.989514709)
  428. Motor6D21.Part0 = Part19
  429. Motor6D21.Part1 = Part1
  430. Motor6D21.part1 = Part1
  431. Motor6D22.Name = "Left Hip"
  432. Motor6D22.Parent = Part19
  433. Motor6D22.MaxVelocity = 0.10000000149012
  434. Motor6D22.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  435. Motor6D22.C1 = CFrame.new(-0.499999881, 2.17400312, 2.48885155, -3.09302783e-09, 1.35615297e-10, -1, 0.996862113, -0.079156585, -3.09405701e-09, -0.079156585, -0.996862113, 1.09643787e-10)
  436. Motor6D22.Part0 = Part19
  437. Motor6D22.Part1 = Part11
  438. Motor6D22.part1 = Part11
  439. Motor6D23.Name = "Right Hip"
  440. Motor6D23.Parent = Part19
  441. Motor6D23.MaxVelocity = 0.10000000149012
  442. Motor6D23.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  443. Motor6D23.C1 = CFrame.new(0.5, 1.98828626, 0.906443715, -2.77555783e-16, 0, 1, -0.999840677, -0.0178508721, -2.77511552e-16, 0.0178508721, -0.999840677, 4.95461293e-18)
  444. Motor6D23.Part0 = Part19
  445. Motor6D23.Part1 = Part9
  446. Motor6D23.part1 = Part9
  447. Motor6D24.Name = "Left Shoulder"
  448. Motor6D24.Parent = Part19
  449. Motor6D24.MaxVelocity = 0.10000000149012
  450. Motor6D24.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  451. Motor6D24.C1 = CFrame.new(0.49999994, 0.499999762, 1.11758702e-07, 0.973111331, -0.0208345987, -0.229391053, -0.116172016, -0.904347897, -0.410681158, -0.198892906, 0.426287234, -0.882451594)
  452. Motor6D24.Part0 = Part19
  453. Motor6D24.Part1 = Part15
  454. Motor6D24.part1 = Part15
  455. Motor6D25.Name = "Right Shoulder"
  456. Motor6D25.Parent = Part19
  457. Motor6D25.MaxVelocity = 0.10000000149012
  458. Motor6D25.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  459. Motor6D25.C1 = CFrame.new(0.762441993, -0.593848407, -0.772536874, -3.55271326e-15, -1.65585857e-15, 1, 0.466082782, -0.884741008, 1.90852524e-16, 0.884741008, 0.466082782, 3.91499941e-15)
  460. Motor6D25.Part0 = Part19
  461. Motor6D25.Part1 = Part13
  462. Motor6D25.part1 = Part13
  463. SpecialMesh26.Parent = Part19
  464. SpecialMesh26.MeshId = "http://www.roblox.com/asset/?id=53422030 "
  465. SpecialMesh26.Scale = Vector3.new(2.5, 2.5, 2.5)
  466. SpecialMesh26.TextureId = "http://www.roblox.com/asset/?id=189963280"
  467. SpecialMesh26.MeshType = Enum.MeshType.FileMesh
  468. Script27.Name = "GhostAbominationTargetScript"
  469. Script27.Parent = Model0
  470. table.insert(cors,sandbox(Script27,function()
  471. local GhostAbominationMainScript = script;
  472. local GhostAbomination = GhostAbominationMainScript.Parent;
  473. local Head = GhostAbomination:FindFirstChild("Head");
  474. local HumanoidRootPart = GhostAbomination:FindFirstChild("HumanoidRootPart");
  475. local LeftArm = GhostAbomination:FindFirstChild("Left Arm");
  476. local LeftLeg = GhostAbomination:FindFirstChild("Left Leg");
  477. local RightArm = GhostAbomination:FindFirstChild("Right Arm");
  478. local RightLeg = GhostAbomination:FindFirstChild("Right Leg");
  479. local Torso = GhostAbomination:FindFirstChild("Torso");
  480. local GhostAbominationHumanoid = GhostAbomination:FindFirstChild("Humanoid");
  481. local RechargeTime = 0;
  482. for GhostAbominationHealthCheck = 1,5 do
  483. GhostAbominationHumanoid.Health = GhostAbominationHumanoid.MaxHealth
  484. Wait(0)
  485. end
  486. local SpawnForceField = Instance.new("ForceField")
  487. SpawnForceField.Name = "SpawnForceField"
  488. SpawnForceField.Parent = GhostAbomination
  489. function FindTargetToTerrorise(TargetPosition)
  490. local PlayerList = Game.Workspace:children();
  491. local TargetTorso = nil;
  492. local VisibleDistance = 99999e99999;
  493. local TempTargetModel = nil;
  494. local TargetHumanoid = nil;
  495. local TargetModel = nil;
  496. for Check = 1, #PlayerList do
  497. TargetModel = PlayerList[Check]
  498. if (TargetModel.className == "Model") and (TargetModel ~= GhostAbomination) and (TargetModel.Name ~= GhostAbomination.Name) and (TargetModel.Name ~= "Stranger") and (TargetModel.Name ~= "Twitcher") and (TargetModel.Name ~= "HandCrab") and (TargetModel.Name ~= "David Leatherhoff") then
  499. TempTargetModel = TargetModel:FindFirstChild("Torso")
  500. TargetHumanoid = TargetModel:FindFirstChild("Humanoid")
  501. if (TempTargetModel ~= nil) and (TargetHumanoid ~= nil) and (TargetHumanoid.Health > 0) then
  502. if (TempTargetModel.Position - TargetPosition).magnitude < VisibleDistance then
  503. TargetTorso = TempTargetModel
  504. VisibleDistance = (TempTargetModel.Position - TargetPosition).magnitude
  505. end
  506. end
  507. end
  508. end
  509. return TargetTorso
  510. end
  511. Wait(5)
  512. for GhostAbominationHealthCheck = 1,5 do
  513. GhostAbominationHumanoid.Health = GhostAbominationHumanoid.MaxHealth
  514. Wait(0)
  515. end
  516. HumanoidRootPart.Anchored = false
  517. SpawnForceField:Destroy()
  518. while true do
  519. Wait(0)
  520. if GhostAbominationHumanoid.Health == 0 or GhostAbominationHumanoid.Health < 0 then
  521. GhostAbominationHumanoid.WalkSpeed = 0
  522. Head:FindFirstChild("slv_die"):Play()
  523. GhostAbomination["GhostAbominationAnimationScript"].Disabled = true
  524. GhostAbomination["GhostAbominationMeleeAttackScript"].Disabled = true
  525. GhostAbomination["GhostAbominationTargetScript"].Disabled = true
  526. Wait(5)
  527. GhostAbomination:Destroy()
  528. end
  529. local GhostAbominationChosenTarget = FindTargetToTerrorise(Torso.Position);
  530. if GhostAbominationHumanoid.Sit==true then
  531. GhostAbominationHumanoid.Jump=true
  532. end
  533. if GhostAbominationHumanoid.PlatformStand==true then
  534. GhostAbominationHumanoid.Jump=true
  535. end
  536. if GhostAbominationChosenTarget ~= nil then
  537. --[[GhostAbominationHumanoid:MoveTo(GhostAbominationChosenTarget.Position, GhostAbominationChosenTarget)]]--
  538. GhostAbominationRadiusXAxis = math.random(-2,2)
  539. GhostAbominationRadiusYAxis = math.random(-2,2)
  540. GhostAbominationRadiusZAxis = math.random(-2,2)
  541. GhostAbominationHumanoid:MoveTo(GhostAbominationChosenTarget.Position+Vector3.new(GhostAbominationRadiusXAxis,GhostAbominationRadiusYAxis,GhostAbominationRadiusZAxis), GhostAbominationChosenTarget)
  542. end
  543. end
  544. end))
  545. BodyColors28.Parent = Model0
  546. BodyColors28.HeadColor = BrickColor.new("Pastel brown")
  547. BodyColors28.HeadColor3 = Color3.new(1, 0.8, 0.6)
  548. BodyColors28.LeftArmColor = BrickColor.new("Really black")
  549. BodyColors28.LeftArmColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
  550. BodyColors28.LeftLegColor = BrickColor.new("Really black")
  551. BodyColors28.LeftLegColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
  552. BodyColors28.RightArmColor = BrickColor.new("Really black")
  553. BodyColors28.RightArmColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
  554. BodyColors28.RightLegColor = BrickColor.new("Really black")
  555. BodyColors28.RightLegColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
  556. BodyColors28.TorsoColor = BrickColor.new("Really black")
  557. BodyColors28.TorsoColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
  558. Script29.Name = "GhostAbominationMeleeAttackScript"
  559. Script29.Parent = Model0
  560. table.insert(cors,sandbox(Script29,function()
  561. local GhostAbominationMainScript = script;
  562. local GhostAbomination = GhostAbominationMainScript.Parent;
  563. local Head = GhostAbomination:FindFirstChild("Head");
  564. local HumanoidRootPart = GhostAbomination:FindFirstChild("HumanoidRootPart");
  565. local LeftArm = GhostAbomination:FindFirstChild("Left Arm");
  566. local LeftLeg = GhostAbomination:FindFirstChild("Left Leg");
  567. local RightArm = GhostAbomination:FindFirstChild("Right Arm");
  568. local RightLeg = GhostAbomination:FindFirstChild("Right Leg");
  569. local Torso = GhostAbomination:FindFirstChild("Torso");
  570. local RechargeTime = 0;
  571. function FindTargetToTerrorise(TargetPosition)
  572. local PlayerList = Game.Workspace:children();
  573. local TargetTorso = nil;
  574. local AttackDistance = 4;
  575. local TempTargetModel = nil;
  576. local TargetHumanoid = nil;
  577. local TargetModel = nil;
  578. for Check = 1, #PlayerList do
  579. TargetModel = PlayerList[Check]
  580. if (TargetModel.className == "Model") and (TargetModel ~= GhostAbomination) and (TargetModel.Name ~= GhostAbomination.Name) and (TargetModel.Name ~= "Stranger") and (TargetModel.Name ~= "Twitcher") and (TargetModel.Name ~= "HandCrab") and (TargetModel.Name ~= "David Leatherhoff") then
  581. TempTargetModel = TargetModel:findFirstChild("Torso")
  582. TargetHumanoid = TargetModel:findFirstChild("Humanoid")
  583. if (TempTargetModel ~= nil) and (TargetHumanoid ~= nil) and (TargetHumanoid.Health > 0) then
  584. if (TempTargetModel.Position - TargetPosition).magnitude < AttackDistance then
  585. TargetTorso = TempTargetModel
  586. AttackDistance = (TempTargetModel.Position - TargetPosition).magnitude
  587. end
  588. end
  589. end
  590. end
  591. return TargetTorso
  592. end
  593. while true do
  594. Wait(0)
  595. if RechargeTime > 0 then
  596. RechargeTime = RechargeTime - 1
  597. end
  598. local GhostAbominationChosenTarget = FindTargetToTerrorise(Torso.Position);
  599. if GhostAbominationChosenTarget ~= nil then
  600. local GhostAbominationDamage = 5
  601. local GhostAbominationHumanoid = GhostAbomination:FindFirstChild("Humanoid")
  602. local GhostAbominationCloseAttackAnimation = GhostAbominationHumanoid:LoadAnimation(GhostAbomination.SmackAnim);
  603. GhostAbominationCloseAttackAnimation:Play()
  604. GhostAbominationHumanoid.WalkSpeed = 0
  605. GhostAbominationChosenTarget.Parent.Humanoid:TakeDamage(GhostAbominationDamage)
  606. if not Game.Players:FindFirstChild(GhostAbominationChosenTarget.Parent.Name) then
  607. GhostAbominationChosenTarget.Parent.Humanoid:TakeDamage(GhostAbominationDamage)
  608. end
  609. if Game.Players:FindFirstChild(GhostAbominationChosenTarget.Parent.Name) then
  610. if not Game.Players:FindFirstChild(GhostAbominationChosenTarget.Parent.Name).PlayerGui:FindFirstChild("PoisenedGui") then
  611. local PoisenedGui = script:FindFirstChild("PoisenedGui"):Clone()
  612. PoisenedGui.Parent = Game.Players:FindFirstChild(GhostAbominationChosenTarget.Parent.Name).PlayerGui
  613. PoisenedGui.PoisenScript.Disabled = false
  614. else
  615. GhostAbominationChosenTarget.Parent.Humanoid:TakeDamage(GhostAbominationDamage)
  616. end
  617. end
  618. Wait(0.75)
  619. GhostAbominationHumanoid.WalkSpeed = 10
  620. Wait(2)
  621. end
  622. end
  623. end))
  624. ScreenGui30.Name = "PoisenedGui"
  625. ScreenGui30.Parent = Script29
  626. Script31.Name = "PoisenScript"
  627. Script31.Parent = ScreenGui30
  628. table.insert(cors,sandbox(Script31,function()
  629. --[[By: Brutez.]]--
  630. local CurrentCamera = Game.Workspace.CurrentCamera;
  631. local PoisendGui = script.Parent;
  632. local LocalPlayer = PoisendGui.Parent.Parent.Character;
  633. local LocalPlayerHumanoid = LocalPlayer:FindFirstChild("Humanoid");
  634. repeat Wait(0) until LocalPlayerHumanoid ~= nil
  635. PoisendGui:FindFirstChild("ear_ringing"):Play()
  636. for PlayerHurt = 1,6 do
  637. LocalPlayerHumanoid:TakeDamage(5)
  638. Wait(2)
  639. end
  640. for Fade = 1,5 do
  641. PoisendGui:FindFirstChild("RedFrame").BackgroundTransparency = PoisendGui:FindFirstChild("RedFrame").BackgroundTransparency+0.1
  642. Wait(0)
  643. end
  644. PoisendGui:Destroy()
  645. --[[By: Brutez.]]--
  646. end))
  647. Script31.Disabled = true
  648. Sound32.Name = "ear_ringing"
  649. Sound32.Parent = ScreenGui30
  650. Sound32.SoundId = "rbxassetid://189925130"
  651. Sound32.Volume = 10
  652. Frame33.Name = "RedFrame"
  653. Frame33.Parent = ScreenGui30
  654. Frame33.Size = UDim2.new(2, 0, 2, 0)
  655. Frame33.BackgroundColor = BrickColor.new("Really red")
  656. Frame33.BackgroundColor3 = Color3.new(1, 0, 0.0156863)
  657. Frame33.BackgroundTransparency = 0.5
  658. Frame33.BorderColor = BrickColor.new("Really red")
  659. Frame33.BorderColor3 = Color3.new(1, 0, 0.0156863)
  660. Script34.Name = "GhostHeadSoundScript"
  661. Script34.Parent = Model0
  662. table.insert(cors,sandbox(Script34,function()
  663. --[[ By: Brutez ]]--
  664. local Ghost = script.Parent;
  665. local GhostHead = Ghost:FindFirstChild("Head");
  666. local SelectedSoundID = {209120567, 209120562};
  667. local SelectedSounds = {};
  668. for SelectedSound=1,#SelectedSoundID do
  669. local GhostHeadSound = Instance.new("Sound")
  670. GhostHeadSound.SoundId = "rbxassetid://" .. SelectedSoundID[SelectedSound]
  671. GhostHeadSound.Volume = 1
  672. GhostHeadSound.Parent = GhostHead
  673. SelectedSounds[#SelectedSounds + 1] = GhostHeadSound
  674. --[[Sound Appearence]]--
  675. if GhostHeadSound.SoundId == "rbxassetid://209120567" then--
  676. GhostHeadSound.Name = "slv_alert10"
  677. end
  678. if GhostHeadSound.SoundId == "rbxassetid://209120562" then--
  679. GhostHeadSound.Name = "slv_alert20"
  680. end
  681. --[[Sound Appearence]]--
  682. end
  683. while true do
  684. Wait(0)
  685. GhostRandomSound=math.random(1,1000)
  686. if GhostRandomSound==10 or GhostRandomSound==20 or GhostRandomSound==30 then
  687. local SelectedSound = math.random(1, #SelectedSounds)
  688. local SelectedSoundClone=SelectedSounds[SelectedSound]:Clone()
  689. SelectedSoundClone.Parent = GhostHead
  690. SelectedSoundClone.Pitch = 1 + (math.random() * 0.05)
  691. SelectedSoundClone:Play()
  692. SelectedSoundClone:Destroy()
  693. end
  694. end
  695. --[[ By: Brutez ]]--
  696. end))
  697. Script35.Name = "GhostHurtSoundScript"
  698. Script35.Parent = Model0
  699. table.insert(cors,sandbox(Script35,function()
  700. local TwitcherHurtScript = script;
  701. local Twitcher = TwitcherHurtScript.Parent;
  702. local TwitcherHumanoid = Twitcher:FindFirstChild("Humanoid");
  703. local TwitcherHead = Twitcher:FindFirstChild("Head");
  704. local HurtEnable = true;
  705. function HurtSound(HumanoidData)
  706. if HurtEnable==false then return end
  707. if TwitcherHumanoid.Health<0 or TwitcherHumanoid.Health==0 then return end
  708. HurtEnable = false;
  709. local TwitcherHurtSoundList = {"zo_pain1", "zo_pain2"};
  710. local SelectedHurtSound = TwitcherHead[math.random(1, #TwitcherHurtSoundList)];
  711. SelectedHurtSound:Play()
  712. Wait(0.5)
  713. HurtEnable = true;
  714. end
  715. TwitcherHumanoid.HealthChanged:connect(HurtSound)
  716. end))
  717. Script36.Name = "AnimateSauce"
  718. Script36.Parent = Model0
  719. table.insert(cors,sandbox(Script36,function()
  720. function waitForChild(parent, childName)
  721. local child = parent:findFirstChild(childName)
  722. if child then return child end
  723. while true do
  724. child = parent.ChildAdded:wait()
  725. if child.Name==childName then return child end
  726. end
  727. end
  728. local Figure = script.Parent
  729. local Torso = waitForChild(Figure, "Torso")
  730. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  731. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  732. local RightHip = waitForChild(Torso, "Right Hip")
  733. local LeftHip = waitForChild(Torso, "Left Hip")
  734. local Neck = waitForChild(Torso, "Neck")
  735. local Humanoid;
  736. for _,Child in pairs(Figure:GetChildren())do
  737. if Child and Child.ClassName=="Humanoid"then
  738. Humanoid=Child;
  739. end;
  740. end;
  741. local pose = "Standing"
  742. local currentAnim = ""
  743. local currentAnimInstance = nil
  744. local currentAnimTrack = nil
  745. local currentAnimKeyframeHandler = nil
  746. local currentAnimSpeed = 1.0
  747. local animTable = {}
  748. local animNames = {
  749. idle = {
  750. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  751. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  752. },
  753. walk = {
  754. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  755. },
  756. run = {
  757. { id = "run.xml", weight = 10 }
  758. },
  759. jump = {
  760. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  761. },
  762. fall = {
  763. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  764. },
  765. climb = {
  766. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  767. },
  768. sit = {
  769. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  770. },
  771. toolnone = {
  772. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  773. },
  774. toolslash = {
  775. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  776. --{ id = "slash.xml", weight = 10 }
  777. },
  778. toollunge = {
  779. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  780. },
  781. wave = {
  782. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  783. },
  784. point = {
  785. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  786. },
  787. dance1 = {
  788. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  789. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  790. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  791. },
  792. dance2 = {
  793. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  794. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  795. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  796. },
  797. dance3 = {
  798. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  799. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  800. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  801. },
  802. laugh = {
  803. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  804. },
  805. cheer = {
  806. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  807. },
  808. }
  809. local dances = {"dance1", "dance2", "dance3"}
  810.  
  811. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  812. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  813.  
  814. function configureAnimationSet(name, fileList)
  815. if (animTable[name] ~= nil) then
  816. for _, connection in pairs(animTable[name].connections) do
  817. connection:disconnect()
  818. end
  819. end
  820. animTable[name] = {}
  821. animTable[name].count = 0
  822. animTable[name].totalWeight = 0
  823. animTable[name].connections = {}
  824.  
  825. -- check for config values
  826. local config = script:FindFirstChild(name)
  827. if (config ~= nil) then
  828. --print("Loading anims " .. name)
  829. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  830. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  831. local idx = 1
  832. for _, childPart in pairs(config:GetChildren()) do
  833. if (childPart:IsA("Animation")) then
  834. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  835. animTable[name][idx] = {}
  836. animTable[name][idx].anim = childPart
  837. local weightObject = childPart:FindFirstChild("Weight")
  838. if (weightObject == nil) then
  839. animTable[name][idx].weight = 1
  840. else
  841. animTable[name][idx].weight = weightObject.Value
  842. end
  843. animTable[name].count = animTable[name].count + 1
  844. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  845. --print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  846. idx = idx + 1
  847. end
  848. end
  849. end
  850.  
  851. -- fallback to defaults
  852. if (animTable[name].count <= 0) then
  853. for idx, anim in pairs(fileList) do
  854. animTable[name][idx] = {}
  855. animTable[name][idx].anim = Instance.new("Animation")
  856. animTable[name][idx].anim.Name = name
  857. animTable[name][idx].anim.AnimationId = anim.id
  858. animTable[name][idx].weight = anim.weight
  859. animTable[name].count = animTable[name].count + 1
  860. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  861. --print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  862. end
  863. end
  864. end
  865.  
  866. -- Setup animation objects
  867. function scriptChildModified(child)
  868. local fileList = animNames[child.Name]
  869. if (fileList ~= nil) then
  870. configureAnimationSet(child.Name, fileList)
  871. end
  872. end
  873.  
  874. script.ChildAdded:connect(scriptChildModified)
  875. script.ChildRemoved:connect(scriptChildModified)
  876.  
  877.  
  878. for name, fileList in pairs(animNames) do
  879. configureAnimationSet(name, fileList)
  880. end
  881.  
  882. -- ANIMATION
  883.  
  884. -- declarations
  885. local toolAnim = "None"
  886. local toolAnimTime = 0
  887.  
  888. local jumpAnimTime = 0
  889. local jumpAnimDuration = 0.3
  890.  
  891. local toolTransitionTime = 0.1
  892. local fallTransitionTime = 0.3
  893. local jumpMaxLimbVelocity = 0.75
  894.  
  895. -- functions
  896.  
  897. function stopAllAnimations()
  898. local oldAnim = currentAnim
  899.  
  900. -- return to idle if finishing an emote
  901. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  902. oldAnim = "idle"
  903. end
  904.  
  905. currentAnim = ""
  906. currentAnimInstance = nil
  907. if (currentAnimKeyframeHandler ~= nil) then
  908. currentAnimKeyframeHandler:disconnect()
  909. end
  910.  
  911. if (currentAnimTrack ~= nil) then
  912. currentAnimTrack:Stop()
  913. currentAnimTrack:Destroy()
  914. currentAnimTrack = nil
  915. end
  916. return oldAnim
  917. end
  918.  
  919. function setAnimationSpeed(speed)
  920. if speed ~= currentAnimSpeed then
  921. currentAnimSpeed = speed
  922. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  923. end
  924. end
  925.  
  926. function keyFrameReachedFunc(frameName)
  927. if (frameName == "End") then
  928.  
  929. local repeatAnim = currentAnim
  930. -- return to idle if finishing an emote
  931. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  932. repeatAnim = "idle"
  933. end
  934.  
  935. local animSpeed = currentAnimSpeed
  936. playAnimation(repeatAnim, 0.0, Humanoid)
  937. setAnimationSpeed(animSpeed)
  938. end
  939. end
  940.  
  941. -- Preload animations
  942. function playAnimation(animName, transitionTime, humanoid)
  943.  
  944. local roll = math.random(1, animTable[animName].totalWeight)
  945. local origRoll = roll
  946. local idx = 1
  947. while (roll > animTable[animName][idx].weight) do
  948. roll = roll - animTable[animName][idx].weight
  949. idx = idx + 1
  950. end
  951. --print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  952. local anim = animTable[animName][idx].anim
  953.  
  954. -- switch animation
  955. if (anim ~= currentAnimInstance) then
  956.  
  957. if (currentAnimTrack ~= nil) then
  958. currentAnimTrack:Stop(transitionTime)
  959. currentAnimTrack:Destroy()
  960. end
  961.  
  962. currentAnimSpeed = 1.0
  963.  
  964. -- load it to the humanoid; get AnimationTrack
  965. currentAnimTrack = humanoid:LoadAnimation(anim)
  966.  
  967. -- play the animation
  968. currentAnimTrack:Play(transitionTime)
  969. currentAnim = animName
  970. currentAnimInstance = anim
  971.  
  972. -- set up keyframe name triggers
  973. if (currentAnimKeyframeHandler ~= nil) then
  974. currentAnimKeyframeHandler:disconnect()
  975. end
  976. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  977.  
  978. end
  979.  
  980. end
  981.  
  982. -------------------------------------------------------------------------------------------
  983. -------------------------------------------------------------------------------------------
  984.  
  985. local toolAnimName = ""
  986. local toolAnimTrack = nil
  987. local toolAnimInstance = nil
  988. local currentToolAnimKeyframeHandler = nil
  989.  
  990. function toolKeyFrameReachedFunc(frameName)
  991. if (frameName == "End") then
  992. --print("Keyframe : ".. frameName)
  993. playToolAnimation(toolAnimName, 0.0, Humanoid)
  994. end
  995. end
  996.  
  997.  
  998. function playToolAnimation(animName, transitionTime, humanoid)
  999.  
  1000. local roll = math.random(1, animTable[animName].totalWeight)
  1001. local origRoll = roll
  1002. local idx = 1
  1003. while (roll > animTable[animName][idx].weight) do
  1004. roll = roll - animTable[animName][idx].weight
  1005. idx = idx + 1
  1006. end
  1007. --print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1008. local anim = animTable[animName][idx].anim
  1009.  
  1010. if (toolAnimInstance ~= anim) then
  1011.  
  1012. if (toolAnimTrack ~= nil) then
  1013. toolAnimTrack:Stop()
  1014. toolAnimTrack:Destroy()
  1015. transitionTime = 0
  1016. end
  1017.  
  1018. -- load it to the humanoid; get AnimationTrack
  1019. toolAnimTrack = humanoid:LoadAnimation(anim)
  1020.  
  1021. -- play the animation
  1022. toolAnimTrack:Play(transitionTime)
  1023. toolAnimName = animName
  1024. toolAnimInstance = anim
  1025.  
  1026. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1027. end
  1028. end
  1029.  
  1030. function stopToolAnimations()
  1031. local oldAnim = toolAnimName
  1032.  
  1033. if (currentToolAnimKeyframeHandler ~= nil) then
  1034. currentToolAnimKeyframeHandler:disconnect()
  1035. end
  1036.  
  1037. toolAnimName = ""
  1038. toolAnimInstance = nil
  1039. if (toolAnimTrack ~= nil) then
  1040. toolAnimTrack:Stop()
  1041. toolAnimTrack:Destroy()
  1042. toolAnimTrack = nil
  1043. end
  1044.  
  1045.  
  1046. return oldAnim
  1047. end
  1048.  
  1049. -------------------------------------------------------------------------------------------
  1050. -------------------------------------------------------------------------------------------
  1051.  
  1052.  
  1053. function onRunning(speed)
  1054. if speed>0.01 then
  1055. playAnimation("walk", 0.1, Humanoid)
  1056. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  1057. setAnimationSpeed(speed / 14.5)
  1058. end
  1059. pose = "Running"
  1060. else
  1061. playAnimation("idle", 0.1, Humanoid)
  1062. pose = "Standing"
  1063. end
  1064. end
  1065.  
  1066. function onDied()
  1067. pose = "Dead"
  1068. end
  1069.  
  1070. function onJumping()
  1071. playAnimation("jump", 0.1, Humanoid)
  1072. jumpAnimTime = jumpAnimDuration
  1073. pose = "Jumping"
  1074. end
  1075.  
  1076. function onClimbing(speed)
  1077. playAnimation("climb", 0.1, Humanoid)
  1078. setAnimationSpeed(speed / 12.0)
  1079. pose = "Climbing"
  1080. end
  1081.  
  1082. function onGettingUp()
  1083. pose = "GettingUp"
  1084. end
  1085.  
  1086. function onFreeFall()
  1087. if (jumpAnimTime <= 0) then
  1088. playAnimation("fall", fallTransitionTime, Humanoid)
  1089. end
  1090. pose = "FreeFall"
  1091. end
  1092.  
  1093. function onFallingDown()
  1094. pose = "FallingDown"
  1095. end
  1096.  
  1097. function onSeated()
  1098. pose = "Seated"
  1099. end
  1100.  
  1101. function onPlatformStanding()
  1102. pose = "PlatformStanding"
  1103. end
  1104.  
  1105. function onSwimming(speed)
  1106. if speed>0 then
  1107. pose = "Running"
  1108. else
  1109. pose = "Standing"
  1110. end
  1111. end
  1112.  
  1113. function getTool()
  1114. for _, kid in ipairs(Figure:GetChildren()) do
  1115. if kid.className == "Tool" then return kid end
  1116. end
  1117. return nil
  1118. end
  1119.  
  1120. function getToolAnim(tool)
  1121. for _, c in ipairs(tool:GetChildren()) do
  1122. if c.Name == "toolanim" and c.className == "StringValue" then
  1123. return c
  1124. end
  1125. end
  1126. return nil
  1127. end
  1128.  
  1129. function animateTool()
  1130.  
  1131. if (toolAnim == "None") then
  1132. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1133. return
  1134. end
  1135.  
  1136. if (toolAnim == "Slash") then
  1137. playToolAnimation("toolslash", 0, Humanoid)
  1138. return
  1139. end
  1140.  
  1141. if (toolAnim == "Lunge") then
  1142. playToolAnimation("toollunge", 0, Humanoid)
  1143. return
  1144. end
  1145. end
  1146.  
  1147. function moveSit()
  1148. RightShoulder.MaxVelocity = 0.15
  1149. LeftShoulder.MaxVelocity = 0.15
  1150. RightShoulder:SetDesiredAngle(3.14 /2)
  1151. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1152. RightHip:SetDesiredAngle(3.14 /2)
  1153. LeftHip:SetDesiredAngle(-3.14 /2)
  1154. end
  1155.  
  1156. local lastTick = 0
  1157.  
  1158. function move(time)
  1159. local amplitude = 1
  1160. local frequency = 1
  1161. local deltaTime = time - lastTick
  1162. lastTick = time
  1163.  
  1164. local climbFudge = 0
  1165. local setAngles = false
  1166.  
  1167. if (jumpAnimTime > 0) then
  1168. jumpAnimTime = jumpAnimTime - deltaTime
  1169. end
  1170.  
  1171. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1172. playAnimation("fall", fallTransitionTime, Humanoid)
  1173. elseif (pose == "Seated") then
  1174. playAnimation("sit", 0.5, Humanoid)
  1175. return
  1176. elseif (pose == "Running") then
  1177. playAnimation("walk", 0.1, Humanoid)
  1178. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1179. --print("Wha " .. pose)
  1180. stopAllAnimations()
  1181. amplitude = 0.1
  1182. frequency = 1
  1183. setAngles = true
  1184. end
  1185.  
  1186. if (setAngles) then
  1187. local desiredAngle = amplitude * math.sin(time * frequency)
  1188. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1189. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1190. RightHip:SetDesiredAngle(-desiredAngle)
  1191. LeftHip:SetDesiredAngle(-desiredAngle)
  1192. end
  1193.  
  1194. -- Tool Animation handling
  1195. local tool = getTool()
  1196. if tool and tool:FindFirstChild("Handle") then
  1197.  
  1198. animStringValueObject = getToolAnim(tool)
  1199.  
  1200. if animStringValueObject then
  1201. toolAnim = animStringValueObject.Value
  1202. -- message recieved, delete StringValue
  1203. animStringValueObject.Parent = nil
  1204. toolAnimTime = time + .3
  1205. end
  1206.  
  1207. if time > toolAnimTime then
  1208. toolAnimTime = 0
  1209. toolAnim = "None"
  1210. end
  1211.  
  1212. animateTool()
  1213. else
  1214. stopToolAnimations()
  1215. toolAnim = "None"
  1216. toolAnimInstance = nil
  1217. toolAnimTime = 0
  1218. end
  1219. end
  1220.  
  1221. -- connect events
  1222. Humanoid.Died:connect(onDied)
  1223. Humanoid.Running:connect(onRunning)
  1224. Humanoid.Jumping:connect(onJumping)
  1225. Humanoid.Climbing:connect(onClimbing)
  1226. Humanoid.GettingUp:connect(onGettingUp)
  1227. Humanoid.FreeFalling:connect(onFreeFall)
  1228. Humanoid.FallingDown:connect(onFallingDown)
  1229. Humanoid.Seated:connect(onSeated)
  1230. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1231. Humanoid.Swimming:connect(onSwimming)
  1232. local runService = game:service("RunService");
  1233. -- initialize to idle
  1234. playAnimation("idle", 0.1, Humanoid);
  1235. pose = "Standing";
  1236. while Wait(0)do
  1237. move(0);
  1238. end;
  1239. end))
  1240. StringValue37.Name = "climb"
  1241. StringValue37.Parent = Script36
  1242. Animation38.Name = "ClimbAnim"
  1243. Animation38.Parent = StringValue37
  1244. Animation38.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  1245. StringValue39.Name = "fall"
  1246. StringValue39.Parent = Script36
  1247. Animation40.Name = "FallAnim"
  1248. Animation40.Parent = StringValue39
  1249. Animation40.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  1250. StringValue41.Name = "idle"
  1251. StringValue41.Parent = Script36
  1252. Animation42.Name = "Animation1"
  1253. Animation42.Parent = StringValue41
  1254. Animation42.AnimationId = "rbxassetid://1341345663"
  1255. NumberValue43.Name = "Weight"
  1256. NumberValue43.Parent = Animation42
  1257. NumberValue43.Value = 9
  1258. Animation44.Name = "Animation2"
  1259. Animation44.Parent = StringValue41
  1260. Animation44.AnimationId = "rbxassetid://1341345663"
  1261. NumberValue45.Name = "Weight"
  1262. NumberValue45.Parent = Animation44
  1263. NumberValue45.Value = 1
  1264. StringValue46.Name = "jump"
  1265. StringValue46.Parent = Script36
  1266. Animation47.Name = "JumpAnim"
  1267. Animation47.Parent = StringValue46
  1268. Animation47.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1269. StringValue48.Name = "run"
  1270. StringValue48.Parent = Script36
  1271. Animation49.Name = "RunAnim"
  1272. Animation49.Parent = StringValue48
  1273. Animation49.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1274. StringValue50.Name = "sit"
  1275. StringValue50.Parent = Script36
  1276. Animation51.Name = "SitAnim"
  1277. Animation51.Parent = StringValue50
  1278. Animation51.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  1279. StringValue52.Name = "toolnone"
  1280. StringValue52.Parent = Script36
  1281. Animation53.Name = "ToolNoneAnim"
  1282. Animation53.Parent = StringValue52
  1283. Animation53.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  1284. StringValue54.Name = "walk"
  1285. StringValue54.Parent = Script36
  1286. Animation55.Name = "WalkAnim"
  1287. Animation55.Parent = StringValue54
  1288. Animation55.AnimationId = "rbxassetid://1341351335"
  1289. Script56.Name = "Health"
  1290. Script56.Parent = Model0
  1291. table.insert(cors,sandbox(Script56,function()
  1292. --Responsible for regening a player's humanoid's health
  1293.  
  1294. -- declarations
  1295. local Figure = script.Parent
  1296. local Head = Figure:WaitForChild("Head")
  1297. local Humanoid;
  1298. for _,Child in pairs(Figure:GetChildren())do
  1299. if Child and Child.ClassName=="Humanoid"then
  1300. Humanoid=Child;
  1301. end;
  1302. end;
  1303. local regening = false
  1304.  
  1305. -- regeneration
  1306. function regenHealth()
  1307. if regening then return end
  1308. regening = true
  1309.  
  1310. while Humanoid.Health < Humanoid.MaxHealth do
  1311. local s = wait(1)
  1312. local health = Humanoid.Health
  1313. if health > 0 and health < Humanoid.MaxHealth then
  1314. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  1315. health = health + newHealthDelta
  1316. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  1317. end
  1318. end
  1319.  
  1320. if Humanoid.Health > Humanoid.MaxHealth then
  1321. Humanoid.Health = Humanoid.MaxHealth
  1322. end
  1323.  
  1324. regening = false
  1325. end
  1326.  
  1327. Humanoid.HealthChanged:connect(regenHealth)
  1328.  
  1329. end))
  1330. Animation57.Name = "SmackAnim"
  1331. Animation57.Parent = Model0
  1332. Animation57.AnimationId = "rbxassetid://1341364247"
  1333. Camera58.Name = "ThumbnailCamera"
  1334. Camera58.Parent = Model0
  1335. Camera58.CFrame = CFrame.new(21.1681595, 1.88080251, -60.4921494, -0.999440372, -0.00384576037, -0.0332317129, -0, 0.993370414, -0.114958383, 0.0334535018, -0.114894047, -0.992814302)
  1336. Camera58.CoordinateFrame = CFrame.new(21.1681595, 1.88080251, -60.4921494, -0.999440372, -0.00384576037, -0.0332317129, -0, 0.993370414, -0.114958383, 0.0334535018, -0.114894047, -0.992814302)
  1337. Camera58.FieldOfView = 49
  1338. Camera58.Focus = CFrame.new(21.234623, 2.11071944, -58.5065193, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1339. Camera58.focus = CFrame.new(21.234623, 2.11071944, -58.5065193, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1340. for i,v in pairs(mas:GetChildren()) do
  1341. v.Parent = workspace
  1342. pcall(function() v:MakeJoints() end)
  1343. end
  1344. mas:Destroy()
  1345. for i,v in pairs(cors) do
  1346. spawn(function()
  1347. pcall(v)
  1348. end)
  1349. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement