kqdragon

nani

Apr 25th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  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 = owner
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  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. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86. ________________________________________________
  87. local oldtick = tick()
  88. warn("Animation rig - By Mewy23")
  89. local plr = owner
  90. local char, mouse = plr.Character, plr:GetMouse()
  91. local hitTab = {}
  92. local fadeTab = {}
  93. local spd = 0.2 * char:FindFirstChild("Humanoid").WalkSpeed / 16
  94. local sound1 = Instance.new("Sound", char.HumanoidRootPart)
  95. local sound2 = Instance.new("Sound", char.HumanoidRootPart)
  96. local sound3 = Instance.new("Sound")
  97. sound1.SoundId = "rbxassetid://130767866"
  98. sound1.Volume = 10
  99. sound2.SoundId = "rbxassetid://985132972"
  100. sound2.Volume = 10
  101. sound3.SoundId = "rbxassetid://142684400"
  102. sound3.Volume = 10
  103. local particle = Instance.new("ParticleEmitter")
  104. particle.LightEmission = 0.2
  105. particle.Texture = "rbxassetid://50263573"
  106. particle.Size = NumberSequence.new({
  107. NumberSequenceKeypoint.new(0, 0),
  108. NumberSequenceKeypoint.new(0.5, 1),
  109. NumberSequenceKeypoint.new(1, 0)
  110. })
  111. particle.Acceleration = Vector3.new(0, 0, 0)
  112. particle.Lifetime = NumberRange.new(0.15, 0.3)
  113. particle.Rate = 50
  114. particle.Rotation = NumberRange.new(0, 360)
  115. particle.RotSpeed = NumberRange.new(0, 0)
  116. particle.Speed = NumberRange.new(0, 0)
  117. local dfj = {}
  118. char:WaitForChild("Animate"):Destroy()
  119. char:WaitForChild("Humanoid"):WaitForChild("Animator"):Destroy()
  120. for i, v in pairs(char:FindFirstChild("Torso"):GetChildren()) do
  121. if v:IsA("Motor6D") and v.Name ~= "Neck" then
  122. table.insert(dfj, v:Clone())
  123. v:Destroy()
  124. end
  125. end
  126. local state = "idle"
  127. local rootpart = char:FindFirstChild("HumanoidRootPart")
  128. local rootjoint = rootpart:FindFirstChild("RootJoint")
  129. rootjoint.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180))
  130. local rarm = Instance.new("Weld", char:FindFirstChild("Right Arm") or nil)
  131. rarm.Part0 = char:FindFirstChild("Torso") or nil
  132. rarm.Part1 = char:FindFirstChild("Right Arm") or nil
  133. rarm.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  134. rarm.C1 = CFrame.new(-0.5, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  135. local larm = Instance.new("Weld", char:FindFirstChild("Left Arm") or nil)
  136. larm.Part0 = char:FindFirstChild("Torso") or nil
  137. larm.Part1 = char:FindFirstChild("Left Arm") or nil
  138. larm.C0 = CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  139. larm.C1 = CFrame.new(0.5, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  140. local rleg = Instance.new("Weld", char:FindFirstChild("Right Leg") or nil)
  141. rleg.Part0 = char:FindFirstChild("Torso") or nil
  142. rleg.Part1 = char:FindFirstChild("Right Leg") or nil
  143. rleg.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  144. rleg.C1 = CFrame.new(0.5, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  145. local lleg = Instance.new("Weld", char:FindFirstChild("Left Leg") or nil)
  146. lleg.Part0 = char:FindFirstChild("Torso") or nil
  147. lleg.Part1 = char:FindFirstChild("Left Leg") or nil
  148. lleg.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  149. lleg.C1 = CFrame.new(-0.5, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  150. local neck = char:FindFirstChild("Torso"):FindFirstChild("Neck") or nil
  151. neck.Part0 = char:FindFirstChild("Torso") or nil
  152. neck.Part1 = char:FindFirstChild("Head") or nil
  153. neck.C0 = CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  154. neck.C1 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  155. function hitSphere()
  156. local function recSearch(par)
  157. local tab = {}
  158. local function rec(parent)
  159. if parent:IsA("Humanoid") and parent ~= char:FindFirstChildOfClass("Humanoid") then
  160. table.insert(tab, parent)
  161. end
  162. for i, v in pairs(parent:GetChildren()) do
  163. rec(v)
  164. end
  165. end
  166. rec(par)
  167. return tab
  168. end
  169. local humsFound = {}
  170. for i, v in pairs(recSearch(workspace)) do
  171. table.insert(humsFound, v)
  172. end
  173. return humsFound
  174. end
  175. mouse.Button1Down:connect(function()
  176. if state ~= "busy" then
  177. state = "busy"
  178. do
  179. local foundHums = {}
  180. local prtcls = {}
  181. local sounds = {}
  182. local parts = {}
  183. sound1:Play()
  184. local hit = false
  185. local toggle = false
  186. local frmcon
  187. local frame = 0
  188. frmcon = game:service("RunService").RenderStepped:connect(function()
  189. frame = frame + 1
  190. if frame / 4 == math.floor(frame / 4) then
  191. if toggle == false then
  192. toggle = true
  193. else
  194. toggle = false
  195. end
  196. end
  197. if toggle == true then
  198. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  199. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  200. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(45)), spd * 1.5)
  201. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(90)), spd * 1.5)
  202. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(225)), spd * 1.5)
  203. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(-45), math.rad(0)), spd * 1.5)
  204. else
  205. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  206. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  207. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-90)), spd * 1.5)
  208. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-45)), spd * 1.5)
  209. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(135)), spd * 1.5)
  210. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(0)), spd * 1.5)
  211. end
  212. if frame % 5 == 0 then
  213. for i, v in pairs(hitSphere()) do
  214. for o, b in pairs(v.Parent:GetChildren()) do
  215. if b:IsA("BasePart") and 4 >= (b.Position - rootjoint.Parent.CFrame * CFrame.new(0, 0, -2.25).p).Magnitude then
  216. hit = true
  217. if foundHums[v] then
  218. foundHums[v] = foundHums[v] + 1
  219. else
  220. foundHums[v] = 1
  221. local ns = sound3:Clone()
  222. ns.Parent = b
  223. table.insert(sounds, ns)
  224. end
  225. if not prtcls[b] then
  226. partClone = particle:Clone()
  227. partClone.Enabled = false
  228. partClone.Parent = b
  229. prtcls[b] = partClone
  230. end
  231. local p = Instance.new("Part")
  232. p.Size = Vector3.new(0.2, 0.2, 0.2)
  233. p.Color = Color3.new(1, 1, 1)
  234. p.TopSurface = "Smooth"
  235. p.BottomSurface = "Smooth"
  236. p.Anchored = true
  237. p.CanCollide = false
  238. p.Shape = "Ball"
  239. p.CFrame = CFrame.new(b.CFrame.p + Vector3.new(math.random(-10, 10) / 10, math.random(-10, 10) / 10, math.random(-10, 10) / 10))
  240. p.Parent = workspace
  241. table.insert(fadeTab, p)
  242. parts[b] = b
  243. end
  244. end
  245. end
  246. end
  247. end)
  248. local bucon
  249. bucon = mouse.Button1Up:connect(function()
  250. frmcon:disconnect()
  251. sound1:Stop()
  252. state = "idle"
  253. if hit == true then
  254. sound2:Play()
  255. wait(2.7)
  256. for i, v in pairs(sounds) do
  257. spawn(function()
  258. wait(math.random(0, 100) / 600)
  259. v.TimePosition = 2.5
  260. v:Play()
  261. end)
  262. end
  263. wait(1.2)
  264. for i, v in pairs(prtcls) do
  265. v.Enabled = true
  266. end
  267. wait(1.3)
  268. spawn(function()
  269. local rcon
  270. local frame = 0
  271. rcon = game:service("RunService").RenderStepped:connect(function()
  272. frame = frame + 1
  273. for i, v in pairs(sounds) do
  274. v.Volume = 10 - frame / 5
  275. if v.Volume <= 0 then
  276. v.Volume = 0
  277. v:Destroy()
  278. end
  279. end
  280. if frame >= 200 then
  281. for i, v in pairs(sounds) do
  282. v:Destroy()
  283. end
  284. end
  285. end)
  286. end)
  287. for i, v in pairs(parts) do
  288. v.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
  289. v.Velocity = v.Velocity + Vector3.new(0, 20, 0)
  290. local bvel = Instance.new("BodyVelocity", v)
  291. bvel.MaxForce = Vector3.new(1000000, 1000000, 1000000)
  292. bvel.Velocity = Vector3.new(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  293. game:service("Debris"):AddItem(bvel, 0.5)
  294. end
  295. for i, v in pairs(foundHums) do
  296. if i.MaxHealth >= math.huge then
  297. i.MaxHealth = 100
  298. end
  299. i.Health = 0
  300. end
  301. wait(0.7)
  302. for i, v in pairs(prtcls) do
  303. v.Enabled = false
  304. end
  305. end
  306. bucon:disconnect()
  307. end)
  308. end
  309. end
  310. end)
  311. game:GetService("RunService").Heartbeat:connect(function()
  312. for i, v in pairs(fadeTab) do
  313. v.Transparency = v.Transparency + 0.1
  314. local savecf = v.CFrame
  315. v.Size = v.Size + Vector3.new(0.3, 0.3, 0.3)
  316. v.CFrame = savecf
  317. end
  318. local isub = 0
  319. for i = 1, #fadeTab do
  320. if fadeTab[i - isub].Transparency >= 1 then
  321. fadeTab[i - isub]:Destroy()
  322. table.remove(fadeTab, i - isub)
  323. isub = isub + 1
  324. end
  325. end
  326. char:FindFirstChild("Humanoid").WalkSpeed = 26
  327. spd = 0.2 * char:FindFirstChild("Humanoid").WalkSpeed / 16
  328. if state ~= "busy" then
  329. local ray = Ray.new(rootpart.Position, Vector3.new(0, -4, 0))
  330. local part, pos, normal = workspace:FindPartOnRayWithIgnoreList(ray, char:GetChildren(), false, true)
  331. if rootpart.Velocity.Magnitude > 0.5 and part ~= nil then
  332. state = "running"
  333. elseif rootpart.Velocity.Magnitude <= 0.5 and part ~= nil then
  334. state = "idle"
  335. elseif 0 < rootpart.Velocity.Y and part == nil then
  336. state = "jumping"
  337. elseif 0 >= rootpart.Velocity.Y and part == nil then
  338. state = "falling"
  339. end
  340. if state == "idle" then
  341. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  342. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  343. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5 + math.cos(tick() + 0.5) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad((math.cos(tick()) + 1) / 16) * 20), spd)
  344. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5 + math.cos(tick() + 0.5) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-(math.cos(tick()) + 1) / 16) * 20), spd)
  345. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd)
  346. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  347. elseif state == "running" then
  348. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - -math.sin(tick() * 8 + 90) / 8, math.sin(tick() * 8 + 90) / 10) * CFrame.Angles(math.rad(math.sin(tick() * 8) * 60), math.rad(0), math.rad(0)), spd)
  349. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.sin(tick() * 8 + 90) / 8, -math.sin(tick() * 8 + 90) / 10) * CFrame.Angles(-math.rad(math.sin(tick() * 8) * 60), math.rad(0), math.rad(0)), spd)
  350. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(math.sin(tick() * 8) * 80), math.rad(0), math.rad(0)), spd)
  351. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(-math.rad(math.sin(tick() * 8) * 80), math.rad(0), math.rad(0)), spd)
  352. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-110), math.rad(0), math.rad(180)), spd)
  353. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(20), math.rad(0), math.rad(0)), spd)
  354. elseif state == "jumping" then
  355. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  356. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  357. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  358. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  359. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd)
  360. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  361. elseif state == "falling" then
  362. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  363. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  364. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  365. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  366. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd)
  367. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  368. end
  369. end
  370. end)
  371. warn("Loaded! Time elapsed: " .. tick() - oldtick)
Add Comment
Please, Sign In to add comment