Advertisement
sIendytubble

meerkat script

Jun 30th, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.70 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  51. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then
  95. return typeof(s[k])=="function"
  96. and function(_,...)return s[k](s,...)end or s[k]
  97. end
  98. end,
  99. __newindex = function(self,k,v)
  100. local s = rawget(self,"_RealService")
  101. if s then s[k]=v end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return rawget(self,s) or _rg:GetService(s)
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. RunService = FakeService({
  120. _btrs = {},
  121. RenderStepped = _rg:GetService("RunService").Heartbeat,
  122. BindToRenderStep = function(self,name,_,fun)
  123. self._btrs[name] = self.Heartbeat:Connect(fun)
  124. end,
  125. UnbindFromRenderStep = function(self,name)
  126. self._btrs[name]:Disconnect()
  127. end,
  128. },"RunService")
  129. }
  130. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  131. g.service = g.GetService
  132. FakeService(g,game)
  133. --Changing owner to fake player object to support owner:GetMouse()
  134. game,owner = g,g.Players.LocalPlayer
  135. end
  136. mas = game.Players.LocalPlayer.Character
  137. Model0 = mas
  138. Part1 = mas["Left Leg"]
  139. SpecialMesh2 = Instance.new("SpecialMesh")
  140. Part3 = mas.Head
  141. Part4 = Instance.new("Part")
  142. SpecialMesh5 = Instance.new("SpecialMesh")
  143. Part6 = mas["Left Arm"]
  144. SpecialMesh7 = Instance.new("SpecialMesh")
  145. Part8 = mas["Right Leg"]
  146. SpecialMesh9 = Instance.new("SpecialMesh")
  147. Part10 = mas["Right Arm"]
  148. SpecialMesh11 = Instance.new("SpecialMesh")
  149. Part12 = mas.Torso
  150. Motor6D13 = Instance.new("Motor6D")
  151. Motor6D14 = mas.Torso["Right Hip"]
  152. Motor6D15 = mas.Torso["Left Shoulder"]
  153. Motor6D16 = mas.Torso["Left Hip"]
  154. Motor6D17 = mas.Torso["Right Shoulder"]
  155. Motor6D18 = mas.Torso.Neck
  156. Motor6D19 = Instance.new("Motor6D")
  157. Motor6D20 = Instance.new("Motor6D")
  158. Part21 = Instance.new("Part")
  159. Humanoid22 = mas.Humanoid
  160. BoolValue23 = Instance.new("BoolValue")
  161. Hat24 = Instance.new("Hat")
  162. Part25 = Instance.new("Part")
  163. SpecialMesh26 = Instance.new("SpecialMesh")
  164. Part1.Name = "Left Leg"
  165. Part1.Parent = Model0
  166. Part1.CFrame = CFrame.new(17.2121964, 16.1186256, -9.75573063, 0.635850847, 1.08027291e-06, -0.771811903, 1.15979674e-07, 0.99999994, 1.49520736e-06, 0.771811843, -1.04024332e-06, 0.635850906)
  167. Part1.Orientation = Vector3.new(0, -50.5200005, 0)
  168. Part1.Position = Vector3.new(17.2121964, 16.1186256, -9.75573063)
  169. Part1.Rotation = Vector3.new(0, -50.5200005, 0)
  170. Part1.Size = Vector3.new(0.25, 1.25, 0.5)
  171. Part1.CanCollide = false
  172. Part1.Locked = true
  173. Part1.FormFactor = Enum.FormFactor.Custom
  174. Part1.formFactor = Enum.FormFactor.Custom
  175. SpecialMesh2.Parent = Part1
  176. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=266560838"
  177. SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
  178. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=266561345"
  179. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  180. Part3.Name = "Head"
  181. Part3.Parent = Model0
  182. Part3.CFrame = CFrame.new(17.4359951, 17.6584492, -9.2796402, 0.619189262, -4.49773086e-13, -0.785241783, 8.30163954e-13, 1, 8.18289121e-14, 0.785241783, -7.02547016e-13, 0.619189262)
  183. Part3.Orientation = Vector3.new(0, -51.7400017, 0)
  184. Part3.Position = Vector3.new(17.4359951, 17.6584492, -9.2796402)
  185. Part3.Rotation = Vector3.new(0, -51.7400017, 0)
  186. Part3.Transparency = 1
  187. Part3.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  188. Part3.Locked = true
  189. Part3.FormFactor = Enum.FormFactor.Custom
  190. Part3.formFactor = Enum.FormFactor.Custom
  191. Part4.Name = "Body"
  192. Part4.Parent = Model0
  193. Part4.CFrame = CFrame.new(16.5804119, 17.4637737, -8.63537407, 0.635850847, 1.50406515e-06, -0.771811903, 8.61748717e-08, 0.99999994, 2.01974035e-06, 0.771811843, -1.35076436e-06, 0.635850906)
  194. Part4.Orientation = Vector3.new(0, -50.5200005, 0)
  195. Part4.Position = Vector3.new(16.5804119, 17.4637737, -8.63537407)
  196. Part4.Rotation = Vector3.new(0, -50.5200005, 0)
  197. Part4.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  198. Part4.CanCollide = false
  199. Part4.Locked = true
  200. Part4.FormFactor = Enum.FormFactor.Custom
  201. Part4.formFactor = Enum.FormFactor.Custom
  202. SpecialMesh5.Parent = Part4
  203. SpecialMesh5.MeshId = "http://www.roblox.com/asset/?id=266561157"
  204. SpecialMesh5.Scale = Vector3.new(0.5, 0.5, 0.5)
  205. SpecialMesh5.TextureId = "http://www.roblox.com/asset/?id=266561345"
  206. SpecialMesh5.MeshType = Enum.MeshType.FileMesh
  207. Part6.Name = "Left Arm"
  208. Part6.Parent = Model0
  209. Part6.CFrame = CFrame.new(17.2508888, 17.5350361, -9.66650486, 0.627557099, 1.75614434e-06, -0.778570533, 1.10329182e-07, 0.99999994, 2.34453046e-06, 0.778570473, -1.5572258e-06, 0.627557158)
  210. Part6.Orientation = Vector3.new(0, -51.1300011, 0)
  211. Part6.Position = Vector3.new(17.2508888, 17.5350361, -9.66650486)
  212. Part6.Rotation = Vector3.new(0, -51.1300011, 0)
  213. Part6.Size = Vector3.new(0.25, 1.25, 0.5)
  214. Part6.CanCollide = false
  215. Part6.Locked = true
  216. Part6.FormFactor = Enum.FormFactor.Custom
  217. Part6.formFactor = Enum.FormFactor.Custom
  218. SpecialMesh7.Parent = Part6
  219. SpecialMesh7.MeshId = "http://www.roblox.com/asset/?id=266560959"
  220. SpecialMesh7.Scale = Vector3.new(0.5, 0.5, 0.5)
  221. SpecialMesh7.TextureId = "http://www.roblox.com/asset/?id=266561345"
  222. SpecialMesh7.MeshType = Enum.MeshType.FileMesh
  223. Part8.Name = "Right Leg"
  224. Part8.Parent = Model0
  225. Part8.CFrame = CFrame.new(17.7828827, 16.1219273, -9.04141808, 0.627539039, -0.00457659597, -0.778571546, 0.0072960481, 0.999973357, 2.66000688e-06, 0.778550744, -0.00568217319, 0.627555907)
  226. Part8.Orientation = Vector3.new(0, -51.1300011, 0.419999987)
  227. Part8.Position = Vector3.new(17.7828827, 16.1219273, -9.04141808)
  228. Part8.Rotation = Vector3.new(0, -51.1300011, 0.419999987)
  229. Part8.Size = Vector3.new(0.25, 1.25, 0.5)
  230. Part8.CanCollide = false
  231. Part8.Locked = true
  232. Part8.FormFactor = Enum.FormFactor.Custom
  233. Part8.formFactor = Enum.FormFactor.Custom
  234. SpecialMesh9.Parent = Part8
  235. SpecialMesh9.MeshId = "http://www.roblox.com/asset/?id=266560749"
  236. SpecialMesh9.Scale = Vector3.new(0.5, 0.5, 0.5)
  237. SpecialMesh9.TextureId = "http://www.roblox.com/asset/?id=266561345"
  238. SpecialMesh9.MeshType = Enum.MeshType.FileMesh
  239. Part10.Name = "Right Arm"
  240. Part10.Parent = Model0
  241. Part10.CFrame = CFrame.new(17.7250576, 17.5346718, -9.08602715, 0.635850966, 1.63900916e-06, -0.771811783, 8.61745093e-08, 0.99999994, 2.19458093e-06, 0.771811724, -1.4619369e-06, 0.635851026)
  242. Part10.Orientation = Vector3.new(0, -50.5200005, 0)
  243. Part10.Position = Vector3.new(17.7250576, 17.5346718, -9.08602715)
  244. Part10.Rotation = Vector3.new(0, -50.5200005, 0)
  245. Part10.Size = Vector3.new(0.25, 1.25, 0.5)
  246. Part10.CanCollide = false
  247. Part10.Locked = true
  248. Part10.FormFactor = Enum.FormFactor.Custom
  249. Part10.formFactor = Enum.FormFactor.Custom
  250. SpecialMesh11.Parent = Part10
  251. SpecialMesh11.MeshId = "http://www.roblox.com/asset/?id=266560893"
  252. SpecialMesh11.Scale = Vector3.new(0.5, 0.5, 0.5)
  253. SpecialMesh11.TextureId = "http://www.roblox.com/asset/?id=266561345"
  254. SpecialMesh11.MeshType = Enum.MeshType.FileMesh
  255. Part12.Name = "Torso"
  256. Part12.Parent = Model0
  257. Part12.CFrame = CFrame.new(17.4359951, 17.6584492, -9.2796402, 0.619188428, -9.39329663e-21, -0.785242438, -1.92308264e-21, 1, -1.34786997e-20, 0.785242438, 9.85594101e-21, 0.619188428)
  258. Part12.Orientation = Vector3.new(0, -51.7400017, 0)
  259. Part12.Position = Vector3.new(17.4359951, 17.6584492, -9.2796402)
  260. Part12.Rotation = Vector3.new(0, -51.7400017, 0)
  261. Part12.Transparency = 1
  262. Part12.Size = Vector3.new(0.200000003, 1.75625002, 2.375)
  263. Part12.Locked = true
  264. Part12.FormFactor = Enum.FormFactor.Custom
  265. Part12.formFactor = Enum.FormFactor.Custom
  266. Motor6D13.Name = "Body"
  267. Motor6D13.Parent = Part12
  268. Motor6D13.MaxVelocity = 0.050000000745058
  269. Motor6D13.C0 = CFrame.new(0, 0, 0, 0.0213997271, 3.06415657e-08, 0.999770999, 1.5828283e-06, -1, -3.23126903e-09, 0.999770999, 1.58253499e-06, -0.0213997271)
  270. Motor6D13.C1 = CFrame.new(0.0467713252, 0.194677427, -1.07000661, -3.87429452e-07, -8.9406754e-08, 0.99999994, -4.36912018e-07, -0.99999994, -8.94069245e-08, 1, -4.36912046e-07, 3.87429424e-07)
  271. Motor6D13.Part0 = Part12
  272. Motor6D13.Part1 = Part4
  273. Motor6D13.part1 = Part4
  274. Motor6D14.Name = "Right Hip"
  275. Motor6D14.Parent = Part12
  276. Motor6D14.MaxVelocity = 0.050000000745058
  277. Motor6D14.C0 = CFrame.new(-0.832447231, -0.91957283, -1.13750124, -4.37113883e-08, 0, 1, 1, -5.20548554e-07, 4.37113883e-08, 5.20548554e-07, 1, 2.27539003e-14)
  278. Motor6D14.C1 = CFrame.new(-1.27993977, 0.431621701, 0.0624997243, 0.00729590282, 0.0107000563, 0.999916136, 0.999973416, -7.92443752e-05, -0.00729547208, 1.16229057e-06, 0.99994278, -0.0107003497)
  279. Motor6D14.Part0 = Part4
  280. Motor6D14.Part1 = Part8
  281. Motor6D14.part1 = Part8
  282. Motor6D15.Name = "Left Shoulder"
  283. Motor6D15.Parent = Part12
  284. Motor6D15.MaxVelocity = 0.050000000745058
  285. Motor6D15.C0 = CFrame.new(-0.0772239119, 0.536951065, -1.17000008, -3.93402502e-07, 0, 1, 1.50995803e-07, -1, 5.94021224e-14, 1, 1.50995803e-07, 3.93402502e-07)
  286. Motor6D15.C1 = CFrame.new(0.292308807, 0.465685844, 0, 0.0106982943, -9.35213351e-10, 0.99994278, -1.74840551e-07, -1, 9.3533592e-10, 0.99994278, -1.74840551e-07, -0.0106982943)
  287. Motor6D15.Part0 = Part4
  288. Motor6D15.Part1 = Part6
  289. Motor6D15.part1 = Part6
  290. Motor6D15.DesiredAngle = -0.1130875647068
  291. Motor6D16.Name = "Left Hip"
  292. Motor6D16.Parent = Part12
  293. Motor6D16.MaxVelocity = 0.050000000745058
  294. Motor6D16.C0 = CFrame.new(-1.31953633, -0.899812698, -1.20000076, 2.48389142e-14, 4.37113883e-08, 1, 1, -5.68248083e-07, 0, 5.68248083e-07, 1, -4.37113883e-08)
  295. Motor6D16.C1 = CFrame.new(-0.856552124, 0.445333481, 0, 2.98048271e-08, 4.37076224e-08, 1, 1, -4.37150582e-08, -2.98048235e-08, 4.37150582e-08, 1, -4.37076224e-08)
  296. Motor6D16.Part0 = Part4
  297. Motor6D16.Part1 = Part1
  298. Motor6D16.part1 = Part1
  299. Motor6D17.Name = "Right Shoulder"
  300. Motor6D17.Parent = Part12
  301. Motor6D17.MaxVelocity = 0.050000000745058
  302. Motor6D17.C0 = CFrame.new(0.327462971, 0.531036377, -1.17000008, 2.18556949e-07, 3.82137093e-15, 1, 8.74227766e-08, -1, -1.52854837e-14, 1, 8.74227766e-08, -2.18556949e-07)
  303. Motor6D17.C1 = CFrame.new(-0.0525417328, 0.460136414, 0, 4.37088445e-08, -3.82092963e-15, 1, -8.74177744e-08, -1, 2.1448709e-22, 1, -8.74177744e-08, -4.37088445e-08)
  304. Motor6D17.Part0 = Part4
  305. Motor6D17.Part1 = Part10
  306. Motor6D17.part1 = Part10
  307. Motor6D17.DesiredAngle = 0.1130875647068
  308. Motor6D18.Name = "Neck"
  309. Motor6D18.Parent = Part12
  310. Motor6D18.MaxVelocity = 0.050000000745058
  311. Motor6D18.C0 = CFrame.new(0, 0, 0, 1, -5.53446503e-13, 6.85963641e-07, 5.53446449e-13, 1, 5.44569544e-14, -6.85963641e-07, -5.44565749e-14, 1)
  312. Motor6D18.C1 = CFrame.new(0, 0, -0, 1, 2.76717532e-13, -3.58160548e-07, -2.76717505e-13, 1, -2.73716766e-14, 3.58160548e-07, 2.73717765e-14, 1)
  313. Motor6D18.Part0 = Part12
  314. Motor6D18.Part1 = Part3
  315. Motor6D18.part1 = Part3
  316. Motor6D19.Name = "NeckPart"
  317. Motor6D19.Parent = Part12
  318. Motor6D19.MaxVelocity = 0.050000000745058
  319. Motor6D19.C0 = CFrame.new(-0.0350734144, 0.907989502, -1.21914947, 4.80827566e-07, 2.08616186e-07, -1, -1, -4.37417498e-08, -4.80827566e-07, -4.37418493e-08, 1, 2.08616186e-07)
  320. Motor6D19.C1 = CFrame.new(-0.0351963751, 0.854220927, -1.17417181, -4.37036007e-08, 3.87430021e-07, -1, -1, -4.37442438e-08, 4.37035865e-08, -4.3744226e-08, 1, 3.87430049e-07)
  321. Motor6D19.Part0 = Part4
  322. Motor6D19.Part1 = Part21
  323. Motor6D19.part1 = Part21
  324. Motor6D20.Name = "FakeNeck"
  325. Motor6D20.Parent = Part12
  326. Motor6D20.MaxVelocity = 0.014999999664724
  327. Motor6D20.C0 = CFrame.new(0.0123147964, 1.33133173, -1.11855698, 0.99999994, 2.98238945e-07, -5.95013141e-08, -5.96421685e-08, 0.000472270971, -0.999999881, -2.98210836e-07, 0.99999994, 0.000472271)
  328. Motor6D20.C1 = CFrame.new(0.0121087888, 0.15480186, 0.126358256, 0.99999994, 2.98482973e-07, -8.9237659e-08, -8.95195811e-08, 0.000944573316, -0.999999464, -2.98398618e-07, 0.999999464, 0.000944573141)
  329. Motor6D20.Part0 = Part21
  330. Motor6D20.Part1 = Part25
  331. Motor6D20.part1 = Part25
  332. Part21.Name = "Neck"
  333. Part21.Parent = Model0
  334. Part21.CFrame = CFrame.new(16.6152039, 17.5175419, -8.66387844, 0.635850728, 1.17054333e-06, -0.771812022, 6.10706309e-07, 0.99999994, 2.01974262e-06, 0.771811962, -1.75560524e-06, 0.635850787)
  335. Part21.Orientation = Vector3.new(0, -50.5200005, 0)
  336. Part21.Position = Vector3.new(16.6152039, 17.5175419, -8.66387844)
  337. Part21.Rotation = Vector3.new(0, -50.5200005, 0)
  338. Part21.Transparency = 1
  339. Part21.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  340. Part21.CanCollide = false
  341. Part21.Locked = true
  342. Part21.FormFactor = Enum.FormFactor.Custom
  343. Part21.formFactor = Enum.FormFactor.Custom
  344. Humanoid22.Parent = Model0
  345. Humanoid22.LeftLeg = Part1
  346. Humanoid22.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  347. Humanoid22.RightLeg = Part8
  348. Humanoid22.Torso = Part12
  349. Humanoid22.WalkSpeed = 18
  350. BoolValue23.Name = "Standing"
  351. BoolValue23.Parent = Model0
  352. BoolValue23.Value = true
  353. Hat24.Parent = Model0
  354. Part25.Name = "FakeHead"
  355. Part25.Parent = Model0
  356. Part25.CFrame = CFrame.new(17.5762329, 18.694128, -9.45534801, 0.635850668, -0.000363377127, -0.771811903, 6.40442693e-07, 0.999999702, -0.000470282539, 0.771811843, 0.000298535364, 0.635850668)
  357. Part25.Orientation = Vector3.new(0.0299999993, -50.5200005, 0)
  358. Part25.Position = Vector3.new(17.5762329, 18.694128, -9.45534801)
  359. Part25.Rotation = Vector3.new(0.0399999991, -50.5200005, 0.0299999993)
  360. Part25.Size = Vector3.new(0.75, 0.75, 0.75)
  361. Part25.CanCollide = false
  362. Part25.Locked = true
  363. Part25.FormFactor = Enum.FormFactor.Custom
  364. Part25.formFactor = Enum.FormFactor.Custom
  365. SpecialMesh26.Parent = Part25
  366. SpecialMesh26.MeshId = "http://www.roblox.com/asset/?id=266561002"
  367. SpecialMesh26.Scale = Vector3.new(0.5, 0.5, 0.5)
  368. SpecialMesh26.TextureId = "http://www.roblox.com/asset/?id=266561345"
  369. SpecialMesh26.MeshType = Enum.MeshType.FileMesh
  370. --Made by Luckymaxer
  371.  
  372. Figure = mas
  373.  
  374. RunService = game:GetService("RunService")
  375.  
  376. Creator = Figure:FindFirstChild("Creator")
  377. Standing = Figure:WaitForChild("Standing")
  378. Target = Figure:FindFirstChild("Target")
  379.  
  380. Humanoid = Figure:WaitForChild("Humanoid")
  381. Head = Figure:WaitForChild("Head")
  382. FakeHead = Figure:FindFirstChild("FakeHead")
  383. Neck = Figure:FindFirstChild("Neck")
  384. Torso = Figure:WaitForChild("Torso")
  385.  
  386. NeckPart = Torso:FindFirstChild("NeckPart")
  387. Body = Torso:FindFirstChild("Body")
  388.  
  389. Neck = Torso:FindFirstChild("FakeNeck")
  390. LeftShoulder = Torso:WaitForChild("Left Shoulder")
  391. RightShoulder = Torso:WaitForChild("Right Shoulder")
  392. LeftHip = Torso:WaitForChild("Left Hip")
  393. RightHip = Torso:WaitForChild("Right Hip")
  394.  
  395. for i, v in pairs({Neck, LeftShoulder, RightShoulder, LeftHip, RightHip}) do
  396. if v and v.Parent then
  397. v.DesiredAngle = 0
  398. v.CurrentAngle = 0
  399. end
  400. end
  401.  
  402. Pose = "None"
  403. LastPose = Pose
  404. PoseTime = 0
  405. StandTime = 0
  406.  
  407. function SetPose(pose)
  408. LastPose = Pose
  409. Pose = pose
  410. PoseTime = tick()
  411. end
  412.  
  413. function MonitorDead()
  414. for i, v in pairs({FakeHead, Neck, NeckPart, Body, Neck}) do
  415. if not v or not v.Parent then
  416. Humanoid:ChangeState(Enum.HumanoidStateType.Dead)
  417. return true
  418. end
  419. end
  420. return false
  421. end
  422.  
  423. function MonitorRunningPose()
  424. local Speed = (Torso.Velocity * Vector3.new(1, 0, 1)).Magnitude
  425. local Now = tick()
  426. local MinSpeed = 5
  427. if Speed >= MinSpeed or (Target and Target.Value) then
  428. Standing.Value = false
  429. elseif Speed < MinSpeed and (Now - StandTime) > 1.5 then
  430. Standing.Value = true
  431. end
  432. end
  433.  
  434. function OnRunning(Speed)
  435. if Speed > 0 then
  436. SetPose("Running")
  437. else
  438. SetPose("Standing")
  439. end
  440. end
  441.  
  442. function OnDied()
  443. SetPose("Dead")
  444. end
  445.  
  446. function OnJumping()
  447. SetPose("Jumping")
  448. end
  449.  
  450. function OnClimbing()
  451. SetPose("Climbing")
  452. end
  453.  
  454. function OnGettingUp()
  455. SetPose("GettingUp")
  456. end
  457.  
  458. function OnFreeFall()
  459. SetPose("FreeFall")
  460. end
  461.  
  462. function OnFallingDown()
  463. SetPose("FallingDown")
  464. end
  465.  
  466. function OnSeated()
  467. SetPose("Seated")
  468. end
  469.  
  470. function OnPlatformStanding()
  471. SetPose("PlatformStanding")
  472. end
  473.  
  474. function OnSwimming(Speed)
  475. return OnRunning(Speed)
  476. end
  477.  
  478. function MoveJump()
  479. if not Standing.Value then
  480. LeftShoulder.DesiredAngle = (math.pi / 2)
  481. RightShoulder.DesiredAngle = (math.pi / 2)
  482. LeftHip.DesiredAngle = (math.pi / 2)
  483. RightHip.DesiredAngle = (math.pi / 2)
  484. else
  485. LeftShoulder.DesiredAngle = (math.pi / 1.25)
  486. RightShoulder.DesiredAngle = (math.pi / 1.25)
  487. LeftHip.DesiredAngle = 0
  488. RightHip.DesiredAngle = 0
  489. end
  490. end
  491.  
  492. function MoveFreeFall()
  493. RightShoulder.DesiredAngle = 0.5
  494. LeftShoulder.DesiredAngle = -0.5
  495. RightHip.DesiredAngle = -0.5
  496. LeftHip.DesiredAngle = 0.5
  497. end
  498.  
  499. function MoveSit()
  500. RightShoulder.DesiredAngle = (math.pi / 2)
  501. LeftShoulder.DesiredAngle = (math.pi / 2)
  502. RightHip.DesiredAngle = (math.pi / 2)
  503. LeftHip.DesiredAngle = (math.pi / 2)
  504. end
  505.  
  506. function Move(Time)
  507. local LimbAmplitude
  508. local LimbFrequency
  509. local NeckAmplitude
  510. local NeckFrequency
  511. local NeckDesiredAngle
  512.  
  513. if (Pose == "Jumping") then
  514. MoveJump()
  515. return
  516. elseif (Pose == "FreeFall") then
  517. MoveFreeFall()
  518. return
  519. elseif (Pose == "Seated") then
  520. MoveSit()
  521. return
  522. end
  523.  
  524. local ClimbFudge = 0
  525.  
  526. if (Pose == "Running") then
  527. LimbAmplitude = 1
  528. LimbFrequency = 9
  529. NeckAmplitude = 0
  530. NeckFrequency = 0
  531. NeckDesiredAngle = 0
  532. if Creator and Creator.Value and Creator.Value:IsA("Player") and Creator.Value.Character then
  533. local CreatorCharacter = Creator.Value.Character
  534. local CreatorHead = CreatorCharacter:FindFirstChild("Head")
  535. if CreatorHead then
  536. local TargetPosition = CreatorHead.Position
  537. local Direction = Torso.CFrame.lookVector
  538. local HeadPosition = Head.Position
  539. NeckDesiredAngle = ((((HeadPosition - TargetPosition).Unit):Cross(Direction)).Y / 4)
  540. end
  541. end
  542. elseif (Pose == "Climbing") then
  543. LimbAmplitude = 1
  544. LimbFrequency = 9
  545. NeckAmplitude = 0
  546. NeckFrequency = 0
  547. NeckDesiredAngle = 0
  548. ClimbFudge = math.pi
  549. else
  550. LimbAmplitude = 0.125
  551. LimbFrequency = 2.25
  552. NeckAmplitude = ((not Standing.Value and 0.5) or 0)
  553. NeckFrequency = ((not Standing.Value and 1.25) or 0)
  554. end
  555.  
  556. NeckDesiredAngle = ((not NeckDesiredAngle and (NeckAmplitude * math.sin(Time * NeckFrequency))) or NeckDesiredAngle)
  557. LimbDesiredAngle1 = ((LimbAmplitude * math.sin(Time * LimbFrequency)) + ((not Standing.Value and (math.pi / 2)) or 0))
  558. LimbDesiredAngle2 = ((LimbAmplitude * -math.sin(Time * LimbFrequency)) + ((not Standing.Value and (math.pi / 2)) or 0))
  559.  
  560. Neck.DesiredAngle = NeckDesiredAngle
  561. RightShoulder.DesiredAngle = (LimbDesiredAngle1 + ClimbFudge)
  562. LeftShoulder.DesiredAngle = (LimbDesiredAngle2 + ClimbFudge)
  563. RightHip.DesiredAngle = ((not Standing.Value and LimbDesiredAngle2) or 0)
  564. LeftHip.DesiredAngle = ((not Standing.Value and LimbDesiredAngle1) or 0)
  565.  
  566. end
  567.  
  568. function SetStandPose()
  569. if Standing.Value then
  570. Body.DesiredAngle = 0
  571. NeckPart.DesiredAngle = 0
  572. Body.C0 = (CFrame.new(0, 0, 0) * CFrame.Angles(Body.C0:toEulerAnglesXYZ()))
  573. else
  574. NeckPart.DesiredAngle = -1
  575. Body.DesiredAngle = -(math.pi / 2)
  576. Body.C0 = (CFrame.new(0, -0.9, 0) * CFrame.Angles(Body.C0:toEulerAnglesXYZ()))
  577. end
  578. end
  579.  
  580. if MonitorDead() then
  581. return
  582. end
  583.  
  584. SetStandPose()
  585. Standing.Changed:connect(SetStandPose)
  586.  
  587. Humanoid.Died:connect(OnDied)
  588. Humanoid.Running:connect(OnRunning)
  589. Humanoid.Jumping:connect(OnJumping)
  590. Humanoid.Climbing:connect(OnClimbing)
  591. Humanoid.GettingUp:connect(OnGettingUp)
  592. Humanoid.FreeFalling:connect(OnFreeFall)
  593. Humanoid.FallingDown:connect(OnFallingDown)
  594. Humanoid.Seated:connect(OnSeated)
  595. Humanoid.PlatformStanding:connect(OnPlatformStanding)
  596. Humanoid.Swimming:connect(OnSwimming)
  597.  
  598. Humanoid:ChangeState(Enum.HumanoidStateType.None)
  599.  
  600. RunService.Stepped:connect(function()
  601. local _, Time = wait(0.1)
  602. MonitorRunningPose()
  603. MonitorDead()
  604. Move(Time)
  605. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement