1nubloku

k

Sep 15th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.33 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,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84.  
  85. wait(1/5)
  86. local plr = owner
  87. local C = plr.Character
  88. local H = C.Humanoid
  89.  
  90. local DebrisService = game:GetService('Debris')
  91. local LARM = C:WaitForChild("Left Arm")
  92. local RARM = C:WaitForChild("Right Arm")
  93. local LLEG = C:WaitForChild("Left Leg")
  94. local RLEG = C:WaitForChild("Right Leg")
  95. local Head = C.Head
  96. local Torso = C.Torso
  97. local Neck = Torso.Neck
  98. local Root = C.HumanoidRootPart
  99. local RootJ = Root.RootJoint
  100. local a = 0
  101.  
  102. --[[ Base Varibles ]]--
  103.  
  104. local cn = CFrame.new
  105. local aa = CFrame.Angles
  106. local ud = UDim2.new
  107. local c3 = Color3.new
  108. local sin = math.sin
  109. local sqrt = math.sqrt
  110. local rad = math.rad
  111. local cos = math.cos
  112. local acos = math.acos
  113. local abs = math.abs
  114. local asin = math.asin
  115. local atan = math.atan
  116. local atan2 = math.atan2
  117. local turn = true
  118. local sit = false
  119. local fist = false
  120. local running = false
  121. local emoting = false
  122. local attack = false
  123. local valid_blood = false
  124. local equiping = false
  125. local valid_hit = true
  126.  
  127. local NeckCF = cn(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  128. local RootCF = aa(-1.57, 0, 3.14)
  129. local RHCF = aa(0, 1.6, 0)
  130. local LHCF = aa(0, -1.6, 0)
  131.  
  132. C:WaitForChild('Sound'):Destroy()
  133. local LH = Torso:WaitForChild("Left Hip")
  134. local RH = Torso:WaitForChild("Right Hip")
  135. local RSH = Torso:WaitForChild("Right Shoulder")
  136. local LSH = Torso:WaitForChild("Left Shoulder")
  137. RH.Parent = nil
  138. LH.Parent = nil
  139. RSH.Parent = nil
  140. LSH.Parent = nil
  141. local RL = Instance.new("Weld",Torso)
  142. RL.Name = "Right Hip"
  143. RL.Part0 = Torso
  144. RL.C0 = cn(0, 0, 0)
  145. RL.C1 = cn(0.5, 1, 0) * aa(0,1.6,0)
  146. RL.Part1 = RLEG
  147. local LL = Instance.new("Weld",Torso)
  148. LL.Name = "Left Hip"
  149. LL.Part0 = Torso
  150. LL.C0 = cn(0, 0, 0)
  151. LL.C1 = cn(-0.5, 1, 0) * aa(0,-1.6,0)
  152. LL.Part1 = LLEG
  153. local RA = Instance.new("Weld",Torso)
  154. RA.Name = "Right Shoulder"
  155. RA.Part0 = Torso
  156. RA.C0 = cn(1.5, 0.5, 0)
  157. RA.C1 = cn(0, 0.5, 0)
  158. RA.Part1 = RARM
  159. local LA = Instance.new("Weld",Torso)
  160. LA.Name = "Left Shoulder"
  161. LA.Part0 = Torso
  162. LA.C0 = cn(-1.5, 0.5, 0)
  163. LA.C1 = cn(0, 0.5, 0)
  164. LA.Part1 = LARM
  165. LL.C0 = LHCF * cn(0,-1,1)*aa(rad(0),rad(0),rad(0))
  166. RL.C0 = RHCF * cn(0,-1,1)*aa(rad(0),rad(0),rad(0))
  167. local swait = function()
  168. game:GetService('RunService').Heartbeat:wait(0)
  169. end
  170. function CreateShake(RepeatedFor,OffsetDebounce)
  171. spawn(function()
  172. local Camera = g:GetService('Workspace').CurrentCamera
  173. for i=1,RepeatedFor do swait()
  174. Camera.CFrame = Camera.CFrame * CFrame.new(math.random()*OffsetDebounce,
  175. math.random()*OffsetDebounce,
  176. math.random()*OffsetDebounce)
  177. end
  178. end)
  179. end
  180. function RayCast(Position, Direction, Range, Ignore)
  181. local ht = g:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * Range), Ignore)
  182. return ht or nil
  183. end
  184. H:WaitForChild('Animator',true):Destroy()
  185. C:WaitForChild('Animate',true):Destroy() turn = false
  186.  
  187. local jupei = true
  188. local time = 0
  189.  
  190. plr.Chatted:Connect(function(message)
  191. if string.sub((message),1,6) == 'music ' then
  192. jupeimus.SoundId = 'rbxassetid://'.. string.sub((message),7)
  193. jupeimus:Play()
  194. elseif string.sub((message),1,4) == 'vol ' then
  195. jupeimus.Volume = string.sub((message),5)
  196. jupeimus:Play()
  197. elseif string.sub((message),1,4) == 'pos ' then
  198. time = string.sub((message),5)
  199. end
  200. end)
  201.  
  202. attack = true
  203. H.JumpPower = 57
  204. H.WalkSpeed = 16
  205. jupeimus = Instance.new("Sound", Torso)
  206. jupeimus.Volume = 999999999
  207. jupeimus.Pitch = 1
  208. jupeimus.SoundId = "rbxassetid://692574039"
  209. jupeimus.TimePosition = 0
  210. jupeimus.Looped = true
  211. jupeimus.Name = "Dance"
  212. spawn(function()
  213. while true do swait()
  214. a=a+1
  215. end
  216. end)
  217. jupeimus.TimePosition = time
  218. jupeimus:Play()
  219. for i=0,1,0.05 do swait()
  220. RL.C0 = RL.C0:lerp(RHCF * cn(rad(0 * cos(a/25)),rad(0 * cos(a/25))-0.93,1)*aa(rad(0),rad(0),rad(0)+rad(-0.5*cos(a/25))),.0)
  221. LL.C0 = LL.C0:lerp(LHCF * cn(rad(1 * cos(a/40)),rad(5 * cos(a/25))-0.93,1)*aa(rad(-20),rad(0)+rad(-1.5*cos(a/25)),rad(0)+rad(0.5*cos(a/25))),.15)
  222. RA.C0 = RA.C0:lerp(cn(1.49, 0.55 - rad(-2 * cos(a/25)), 0.4) * aa(rad(0),rad(0),rad(0)),.0)
  223. LA.C0 = LA.C0:lerp(cn(-1.49, 1 - rad(-4 * cos(a/10)), 0) * aa(rad(182.5),rad(5),rad(-50)),.15)
  224. RootJ.C0 = RootJ.C0:lerp(RootCF *cn(rad(0),rad(0*cos(a/25)),-0.05)* cn(0, 0, rad(2 * cos(a/25))) * aa(rad(0)+rad(1.5 * cos(a/25)), rad(0), rad(0)), .0)
  225. Torso.Neck.C0 = Torso.Neck.C0:lerp(NeckCF * aa(rad(0)+rad(-5 * sin(a/25)), rad(0), rad(0)), .0)
  226. end
Advertisement
Add Comment
Please, Sign In to add comment