Advertisement
DarkSideYT123

Untitled

Aug 5th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.82 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()}
  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. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) 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 self[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. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126.  
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144.  
  145.  
  146. --// Shortcut Variables \\--
  147. wait(1)
  148. can = true
  149. local S = setmetatable({},{__index = function(s,i) return game:service(i) end})
  150. local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ}
  151. local C3 = {N=Color3.new,RGB=Color3.fromRGB,HSV=Color3.fromHSV,tHSV=Color3.toHSV}
  152. local V3 = {N=Vector3.new,FNI=Vector3.FromNormalId,A=Vector3.FromAxis}
  153. local M = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge,RRNG = function(min,max,div) return math.rad(math.random(min,max)/(div or 1)) end}
  154. local R3 = {N=Region3.new}
  155. local De = S.Debris
  156. local WS = workspace
  157. local Lght = S.Lighting
  158. local RepS = S.ReplicatedStorage
  159. local IN = Instance.new
  160. local Plrs = S.Players
  161. local Mode = "Neutral"
  162. local ModeN = 1
  163.  
  164. local Emit = IN("ParticleEmitter").Emit;
  165.  
  166. --// Initializing \\--
  167. local Plr = game.Players.LocalPlayer
  168. local Char = Plr.Character
  169. local Hum = Char:FindFirstChildOfClass'Humanoid'
  170. local RArm = Char["Right Arm"]
  171. local LArm = Char["Left Arm"]
  172. local RLeg = Char["Right Leg"]
  173. local LLeg = Char["Left Leg"]
  174. local Root = Char:FindFirstChild'HumanoidRootPart'
  175. local Torso = Char.Torso
  176. local Head = Char:WaitForChild("Head")
  177. local NeutralAnims = true
  178. local Attack = false
  179. local Debounces = {Debounces={}}
  180. local Hit = {}
  181. local Sine = 0
  182. local Change = 1
  183.  
  184. Cooldown = false
  185.  
  186. local Effects = IN("Folder",Char)
  187. Effects.Name = "Effects"
  188. Times = 0
  189. repeat
  190. wait(0.1)
  191. Times = Times + 1
  192. if Char:FindFirstChildOfClass("Accessory") then
  193. Char:FindFirstChildOfClass("Accessory"):Destroy()
  194. end
  195. until Times == 5
  196.  
  197. Char.Head.Transparency = 1
  198. Char.Head.face.Transparency = 1
  199. Char["Left Leg"].BrickColor = BrickColor.new("Really black")
  200. Char["Right Arm"].Material = "Neon"
  201. Char["Left Arm"].Material = "Neon"
  202. Char["Right Leg"].Material = "Neon"
  203. Char["Left Leg"].Material = "Neon"
  204. Char["Torso"].Material = "Neon"
  205.  
  206. Char.HumanoidRootPart.Anchored = true
  207. Char.HumanoidRootPart.Orientation = Vector3.new(0,0,0)
  208. wait(1)
  209. Char.HumanoidRootPart.Anchored = false
  210. local FakeHead = Instance.new("Part", Char)
  211. FakeHead.Name = "FakeHead"
  212. FakeHead.Material = "Neon"
  213. FakeHead.BrickColor = BrickColor.new("Institutional white")
  214. FakeHead.Size = Vector3.new(1.104, 1, 1)
  215. FakeHead.Position = Char.Head.Position
  216. local FakeHeadWeld = Instance.new("Weld", Char)
  217. FakeHeadWeld.Name = "FakeHeadWeld"
  218. FakeHeadWeld.Part0 = Char.Head
  219. FakeHeadWeld.Part1 = FakeHead
  220. local TopHat1 = Instance.new("Part", Char)
  221. TopHat1.Name = "TopHead1"
  222. TopHat1.Size = Vector3.new(1.812, 0.232, 1.878)
  223. TopHat1.Anchored = true
  224. TopHat1.Position = FakeHead.Position + Vector3.new(0, 0.5, 0)
  225. TopHat1.BrickColor = BrickColor.new("Really black")
  226. TopHat1.Material = "Neon"
  227. local TopHat1Weld = Instance.new("WeldConstraint", Char)
  228. TopHat1Weld.Name = "TopHat1Weld"
  229. TopHat1Weld.Part0 = FakeHead
  230. TopHat1Weld.Part1 = TopHat1
  231. TopHat1.Anchored = false
  232. local TopHat2 = Instance.new("Part", Char)
  233. TopHat2.Name = "TopHead2"
  234. TopHat2.Size = Vector3.new(1.123, 0.296, 1.164)
  235. TopHat2.Anchored = true
  236. TopHat2.Position = FakeHead.Position + Vector3.new(0, 0.7, 0)
  237. TopHat2.BrickColor = BrickColor.new("Institutional white")
  238. TopHat2.Material = "Neon"
  239. local TopHat2Weld = Instance.new("WeldConstraint", Char)
  240. TopHat2Weld.Name = "TopHat2Weld"
  241. TopHat2Weld.Part0 = FakeHead
  242. TopHat2Weld.Part1 = TopHat2
  243. TopHat2.Anchored = false
  244. local TopHat3 = Instance.new("Part", Char)
  245. TopHat3.Name = "TopHead3"
  246. TopHat3.Size = Vector3.new(1.09, 2.344, 1.13)
  247. TopHat3.Anchored = true
  248. TopHat3.Position = FakeHead.Position + Vector3.new(0, 1.7, 0)
  249. TopHat3.BrickColor = BrickColor.new("Really black")
  250. TopHat3.Material = "Neon"
  251. local TopHat3Weld = Instance.new("WeldConstraint", Char)
  252. TopHat3Weld.Name = "TopHat3Weld"
  253. TopHat3Weld.Part0 = FakeHead
  254. TopHat3Weld.Part1 = TopHat3
  255. TopHat3.Anchored = false
  256. local PortalPart = Instance.new("Part", Char)
  257. PortalPart.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0, 15, 3)
  258. PortalPart.Orientation = Vector3.new(60, 0, 0)
  259. PortalPart.Anchored = true
  260. PortalPart.Transparency = 1
  261. PortalPart.CanCollide = false
  262. PortalPart.Massless = true
  263. local PortalPartWeld = Instance.new("WeldConstraint", Char)
  264. PortalPartWeld.Name = "PortalPartWeld"
  265. PortalPartWeld.Part0 = Char.HumanoidRootPart
  266. PortalPartWeld.Part1 = PortalPart
  267. PortalPart.Anchored = false
  268. local PortalPart2 = Instance.new("Part", Char)
  269. PortalPart2.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0, 15, 3)
  270. PortalPart2.Orientation = Vector3.new(-37.76, 116.57, 50.77)
  271. PortalPart2.Anchored = true
  272. PortalPart2.Transparency = 1
  273. PortalPart2.CanCollide = false
  274. PortalPart2.Massless = true
  275. local PortalPartWeld2 = Instance.new("WeldConstraint", Char)
  276. PortalPartWeld2.Name = "PortalPartWeld2"
  277. PortalPartWeld2.Part0 = Char.HumanoidRootPart
  278. PortalPartWeld2.Part1 = PortalPart2
  279. PortalPart2.Anchored = false
  280. local Name = Instance.new("BillboardGui", TopHat3)
  281. Name.ExtentsOffset = Vector3.new(0, 2, 0)
  282. Name.Size = UDim2.new(0,200,0,100)
  283. local NameText = Instance.new("TextLabel", Name)
  284. NameText.Text = "Mr Void"
  285. NameText.BackgroundTransparency = 1
  286. NameText.Font = Enum.Font.Cartoon
  287. NameText.TextSize = 50
  288. NameText.TextColor3 = Color3.new(500, 500, 500)
  289. NameText.Size = UDim2.new(0,200,0,100)
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299. local ChangeMode = Instance.new("Tool", Plr.Backpack)
  300. ChangeMode.Name = "ChangeMode"
  301. ChangeMode.RequiresHandle = false
  302. ChangeMode.Activated:Connect(function()
  303. if ModeN == 1 then
  304. ModeN = 2
  305. Mode = "Happy"
  306. TopHat2.BrickColor = BrickColor.new("Lime green")
  307. else
  308. if ModeN == 2 then
  309. ModeN = 3
  310. Mode = "Angry"
  311. TopHat2.BrickColor = BrickColor.new("Really red")
  312. else
  313. if ModeN == 3 then
  314. ModeN = 4
  315. Mode = "Necro"
  316. TopHat2.BrickColor = BrickColor.new("Royal purple")
  317. local m = Plr:GetMouse()
  318. m.KeyDown:Connect(function(k)
  319. k:lower()
  320. if k == "f" then
  321. print("f")
  322. end
  323. end)
  324. else
  325.  
  326. end
  327. end
  328. end
  329. end)
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. if Mode == "Neutral" then
  338. local Present = Instance.new("Tool", Plr.Backpack)
  339. Present.Name = "Present"
  340. Present.RequiresHandle = false
  341. Present.Activated:Connect(function()
  342. local Portal = Instance.new("Part", workspace)
  343. Portal.BrickColor = BrickColor.new("Really black")
  344. Portal.Material = "SmoothPlastic"
  345. Portal.Anchored = true
  346. Portal.CanCollide = false
  347. Portal.CFrame = PortalPart.CFrame
  348. Portal.Size = Vector3.new(0.1, 0.05, 0.1)
  349. wait(0.05)
  350. Portal.Orientation = PortalPart.Orientation
  351. Portal.Size = Vector3.new(0.3, 0.05, 0.3)
  352. wait(0.05)
  353. Portal.Orientation = PortalPart2.Orientation
  354. Portal.Size = Vector3.new(0.5, 0.05, 0.5)
  355. wait(0.05)
  356. Portal.Orientation = PortalPart.Orientation
  357. Portal.Size = Vector3.new(0.7, 0.05, 0.7)
  358. wait(0.05)
  359. Portal.Orientation = PortalPart2.Orientation
  360. Portal.Size = Vector3.new(0.9, 0.05, 0.9)
  361. wait(0.05)
  362. Portal.Orientation = PortalPart.Orientation
  363. Portal.Size = Vector3.new(1.4, 0.05, 1.4)
  364. wait(0.05)
  365. Portal.Orientation = PortalPart2.Orientation
  366. Portal.Size = Vector3.new(2, 0.05, 2)
  367. wait(0.05)
  368. Portal.Orientation = PortalPart.Orientation
  369. Portal.Size = Vector3.new(2.5, 0.05, 2.5)
  370. wait(0.05)
  371. Portal.Orientation = PortalPart2.Orientation
  372. Portal.Size = Vector3.new(3.4, 0.05, 3.4)
  373. wait(0.05)
  374. Portal.Orientation = PortalPart.Orientation
  375. Portal.Size = Vector3.new(4.3, 0.05, 4.3)
  376. local Present = Instance.new("Part", workspace)
  377. local Present2 = Instance.new("Part", workspace)
  378. Present2.Anchored = true
  379. Present2.CanCollide = false
  380. Present2.BrickColor = BrickColor.new("Institutional white")
  381. Present2.Material = "Neon"
  382. Present2.Size = Vector3.new(0.5, 2.1, 2.1)
  383. Present2.CFrame = Present.CFrame
  384. local Present2Weld = Instance.new("WeldConstraint", Present2)
  385. Present2Weld.Part0 = Present
  386. Present2Weld.Part1 = Present2
  387. Present2.Anchored = false
  388. local Present3 = Instance.new("Part", workspace)
  389. Present3.Anchored = true
  390. Present3.CanCollide = false
  391. Present3.BrickColor = BrickColor.new("Institutional white")
  392. Present3.Material = "Neon"
  393. Present3.Size = Vector3.new(2.1, 2.1, 0.5)
  394. Present3.CFrame = Present.CFrame
  395. local Present3Weld = Instance.new("WeldConstraint", Present3)
  396. Present3Weld.Part0 = Present
  397. Present3Weld.Part1 = Present3
  398. Present3.Anchored = false
  399. Present.Transparency = 0
  400. Present.CanCollide = true
  401. Present.BrickColor = BrickColor.new("Really black")
  402. Present.Material = "Neon"
  403. Present.Size = Vector3.new(2, 2, 2)
  404.  
  405. local Duh1 = Instance.new("Part", workspace)
  406. Duh1.Anchored = true
  407. Duh1.CanCollide = false
  408. Duh1.Orientation = Vector3.new(0, 0, -40)
  409. Duh1.BrickColor = BrickColor.new("Institutional white")
  410. Duh1.Material = "Neon"
  411. Duh1.Size = Vector3.new(0.336, 2.05, 0.386)
  412. Duh1.Position = Present.Position + Vector3.new(0, 1, 0)
  413. local Duh1Weld = Instance.new("WeldConstraint", Duh1)
  414. Duh1Weld.Part0 = Present
  415. Duh1Weld.Part1 = Duh1
  416. Duh1.Anchored = false
  417. local Duh2 = Instance.new("Part", workspace)
  418. Duh2.Anchored = true
  419. Duh2.CanCollide = false
  420. Duh2.Orientation = Vector3.new(0, 0, 40)
  421. Duh2.BrickColor = BrickColor.new("Institutional white")
  422. Duh2.Material = "Neon"
  423. Duh2.Size = Vector3.new(0.336, 2.05, 0.386)
  424. Duh2.Position = Present.Position + Vector3.new(0, 1, 0)
  425. local Duh2Weld = Instance.new("WeldConstraint", Duh2)
  426. Duh2Weld.Part0 = Present
  427. Duh2Weld.Part1 = Duh2
  428. Duh2.Anchored = false
  429. Present.CFrame = PortalPart.CFrame
  430. Present.Velocity = Char.HumanoidRootPart.CFrame.lookVector * 40
  431. wait(1)
  432. Portal.Orientation = PortalPart2.Orientation
  433. Portal.Size = Vector3.new(5, 0.05, 5)
  434. wait(0.05)
  435. Portal.Orientation = PortalPart.Orientation
  436. Portal.Size = Vector3.new(4.5, 0.05, 4.5)
  437. wait(0.05)
  438. Portal.Orientation = PortalPart.Orientation
  439. Portal.Size = Vector3.new(4, 0.05, 4)
  440. wait(0.05)
  441. Portal.Size = Vector3.new(3, 0.05, 3)
  442. wait(0.05)
  443. Portal.Size = Vector3.new(2, 0.05, 2)
  444. wait(0.05)
  445. Portal:Destroy()
  446. Present.Touched:Connect(function(Something)
  447. if Something.Parent:FindFirstChild("Humanoid") then
  448. if can == true then
  449. Present:Destroy()
  450. Present2:Destroy()
  451. Present3:Destroy()
  452. Duh1:Destroy()
  453. Duh2:Destroy()
  454.  
  455. local Character = Something.parent
  456. end
  457. end
  458. end)
  459. end)
  460. end
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560. --// Instance Creation Functions \\--
  561.  
  562.  
  563. function Part(parent,color,material,size,cframe,anchored,cancollide)
  564. local part = IN("Part")
  565. part.Parent = parent or Char
  566. part[typeof(color) == 'BrickColor' and 'BrickColor' or 'Color'] = color or C3.N(0,0,0)
  567. part.Material = material or Enum.Material.SmoothPlastic
  568. part.TopSurface,part.BottomSurface=10,10
  569. part.Size = size or V3.N(1,1,1)
  570. part.CFrame = cframe or CF.N(0,0,0)
  571. part.CanCollide = cancollide or false
  572. part.Anchored = anchored or false
  573. return part
  574. end
  575.  
  576. function Weld(part0,part1,c0,c1)
  577. local weld = IN("Weld")
  578. weld.Parent = part0
  579. weld.Part0 = part0
  580. weld.Part1 = part1
  581. weld.C0 = c0 or CF.N()
  582. weld.C1 = c1 or CF.N()
  583. return weld
  584. end
  585.  
  586. function Mesh(parent,meshtype,meshid,textid,scale,offset)
  587. local part = IN("SpecialMesh")
  588. part.MeshId = meshid or ""
  589. part.TextureId = textid or ""
  590. part.Scale = scale or V3.N(1,1,1)
  591. part.Offset = offset or V3.N(0,0,0)
  592. part.MeshType = meshtype or Enum.MeshType.Sphere
  593. part.Parent = parent
  594. return part
  595. end
  596.  
  597. NewInstance = function(instance,parent,properties)
  598. local inst = Instance.new(instance)
  599. inst.Parent = parent
  600. if(properties)then
  601. for i,v in next, properties do
  602. pcall(function() inst[i] = v end)
  603. end
  604. end
  605. return inst;
  606. end
  607.  
  608. function Clone(instance,parent,properties)
  609. local inst = instance:Clone()
  610. inst.Parent = parent
  611. if(properties)then
  612. for i,v in next, properties do
  613. pcall(function() inst[i] = v end)
  614. end
  615. end
  616. return inst;
  617. end
  618.  
  619.  
  620.  
  621.  
  622. --// Customization \\--
  623.  
  624. local Frame_Speed = 60;
  625. local WalkSpeed = 16
  626. local DamageColor = BrickColor.new'White'
  627.  
  628. --// Stop animations \\--
  629. for _,v in next, Hum:GetPlayingAnimationTracks() do
  630. v:Stop();
  631. end
  632.  
  633. pcall(game.Destroy,Char:FindFirstChild'Animate')
  634. pcall(game.Destroy,Hum:FindFirstChild'Animator')
  635.  
  636. --// Joints \\--
  637.  
  638. local LS = NewInstance('Motor',Char,{Part0=Torso,Part1=LArm,C0 = CF.N(-1.5,0.5,0),C1 = CF.N(0,.5,0)})
  639. local RS = NewInstance('Motor',Char,{Part0=Torso,Part1=RArm,C0 = CF.N(1.5,0.5,0),C1 = CF.N(0,.5,0)})
  640. local NK = NewInstance('Motor',Char,{Part0=Torso,Part1=Head,C0 = CF.N(0,1.5,0)})
  641. local LH = NewInstance('Motor',Char,{Part0=Torso,Part1=LLeg,C0 = CF.N(-.5,-1,0),C1 = CF.N(0,1,0)})
  642. local RH = NewInstance('Motor',Char,{Part0=Torso,Part1=RLeg,C0 = CF.N(.5,-1,0),C1 = CF.N(0,1,0)})
  643. local RJ = NewInstance('Motor',Char,{Part0=Root,Part1=Torso})
  644.  
  645. local LSC0 = LS.C0
  646. local RSC0 = RS.C0
  647. local NKC0 = NK.C0
  648. local LHC0 = LH.C0
  649. local RHC0 = RH.C0
  650. local RJC0 = RJ.C0
  651.  
  652. --// Artificial HB \\--
  653.  
  654. local ArtificialHB = IN("BindableEvent", script)
  655. ArtificialHB.Name = "Heartbeat"
  656.  
  657. script:WaitForChild("Heartbeat")
  658.  
  659. local tf = 0
  660. local allowframeloss = false
  661. local tossremainder = false
  662. local lastframe = tick()
  663. local frame = 1/Frame_Speed
  664. ArtificialHB:Fire()
  665.  
  666. game:GetService("RunService").Heartbeat:connect(function(s, p)
  667. tf = tf + s
  668. if tf >= frame then
  669. if allowframeloss then
  670. script.Heartbeat:Fire()
  671. lastframe = tick()
  672. else
  673. for i = 1, math.floor(tf / frame) do
  674. ArtificialHB:Fire()
  675. end
  676. lastframe = tick()
  677. end
  678. if tossremainder then
  679. tf = 0
  680. else
  681. tf = tf - frame * math.floor(tf / frame)
  682. end
  683. end
  684. end)
  685.  
  686. function swait(num)
  687. if num == 0 or num == nil then
  688. ArtificialHB.Event:wait()
  689. else
  690. for i = 0, num do
  691. ArtificialHB.Event:wait()
  692. end
  693. end
  694. end
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701. while true do
  702. swait()
  703. Sine = Sine + Change
  704.  
  705. local hitfloor,posfloor = workspace:FindPartOnRay(Ray.new(Root.CFrame.p,((CFrame.new(Root.Position,Root.Position - Vector3.new(0,1,0))).lookVector).unit * (4)), Char)
  706.  
  707. local Walking = (math.abs(Root.Velocity.x) > 1 or math.abs(Root.Velocity.z) > 1)
  708. local State = (Hum.PlatformStand and 'Paralyzed' or Hum.Sit and 'Sit' or not hitfloor and Root.Velocity.y < -1 and "Fall" or not hitfloor and Root.Velocity.y > 1 and "Jump" or hitfloor and Walking and (Hum.WalkSpeed > 24 and "Run" or "Walk") or hitfloor and "Idle")
  709. if(not Effects or not Effects.Parent)then
  710. Effects = IN("Model",Char)
  711. Effects.Name = "Effects"
  712. end
  713. if(State == 'Walk')then
  714. local wsVal = 20 / (Hum.WalkSpeed/16)
  715. local Alpha = math.min(.3 * (Hum.WalkSpeed/8),1)
  716. Change = 3
  717. RH.C1 = RH.C1:lerp(CF.N(0,1,0)*CF.N(0,0-.5*M.C(Sine/wsVal)/2,0+.6*M.C(Sine/wsVal)/2)*CF.A(M.R(15-2*M.C(Sine/wsVal))+-M.S(Sine/wsVal)/2.5,0,0),Alpha)
  718. LH.C1 = LH.C1:lerp(CF.N(0,1,0)*CF.N(0,0+.5*M.C(Sine/wsVal)/2,0-.6*M.C(Sine/wsVal)/2)*CF.A(M.R(15+2*M.C(Sine/wsVal))+M.S(Sine/wsVal)/2.5,0,0),Alpha)
  719. else
  720. RH.C1 = RH.C1:lerp(CF.N(0,1,0),.2)
  721. LH.C1 = LH.C1:lerp(CF.N(0,1,0),.2)
  722. end
  723.  
  724. Hum.WalkSpeed = WalkSpeed
  725.  
  726. if(NeutralAnims)then
  727. if(State == 'Idle')then
  728. local Alpha = .1
  729. Change = .75
  730. RJ.C0 = RJ.C0:lerp(RJC0*CF.N(0+.2*M.C(Sine/12),.2*M.C(Sine/6),0)*CF.A(M.R(-5+5*M.C(Sine/12)),0,0),Alpha)
  731. NK.C0 = NK.C0:lerp(NKC0*CF.A(M.R(-5+5*M.C(Sine/12)),0,0),Alpha)
  732. LS.C0 = LS.C0:lerp(LSC0*CF.N(.25,0,0)*CF.A(M.R(-45),0,M.R(45+5*M.C(Sine/12))),Alpha)
  733. RS.C0 = RS.C0:lerp(RSC0*CF.N(-.25,0,0)*CF.A(M.R(-45),0,M.R(-45-5*M.C(Sine/12))),Alpha)
  734. LH.C0 = LH.C0:lerp(LHC0*CF.N(0-.2*M.C(Sine/12),-.2*M.C(Sine/6),0)*CF.A(M.R(5-5*M.C(Sine/12)),M.R(10),0),Alpha)
  735. RH.C0 = RH.C0:lerp(RHC0*CF.N(0-.2*M.C(Sine/12),-.2*M.C(Sine/6),0)*CF.A(M.R(5-5*M.C(Sine/12)),M.R(-10),0),Alpha)
  736. -- idle
  737. elseif(State == 'Run')then
  738. local wsVal = 20 / (Hum.WalkSpeed/16)
  739. local Alpha = math.min(.2 * (Hum.WalkSpeed/16),1)
  740. RJ.C0 = RJ.C0:lerp(CF.N(0,0-.1*M.C(Sine/(wsVal/2)),0)*CF.A(M.R(-15+2.5*M.C(Sine/(wsVal/2))),M.R(8*M.C(Sine/wsVal)),0),Alpha)
  741. NK.C0 = NK.C0:lerp(NKC0,Alpha)
  742. LS.C0 = LS.C0:lerp(LSC0*CF.N(0,0,0-.3*M.S(Sine/wsVal))*CF.A(M.R(0+45*M.S(Sine/wsVal)),0,M.R(-5)),Alpha)
  743. RS.C0 = RS.C0:lerp(RSC0*CF.N(0,0,0+.3*M.S(Sine/wsVal))*CF.A(M.R(0-45*M.S(Sine/wsVal)),0,M.R(5)),Alpha)
  744. LH.C0 = LH.C0:lerp(LHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha)
  745. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha)
  746. elseif(State == 'Walk')then
  747. local wsVal = 20 / (Hum.WalkSpeed/16)
  748. local Alpha = math.min(.3 * (Hum.WalkSpeed/16),1)
  749. RJ.C0 = RJ.C0:lerp(CF.N(0,0-.1*M.C(Sine/(wsVal/2)),0)*CF.A(M.R(-5-2.5*M.C(Sine/(wsVal/2))),M.R(8*M.C(Sine/wsVal)),0),Alpha)
  750. NK.C0 = NK.C0:lerp(NKC0,Alpha)
  751. LS.C0 = LS.C0:lerp(LSC0*CF.N(0,0,-.22*M.C(Sine/wsVal))*CF.A(M.R(37*M.C(Sine/wsVal)),0,M.R(-5)),Alpha)
  752. RS.C0 = RS.C0:lerp(RSC0*CF.N(0,0,.22*M.C(Sine/wsVal))*CF.A(M.R(-37*M.C(Sine/wsVal)),0,M.R(5)),Alpha)
  753. LH.C0 = LH.C0:lerp(LHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha)
  754. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha)
  755. elseif(State == 'Jump')then
  756. local Alpha = .1
  757. local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90))
  758. LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)),Alpha)
  759. RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)),Alpha)
  760. RJ.C0 = RJ.C0:lerp(RJC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
  761. NK.C0 = NK.C0:lerp(NKC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
  762. LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha)
  763. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha)
  764. elseif(State == 'Fall')then
  765. local Alpha = .1
  766. local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90))
  767. LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha)
  768. RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha)
  769. RJ.C0 = RJ.C0:lerp(RJC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
  770. NK.C0 = NK.C0:lerp(NKC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
  771. LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha)
  772. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha)
  773. elseif(State == 'Paralyzed')then
  774. -- paralyzed
  775. elseif(State == 'Sit')then
  776. -- sit
  777. end
  778. end
  779.  
  780. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement