Advertisement
DarkSideYT123

Untitled

Aug 5th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.84 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. Char.Animate:Destroy()
  185.  
  186. Cooldown = false
  187.  
  188. local Effects = IN("Folder",Char)
  189. Effects.Name = "Effects"
  190. Times = 0
  191. repeat
  192. wait(0.1)
  193. Times = Times + 1
  194. if Char:FindFirstChildOfClass("Accessory") then
  195. Char:FindFirstChildOfClass("Accessory"):Destroy()
  196. end
  197. until Times == 5
  198.  
  199. Char.Head.Transparency = 1
  200. Char.Head.face.Transparency = 1
  201. Char["Left Leg"].BrickColor = BrickColor.new("Really black")
  202. Char["Right Arm"].Material = "Neon"
  203. Char["Left Arm"].Material = "Neon"
  204. Char["Right Leg"].Material = "Neon"
  205. Char["Left Leg"].Material = "Neon"
  206. Char["Torso"].Material = "Neon"
  207.  
  208. Char.HumanoidRootPart.Anchored = true
  209. Char.HumanoidRootPart.Orientation = Vector3.new(0,0,0)
  210. wait(1)
  211. Char.HumanoidRootPart.Anchored = false
  212. local FakeHead = Instance.new("Part", Char)
  213. FakeHead.Name = "FakeHead"
  214. FakeHead.Material = "Neon"
  215. FakeHead.BrickColor = BrickColor.new("Institutional white")
  216. FakeHead.Size = Vector3.new(1.104, 1, 1)
  217. FakeHead.Position = Char.Head.Position
  218. local FakeHeadWeld = Instance.new("Weld", Char)
  219. FakeHeadWeld.Name = "FakeHeadWeld"
  220. FakeHeadWeld.Part0 = Char.Head
  221. FakeHeadWeld.Part1 = FakeHead
  222. local TopHat1 = Instance.new("Part", Char)
  223. TopHat1.Name = "TopHead1"
  224. TopHat1.Size = Vector3.new(1.812, 0.232, 1.878)
  225. TopHat1.Anchored = true
  226. TopHat1.Position = FakeHead.Position + Vector3.new(0, 0.5, 0)
  227. TopHat1.BrickColor = BrickColor.new("Really black")
  228. TopHat1.Material = "Neon"
  229. local TopHat1Weld = Instance.new("WeldConstraint", Char)
  230. TopHat1Weld.Name = "TopHat1Weld"
  231. TopHat1Weld.Part0 = FakeHead
  232. TopHat1Weld.Part1 = TopHat1
  233. TopHat1.Anchored = false
  234. local TopHat2 = Instance.new("Part", Char)
  235. TopHat2.Name = "TopHead2"
  236. TopHat2.Size = Vector3.new(1.123, 0.296, 1.164)
  237. TopHat2.Anchored = true
  238. TopHat2.Position = FakeHead.Position + Vector3.new(0, 0.7, 0)
  239. TopHat2.BrickColor = BrickColor.new("Institutional white")
  240. TopHat2.Material = "Neon"
  241. local TopHat2Weld = Instance.new("WeldConstraint", Char)
  242. TopHat2Weld.Name = "TopHat2Weld"
  243. TopHat2Weld.Part0 = FakeHead
  244. TopHat2Weld.Part1 = TopHat2
  245. TopHat2.Anchored = false
  246. local TopHat3 = Instance.new("Part", Char)
  247. TopHat3.Name = "TopHead3"
  248. TopHat3.Size = Vector3.new(1.09, 2.344, 1.13)
  249. TopHat3.Anchored = true
  250. TopHat3.Position = FakeHead.Position + Vector3.new(0, 1.7, 0)
  251. TopHat3.BrickColor = BrickColor.new("Really black")
  252. TopHat3.Material = "Neon"
  253. local TopHat3Weld = Instance.new("WeldConstraint", Char)
  254. TopHat3Weld.Name = "TopHat3Weld"
  255. TopHat3Weld.Part0 = FakeHead
  256. TopHat3Weld.Part1 = TopHat3
  257. TopHat3.Anchored = false
  258. local PortalPart = Instance.new("Part", Char)
  259. PortalPart.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0, 15, 3)
  260. PortalPart.Orientation = Vector3.new(60, 0, 0)
  261. PortalPart.Anchored = true
  262. PortalPart.Transparency = 1
  263. PortalPart.CanCollide = false
  264. PortalPart.Massless = true
  265. local PortalPartWeld = Instance.new("WeldConstraint", Char)
  266. PortalPartWeld.Name = "PortalPartWeld"
  267. PortalPartWeld.Part0 = Char.HumanoidRootPart
  268. PortalPartWeld.Part1 = PortalPart
  269. PortalPart.Anchored = false
  270. local PortalPart2 = Instance.new("Part", Char)
  271. PortalPart2.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0, 15, 3)
  272. PortalPart2.Orientation = Vector3.new(-37.76, 116.57, 50.77)
  273. PortalPart2.Anchored = true
  274. PortalPart2.Transparency = 1
  275. PortalPart2.CanCollide = false
  276. PortalPart2.Massless = true
  277. local PortalPartWeld2 = Instance.new("WeldConstraint", Char)
  278. PortalPartWeld2.Name = "PortalPartWeld2"
  279. PortalPartWeld2.Part0 = Char.HumanoidRootPart
  280. PortalPartWeld2.Part1 = PortalPart2
  281. PortalPart2.Anchored = false
  282. local Name = Instance.new("BillboardGui", TopHat3)
  283. Name.ExtentsOffset = Vector3.new(0, 2, 0)
  284. Name.Size = UDim2.new(0,200,0,100)
  285. local NameText = Instance.new("TextLabel", Name)
  286. NameText.Text = "Mr Void"
  287. NameText.BackgroundTransparency = 1
  288. NameText.Font = Enum.Font.Cartoon
  289. NameText.TextSize = 50
  290. NameText.TextColor3 = Color3.new(500, 500, 500)
  291. NameText.Size = UDim2.new(0,200,0,100)
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301. local ChangeMode = Instance.new("Tool", Plr.Backpack)
  302. ChangeMode.Name = "ChangeMode"
  303. ChangeMode.RequiresHandle = false
  304. ChangeMode.Activated:Connect(function()
  305. if ModeN == 1 then
  306. ModeN = 2
  307. Mode = "Happy"
  308. TopHat2.BrickColor = BrickColor.new("Lime green")
  309. else
  310. if ModeN == 2 then
  311. ModeN = 3
  312. Mode = "Angry"
  313. TopHat2.BrickColor = BrickColor.new("Really red")
  314. else
  315. if ModeN == 3 then
  316. ModeN = 4
  317. Mode = "Necro"
  318. TopHat2.BrickColor = BrickColor.new("Royal purple")
  319. local m = Plr:GetMouse()
  320. m.KeyDown:Connect(function(k)
  321. k:lower()
  322. if k == "f" then
  323. print("f")
  324. end
  325. end)
  326. else
  327.  
  328. end
  329. end
  330. end
  331. end)
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339. if Mode == "Neutral" then
  340. local Present = Instance.new("Tool", Plr.Backpack)
  341. Present.Name = "Present"
  342. Present.RequiresHandle = false
  343. Present.Activated:Connect(function()
  344. local Portal = Instance.new("Part", workspace)
  345. Portal.BrickColor = BrickColor.new("Really black")
  346. Portal.Material = "SmoothPlastic"
  347. Portal.Anchored = true
  348. Portal.CanCollide = false
  349. Portal.CFrame = PortalPart.CFrame
  350. Portal.Size = Vector3.new(0.1, 0.05, 0.1)
  351. wait(0.05)
  352. Portal.Orientation = PortalPart.Orientation
  353. Portal.Size = Vector3.new(0.3, 0.05, 0.3)
  354. wait(0.05)
  355. Portal.Orientation = PortalPart2.Orientation
  356. Portal.Size = Vector3.new(0.5, 0.05, 0.5)
  357. wait(0.05)
  358. Portal.Orientation = PortalPart.Orientation
  359. Portal.Size = Vector3.new(0.7, 0.05, 0.7)
  360. wait(0.05)
  361. Portal.Orientation = PortalPart2.Orientation
  362. Portal.Size = Vector3.new(0.9, 0.05, 0.9)
  363. wait(0.05)
  364. Portal.Orientation = PortalPart.Orientation
  365. Portal.Size = Vector3.new(1.4, 0.05, 1.4)
  366. wait(0.05)
  367. Portal.Orientation = PortalPart2.Orientation
  368. Portal.Size = Vector3.new(2, 0.05, 2)
  369. wait(0.05)
  370. Portal.Orientation = PortalPart.Orientation
  371. Portal.Size = Vector3.new(2.5, 0.05, 2.5)
  372. wait(0.05)
  373. Portal.Orientation = PortalPart2.Orientation
  374. Portal.Size = Vector3.new(3.4, 0.05, 3.4)
  375. wait(0.05)
  376. Portal.Orientation = PortalPart.Orientation
  377. Portal.Size = Vector3.new(4.3, 0.05, 4.3)
  378. local Present = Instance.new("Part", workspace)
  379. local Present2 = Instance.new("Part", workspace)
  380. Present2.Anchored = true
  381. Present2.CanCollide = false
  382. Present2.BrickColor = BrickColor.new("Institutional white")
  383. Present2.Material = "Neon"
  384. Present2.Size = Vector3.new(0.5, 2.1, 2.1)
  385. Present2.CFrame = Present.CFrame
  386. local Present2Weld = Instance.new("WeldConstraint", Present2)
  387. Present2Weld.Part0 = Present
  388. Present2Weld.Part1 = Present2
  389. Present2.Anchored = false
  390. local Present3 = Instance.new("Part", workspace)
  391. Present3.Anchored = true
  392. Present3.CanCollide = false
  393. Present3.BrickColor = BrickColor.new("Institutional white")
  394. Present3.Material = "Neon"
  395. Present3.Size = Vector3.new(2.1, 2.1, 0.5)
  396. Present3.CFrame = Present.CFrame
  397. local Present3Weld = Instance.new("WeldConstraint", Present3)
  398. Present3Weld.Part0 = Present
  399. Present3Weld.Part1 = Present3
  400. Present3.Anchored = false
  401. Present.Transparency = 0
  402. Present.CanCollide = true
  403. Present.BrickColor = BrickColor.new("Really black")
  404. Present.Material = "Neon"
  405. Present.Size = Vector3.new(2, 2, 2)
  406.  
  407. local Duh1 = Instance.new("Part", workspace)
  408. Duh1.Anchored = true
  409. Duh1.CanCollide = false
  410. Duh1.Orientation = Vector3.new(0, 0, -40)
  411. Duh1.BrickColor = BrickColor.new("Institutional white")
  412. Duh1.Material = "Neon"
  413. Duh1.Size = Vector3.new(0.336, 2.05, 0.386)
  414. Duh1.Position = Present.Position + Vector3.new(0, 1, 0)
  415. local Duh1Weld = Instance.new("WeldConstraint", Duh1)
  416. Duh1Weld.Part0 = Present
  417. Duh1Weld.Part1 = Duh1
  418. Duh1.Anchored = false
  419. local Duh2 = Instance.new("Part", workspace)
  420. Duh2.Anchored = true
  421. Duh2.CanCollide = false
  422. Duh2.Orientation = Vector3.new(0, 0, 40)
  423. Duh2.BrickColor = BrickColor.new("Institutional white")
  424. Duh2.Material = "Neon"
  425. Duh2.Size = Vector3.new(0.336, 2.05, 0.386)
  426. Duh2.Position = Present.Position + Vector3.new(0, 1, 0)
  427. local Duh2Weld = Instance.new("WeldConstraint", Duh2)
  428. Duh2Weld.Part0 = Present
  429. Duh2Weld.Part1 = Duh2
  430. Duh2.Anchored = false
  431. Present.CFrame = PortalPart.CFrame
  432. Present.Velocity = Char.HumanoidRootPart.CFrame.lookVector * 40
  433. wait(1)
  434. Portal.Orientation = PortalPart2.Orientation
  435. Portal.Size = Vector3.new(5, 0.05, 5)
  436. wait(0.05)
  437. Portal.Orientation = PortalPart.Orientation
  438. Portal.Size = Vector3.new(4.5, 0.05, 4.5)
  439. wait(0.05)
  440. Portal.Orientation = PortalPart.Orientation
  441. Portal.Size = Vector3.new(4, 0.05, 4)
  442. wait(0.05)
  443. Portal.Size = Vector3.new(3, 0.05, 3)
  444. wait(0.05)
  445. Portal.Size = Vector3.new(2, 0.05, 2)
  446. wait(0.05)
  447. Portal:Destroy()
  448. Present.Touched:Connect(function(Something)
  449. if Something.Parent:FindFirstChild("Humanoid") then
  450. if can == true then
  451. Present:Destroy()
  452. Present2:Destroy()
  453. Present3:Destroy()
  454. Duh1:Destroy()
  455. Duh2:Destroy()
  456.  
  457. local Character = Something.parent
  458. end
  459. end
  460. end)
  461. end)
  462. end
  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.  
  561.  
  562. --// Instance Creation Functions \\--
  563.  
  564.  
  565. function Part(parent,color,material,size,cframe,anchored,cancollide)
  566. local part = IN("Part")
  567. part.Parent = parent or Char
  568. part[typeof(color) == 'BrickColor' and 'BrickColor' or 'Color'] = color or C3.N(0,0,0)
  569. part.Material = material or Enum.Material.SmoothPlastic
  570. part.TopSurface,part.BottomSurface=10,10
  571. part.Size = size or V3.N(1,1,1)
  572. part.CFrame = cframe or CF.N(0,0,0)
  573. part.CanCollide = cancollide or false
  574. part.Anchored = anchored or false
  575. return part
  576. end
  577.  
  578. function Weld(part0,part1,c0,c1)
  579. local weld = IN("Weld")
  580. weld.Parent = part0
  581. weld.Part0 = part0
  582. weld.Part1 = part1
  583. weld.C0 = c0 or CF.N()
  584. weld.C1 = c1 or CF.N()
  585. return weld
  586. end
  587.  
  588. function Mesh(parent,meshtype,meshid,textid,scale,offset)
  589. local part = IN("SpecialMesh")
  590. part.MeshId = meshid or ""
  591. part.TextureId = textid or ""
  592. part.Scale = scale or V3.N(1,1,1)
  593. part.Offset = offset or V3.N(0,0,0)
  594. part.MeshType = meshtype or Enum.MeshType.Sphere
  595. part.Parent = parent
  596. return part
  597. end
  598.  
  599. NewInstance = function(instance,parent,properties)
  600. local inst = Instance.new(instance)
  601. inst.Parent = parent
  602. if(properties)then
  603. for i,v in next, properties do
  604. pcall(function() inst[i] = v end)
  605. end
  606. end
  607. return inst;
  608. end
  609.  
  610. function Clone(instance,parent,properties)
  611. local inst = instance:Clone()
  612. inst.Parent = parent
  613. if(properties)then
  614. for i,v in next, properties do
  615. pcall(function() inst[i] = v end)
  616. end
  617. end
  618. return inst;
  619. end
  620.  
  621.  
  622.  
  623.  
  624. --// Customization \\--
  625.  
  626. local Frame_Speed = 60;
  627. local WalkSpeed = 16
  628. local DamageColor = BrickColor.new'White'
  629.  
  630. --// Stop animations \\--
  631. for _,v in next, Hum:GetPlayingAnimationTracks() do
  632. v:Stop();
  633. end
  634.  
  635. pcall(game.Destroy,Char:FindFirstChild'Animate')
  636. pcall(game.Destroy,Hum:FindFirstChild'Animator')
  637.  
  638. --// Joints \\--
  639.  
  640. local LS = NewInstance('Motor',Char,{Part0=Torso,Part1=LArm,C0 = CF.N(-1.5,0.5,0),C1 = CF.N(0,.5,0)})
  641. local RS = NewInstance('Motor',Char,{Part0=Torso,Part1=RArm,C0 = CF.N(1.5,0.5,0),C1 = CF.N(0,.5,0)})
  642. local NK = NewInstance('Motor',Char,{Part0=Torso,Part1=Head,C0 = CF.N(0,1.5,0)})
  643. local LH = NewInstance('Motor',Char,{Part0=Torso,Part1=LLeg,C0 = CF.N(-.5,-1,0),C1 = CF.N(0,1,0)})
  644. local RH = NewInstance('Motor',Char,{Part0=Torso,Part1=RLeg,C0 = CF.N(.5,-1,0),C1 = CF.N(0,1,0)})
  645. local RJ = NewInstance('Motor',Char,{Part0=Root,Part1=Torso})
  646.  
  647. local LSC0 = LS.C0
  648. local RSC0 = RS.C0
  649. local NKC0 = NK.C0
  650. local LHC0 = LH.C0
  651. local RHC0 = RH.C0
  652. local RJC0 = RJ.C0
  653.  
  654. --// Artificial HB \\--
  655.  
  656. local ArtificialHB = IN("BindableEvent", script)
  657. ArtificialHB.Name = "Heartbeat"
  658.  
  659. script:WaitForChild("Heartbeat")
  660.  
  661. local tf = 0
  662. local allowframeloss = false
  663. local tossremainder = false
  664. local lastframe = tick()
  665. local frame = 1/Frame_Speed
  666. ArtificialHB:Fire()
  667.  
  668. game:GetService("RunService").Heartbeat:connect(function(s, p)
  669. tf = tf + s
  670. if tf >= frame then
  671. if allowframeloss then
  672. script.Heartbeat:Fire()
  673. lastframe = tick()
  674. else
  675. for i = 1, math.floor(tf / frame) do
  676. ArtificialHB:Fire()
  677. end
  678. lastframe = tick()
  679. end
  680. if tossremainder then
  681. tf = 0
  682. else
  683. tf = tf - frame * math.floor(tf / frame)
  684. end
  685. end
  686. end)
  687.  
  688. function swait(num)
  689. if num == 0 or num == nil then
  690. ArtificialHB.Event:wait()
  691. else
  692. for i = 0, num do
  693. ArtificialHB.Event:wait()
  694. end
  695. end
  696. end
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703. while true do
  704. swait()
  705. Sine = Sine + Change
  706.  
  707. 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)
  708.  
  709. local Walking = (math.abs(Root.Velocity.x) > 1 or math.abs(Root.Velocity.z) > 1)
  710. 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")
  711. if(not Effects or not Effects.Parent)then
  712. Effects = IN("Model",Char)
  713. Effects.Name = "Effects"
  714. end
  715. if(State == 'Walk')then
  716. local wsVal = 20 / (Hum.WalkSpeed/16)
  717. local Alpha = math.min(.3 * (Hum.WalkSpeed/8),1)
  718. Change = 3
  719. 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)
  720. 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)
  721. else
  722. RH.C1 = RH.C1:lerp(CF.N(0,1,0),.2)
  723. LH.C1 = LH.C1:lerp(CF.N(0,1,0),.2)
  724. end
  725.  
  726. Hum.WalkSpeed = WalkSpeed
  727.  
  728. if(NeutralAnims)then
  729. if(State == 'Idle')then
  730. local Alpha = .1
  731. Change = .75
  732. 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)
  733. NK.C0 = NK.C0:lerp(NKC0*CF.A(M.R(-5+5*M.C(Sine/12)),0,0),Alpha)
  734. 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)
  735. 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)
  736. 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)
  737. 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)
  738. -- idle
  739. elseif(State == 'Run')then
  740. local wsVal = 20 / (Hum.WalkSpeed/16)
  741. local Alpha = math.min(.2 * (Hum.WalkSpeed/16),1)
  742. 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)
  743. NK.C0 = NK.C0:lerp(NKC0,Alpha)
  744. 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)
  745. 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)
  746. 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)
  747. 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)
  748. elseif(State == 'Walk')then
  749. local wsVal = 20 / (Hum.WalkSpeed/16)
  750. local Alpha = math.min(.3 * (Hum.WalkSpeed/16),1)
  751. 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)
  752. NK.C0 = NK.C0:lerp(NKC0,Alpha)
  753. 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)
  754. 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)
  755. 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)
  756. 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)
  757. elseif(State == 'Jump')then
  758. local Alpha = .1
  759. local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90))
  760. LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)),Alpha)
  761. RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)),Alpha)
  762. 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)
  763. 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)
  764. LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha)
  765. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha)
  766. elseif(State == 'Fall')then
  767. local Alpha = .1
  768. local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90))
  769. LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-90)+idk),Alpha)
  770. RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(90)-idk),Alpha)
  771. 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)
  772. 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)
  773. LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha)
  774. RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha)
  775. elseif(State == 'Paralyzed')then
  776. -- paralyzed
  777. elseif(State == 'Sit')then
  778. -- sit
  779. end
  780. end
  781.  
  782. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement