Advertisement
HenloMyDude

bloxworld

Aug 21st, 2019
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.27 KB | None | 0 0
  1.  
  2.  
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,game,owner = owner,game
  5. local RealPlayer = Player
  6. do
  7. print("FE Compatibility code V2 by Mokiros")
  8. local RealPlayer = RealPlayer
  9. script.Parent = RealPlayer.Character
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local Disconnect_Function = function(this)
  13. this[1].Functions[this[2]] = nil
  14. end
  15. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  16. local FakeEvent_Metatable = {__index={
  17. Connect = function(this,f)
  18. local i = tostring(math.random(0,10000))
  19. while this.Functions[i] do
  20. i = tostring(math.random(0,10000))
  21. end
  22. this.Functions[i] = f
  23. return setmetatable({this,i},Disconnect_Metatable)
  24. end
  25. }}
  26. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  27. local function fakeEvent()
  28. return setmetatable({Functions={}},FakeEvent_Metatable)
  29. end
  30.  
  31. --Creating fake input objects with fake variables
  32. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  33. FakeMouse.keyUp = FakeMouse.KeyUp
  34. FakeMouse.keyDown = FakeMouse.KeyDown
  35. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  36. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  37. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  38. end}
  39. --Merged 2 functions into one by checking amount of arguments
  40. CAS.UnbindAction = CAS.BindAction
  41.  
  42. --This function will trigger the events that have been :Connect()'ed
  43. local function TriggerEvent(self,ev,...)
  44. for _,f in pairs(self[ev].Functions) do
  45. f(...)
  46. end
  47. end
  48. FakeMouse.TriggerEvent = TriggerEvent
  49. UIS.TriggerEvent = TriggerEvent
  50.  
  51. --Client communication
  52. local Event = Instance.new("RemoteEvent")
  53. Event.Name = "UserInput_Event"
  54. Event.OnServerEvent:Connect(function(plr,io)
  55. if plr~=RealPlayer then return end
  56. FakeMouse.Target = io.Target
  57. FakeMouse.Hit = io.Hit
  58. if not io.isMouse then
  59. local b = io.UserInputState == Enum.UserInputState.Begin
  60. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  61. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  62. end
  63. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  64. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  65. end
  66. for _,t in pairs(CAS.Actions) do
  67. for _,k in pairs(t.Keys) do
  68. if k==io.KeyCode then
  69. t.Function(t.Name,io.UserInputState,io)
  70. end
  71. end
  72. end
  73. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  74. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  75. end
  76. end)
  77. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  78. local Mouse = owner:GetMouse()
  79. local UIS = game:GetService("UserInputService")
  80. local input = function(io,RobloxHandled)
  81. if RobloxHandled then return end
  82. --Since InputObject is a client-side instance, we create and pass table instead
  83. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  84. end
  85. UIS.InputBegan:Connect(input)
  86. UIS.InputEnded:Connect(input)
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152.  
  153.  
  154. plr = owner
  155. mouse = plr:GetMouse()
  156. char = plr.Character
  157. hum = char.Humanoid
  158. hum.BreakJointsOnDeath = false
  159. swordequip = false
  160.  
  161. --sword model--
  162.  
  163.  
  164.  
  165. --Converted with ttyyuu12345's model to script plugin v4
  166. function sandbox(var,func)
  167. local env = getfenv(func)
  168. local newenv = setmetatable({},{
  169. __index = function(self,k)
  170. if k=="script" then
  171. return var
  172. else
  173. return env[k]
  174. end
  175. end,
  176. })
  177. setfenv(func,newenv)
  178. return func
  179. end
  180. cors = {}
  181. mas = Instance.new("Model",game:GetService("Lighting"))
  182. Tool0 = Instance.new("Tool")
  183. Part1 = Instance.new("Part")
  184. SpecialMesh2 = Instance.new("SpecialMesh")
  185. Sound3 = Instance.new("Sound")
  186. Sound4 = Instance.new("Sound")
  187. Sound5 = Instance.new("Sound")
  188. Script6 = Instance.new("Script")
  189. LocalScript7 = Instance.new("LocalScript")
  190. Camera8 = Instance.new("Camera")
  191. Tool0.Name = "ClassicSword"
  192. Tool0.Parent = mas
  193. Tool0.TextureId = "rbxasset://Textures/Sword128.png"
  194. Tool0.Grip = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0)
  195. Tool0.GripForward = Vector3.new(-1, -0, -0)
  196. Tool0.GripPos = Vector3.new(0, 0, -1.5)
  197. Tool0.GripRight = Vector3.new(0, 1, 0)
  198. Tool0.GripUp = Vector3.new(0, 0, 1)
  199. Part1.Name = "Handle"
  200. Part1.Parent = Tool0
  201. Part1.CFrame = CFrame.new(-20.2352562, 1.88732195, 37.1573105, 0.0910440385, -0.881099463, 0.464084357, 0.537011683, 0.435894847, 0.722229123, -0.838648558, 0.183463722, 0.512845576)
  202. Part1.Orientation = Vector3.new(-46.2400017, 42.1399994, 50.9300003)
  203. Part1.Position = Vector3.new(-20.2352562, 1.88732195, 37.1573105)
  204. Part1.Rotation = Vector3.new(-54.6199989, 27.6499996, 84.0999985)
  205. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  206. Part1.Size = Vector3.new(1, 0.800000012, 4)
  207. Part1.BottomSurface = Enum.SurfaceType.Smooth
  208. Part1.BrickColor = BrickColor.new("Dark stone grey")
  209. Part1.Locked = true
  210. Part1.Reflectance = 0.40000000596046
  211. Part1.TopSurface = Enum.SurfaceType.Smooth
  212. Part1.brickColor = BrickColor.new("Dark stone grey")
  213. Part1.FormFactor = Enum.FormFactor.Plate
  214. Part1.formFactor = Enum.FormFactor.Plate
  215. SpecialMesh2.Parent = Part1
  216. SpecialMesh2.MeshId = "rbxasset://fonts/sword.mesh"
  217. SpecialMesh2.TextureId = "rbxasset://textures/SwordTexture.png"
  218. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  219. Sound3.Name = "SwordSlash"
  220. Sound3.Parent = Part1
  221. Sound3.SoundId = "http://www.roblox.com/asset/?id=12222216"
  222. Sound3.Volume = 0.69999998807907
  223. Sound4.Name = "SwordLunge"
  224. Sound4.Parent = Part1
  225. Sound4.SoundId = "http://www.roblox.com/asset/?id=12222208"
  226. Sound4.Volume = 0.60000002384186
  227. Sound5.Name = "Unsheath"
  228. Sound5.Parent = Part1
  229. Sound5.SoundId = "http://www.roblox.com/asset/?id=12222225"
  230. Sound5.Volume = 1
  231. Script6.Name = "SwordScript"
  232. Script6.Parent = Tool0
  233. table.insert(cors,sandbox(Script6,function()
  234. --Rescripted by Luckymaxer
  235. --EUROCOW WAS HERE BECAUSE I MADE THE PARTICLES AND THEREFORE THIS ENTIRE SWORD PRETTY AND LOOK PRETTY WORDS AND I'D LIKE TO DEDICATE THIS TO MY FRIENDS AND HI LUCKYMAXER PLS FIX SFOTH SWORDS TY LOVE Y'ALl
  236. --Updated for R15 avatars by StarWars
  237. --Re-updated by TakeoHonorable
  238.  
  239. Tool = script.Parent
  240. Handle = Tool:WaitForChild("Handle")
  241.  
  242. function Create(ty)
  243. return function(data)
  244. local obj = Instance.new(ty)
  245. for k, v in pairs(data) do
  246. if type(k) == 'number' then
  247. v.Parent = obj
  248. else
  249. obj[k] = v
  250. end
  251. end
  252. return obj
  253. end
  254. end
  255.  
  256. local BaseUrl = "rbxassetid://"
  257.  
  258. Players = game:GetService("Players")
  259. Debris = game:GetService("Debris")
  260. RunService = game:GetService("RunService")
  261.  
  262. DamageValues = {
  263. BaseDamage = 5,
  264. SlashDamage = 10,
  265. LungeDamage = 30
  266. }
  267.  
  268. --For R15 avatars
  269. Animations = {
  270. R15Slash = 522635514,
  271. R15Lunge = 522638767
  272. }
  273.  
  274. Damage = DamageValues.BaseDamage
  275.  
  276. Grips = {
  277. Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  278. Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
  279. }
  280.  
  281. Sounds = {
  282. Slash = Handle:WaitForChild("SwordSlash"),
  283. Lunge = Handle:WaitForChild("SwordLunge"),
  284. Unsheath = Handle:WaitForChild("Unsheath")
  285. }
  286.  
  287. ToolEquipped = false
  288.  
  289. --For Omega Rainbow Katana thumbnail to display a lot of particles.
  290. for i, v in pairs(Handle:GetChildren()) do
  291. if v:IsA("ParticleEmitter") then
  292. v.Rate = 20
  293. end
  294. end
  295.  
  296. Tool.Grip = Grips.Up
  297. Tool.Enabled = true
  298.  
  299. function IsTeamMate(Player1, Player2)
  300. return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
  301. end
  302.  
  303. function TagHumanoid(humanoid, player)
  304. local Creator_Tag = Instance.new("ObjectValue")
  305. Creator_Tag.Name = "creator"
  306. Creator_Tag.Value = player
  307. Debris:AddItem(Creator_Tag, 2)
  308. Creator_Tag.Parent = humanoid
  309. end
  310.  
  311. function UntagHumanoid(humanoid)
  312. for i, v in pairs(humanoid:GetChildren()) do
  313. if v:IsA("ObjectValue") and v.Name == "creator" then
  314. v:Destroy()
  315. end
  316. end
  317. end
  318.  
  319. function Blow(Hit)
  320. if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then
  321. return
  322. end
  323. local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand")
  324. if not RightArm then
  325. return
  326. end
  327. local RightGrip = RightArm:FindFirstChild("RightGrip")
  328. if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
  329. return
  330. end
  331. local character = Hit.Parent
  332. if character == Character then
  333. return
  334. end
  335. local humanoid = character:FindFirstChildOfClass("Humanoid")
  336. if not humanoid or humanoid.Health == 0 then
  337. return
  338. end
  339. local player = Players:GetPlayerFromCharacter(character)
  340. if player and (player == Player or IsTeamMate(Player, player)) then
  341. return
  342. end
  343. UntagHumanoid(humanoid)
  344. TagHumanoid(humanoid, Player)
  345. humanoid:TakeDamage(Damage)
  346. end
  347.  
  348.  
  349. function Attack()
  350. Damage = DamageValues.SlashDamage
  351. Sounds.Slash:Play()
  352.  
  353. if Humanoid then
  354. if Humanoid.RigType == Enum.HumanoidRigType.R6 then
  355. local Anim = Instance.new("StringValue")
  356. Anim.Name = "toolanim"
  357. Anim.Value = "Slash"
  358. Anim.Parent = Tool
  359. elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
  360. local Anim = Tool:FindFirstChild("R15Slash")
  361. if Anim then
  362. local Track = Humanoid:LoadAnimation(Anim)
  363. Track:Play(0)
  364. end
  365. end
  366. end
  367. end
  368.  
  369. function Lunge()
  370. Damage = DamageValues.LungeDamage
  371.  
  372. Sounds.Lunge:Play()
  373.  
  374. if Humanoid then
  375. if Humanoid.RigType == Enum.HumanoidRigType.R6 then
  376. local Anim = Instance.new("StringValue")
  377. Anim.Name = "toolanim"
  378. Anim.Value = "Lunge"
  379. Anim.Parent = Tool
  380. elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
  381. local Anim = Tool:FindFirstChild("R15Lunge")
  382. if Anim then
  383. local Track = Humanoid:LoadAnimation(Anim)
  384. Track:Play(0)
  385. end
  386. end
  387. end
  388. --[[
  389. if CheckIfAlive() then
  390. local Force = Instance.new("BodyVelocity")
  391. Force.velocity = Vector3.new(0, 10, 0)
  392. Force.maxForce = Vector3.new(0, 4000, 0)
  393. Debris:AddItem(Force, 0.4)
  394. Force.Parent = Torso
  395. end
  396. ]]
  397.  
  398. wait(0.2)
  399. Tool.Grip = Grips.Out
  400. wait(0.6)
  401. Tool.Grip = Grips.Up
  402.  
  403. Damage = DamageValues.SlashDamage
  404. end
  405.  
  406. Tool.Enabled = true
  407. LastAttack = 0
  408.  
  409. function Activated()
  410. if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
  411. return
  412. end
  413. Tool.Enabled = false
  414. local Tick = RunService.Stepped:wait()
  415. if (Tick - LastAttack < 0.2) then
  416. Lunge()
  417. else
  418. Attack()
  419. end
  420. LastAttack = Tick
  421. --wait(0.5)
  422. Damage = DamageValues.BaseDamage
  423. local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){
  424. Name = "R15Slash",
  425. AnimationId = BaseUrl .. Animations.R15Slash,
  426. Parent = Tool
  427. })
  428.  
  429. local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){
  430. Name = "R15Lunge",
  431. AnimationId = BaseUrl .. Animations.R15Lunge,
  432. Parent = Tool
  433. })
  434. Tool.Enabled = true
  435. end
  436.  
  437. function CheckIfAlive()
  438. return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
  439. end
  440.  
  441. function Equipped()
  442. Character = Tool.Parent
  443. Player = Players:GetPlayerFromCharacter(Character)
  444. Humanoid = Character:FindFirstChildOfClass("Humanoid")
  445. Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
  446. if not CheckIfAlive() then
  447. return
  448. end
  449. ToolEquipped = true
  450. Sounds.Unsheath:Play()
  451. end
  452.  
  453. function Unequipped()
  454. Tool.Grip = Grips.Up
  455. ToolEquipped = false
  456. end
  457.  
  458. Tool.Activated:Connect(Activated)
  459. Tool.Equipped:Connect(Equipped)
  460. Tool.Unequipped:Connect(Unequipped)
  461.  
  462. Connection = Handle.Touched:Connect(Blow)
  463. end))
  464. LocalScript7.Name = "MouseIcon"
  465. LocalScript7.Parent = Tool0
  466. table.insert(cors,sandbox(LocalScript7,function()
  467. --Made by Luckymaxer
  468.  
  469. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  470. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  471.  
  472. Tool = script.Parent
  473.  
  474. Mouse = nil
  475.  
  476. function UpdateIcon()
  477. if Mouse then
  478. Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  479. end
  480. end
  481.  
  482. function OnEquipped(ToolMouse)
  483. Mouse = ToolMouse
  484. UpdateIcon()
  485. end
  486.  
  487. function OnChanged(Property)
  488. if Property == "Enabled" then
  489. UpdateIcon()
  490. end
  491. end
  492.  
  493. Tool.Equipped:Connect(OnEquipped)
  494. Tool.Changed:Connect(OnChanged)
  495.  
  496. end))
  497. Camera8.Name = "ThumbnailCamera"
  498. Camera8.Parent = Tool0
  499. Camera8.CFrame = CFrame.new(-5.67428207, 2.83736515, 3.79184556, 0.289030313, 0.416664183, -0.861888885, -0, 0.900314331, 0.435240269, 0.957319915, -0.125797629, 0.260218143)
  500. Camera8.CoordinateFrame = CFrame.new(-5.67428207, 2.83736515, 3.79184556, 0.289030313, 0.416664183, -0.861888885, -0, 0.900314331, 0.435240269, 0.957319915, -0.125797629, 0.260218143)
  501. Camera8.Focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  502. Camera8.focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  503. for i,v in pairs(mas:GetChildren()) do
  504. v.Parent = nil
  505. pcall(function() v:MakeJoints() end)
  506. end
  507. mas:Destroy()
  508. for i,v in pairs(cors) do
  509. spawn(function()
  510. pcall(v)
  511. end)
  512. end
  513.  
  514.  
  515.  
  516. ---------------
  517.  
  518. sine = 1
  519. Cos = math.cos
  520.  
  521. hum.Died:connect(function()
  522. for _,v in pairs (char:children()) do
  523. if v:IsA("Part") then
  524. local vel = Instance.new("BodyVelocity",v)
  525. vel.MaxForce = Vector3.new(100000000, 100000000, 100000000)
  526. vel.Velocity = Vector3.new(0, 10, 0)
  527. end
  528. end
  529. for i = 1,100 do
  530. wait()
  531. for _,v in pairs (char:children()) do
  532. if v:IsA("Part") then
  533. v.Transparency = v.Transparency + 0.01
  534. if v.Name == "Head" then
  535. for _,v in pairs (v:children()) do
  536. if v:IsA("Decal") then
  537. v.Transparency = v.Transparency + 0.01
  538. end
  539. end
  540. end
  541. end
  542. end
  543. end
  544. end)
  545.  
  546.  
  547. --animations--
  548.  
  549. IT = Instance.new
  550. CF = CFrame.new
  551. VT = Vector3.new
  552. RAD = math.rad
  553. C3 = Color3.new
  554. UD2 = UDim2.new
  555. BRICKC = BrickColor.new
  556. ANGLES = CFrame.Angles
  557. EULER = CFrame.fromEulerAnglesXYZ
  558. COS = math.cos
  559. ACOS = math.acos
  560. SIN = math.sin
  561. ASIN = math.asin
  562. ABS = math.abs
  563. MRANDOM = math.random
  564. FLOOR = math.floor
  565.  
  566. legswhileattack = true
  567.  
  568. local Ccf=CF(char.HumanoidRootPart.CFrame.p*VT(1,0,1),(char.HumanoidRootPart.CFrame.p+char.HumanoidRootPart.CFrame.LookVector)*VT(1,0,1))
  569. if legswhileattack==true then
  570. Ccf=CF(char.Torso.CFrame.p*VT(1,0,1),(char.Torso.CFrame.p+char.Torso.CFrame.LookVector)*VT(1,0,1))
  571. end
  572.  
  573. RootPart = char.HumanoidRootPart
  574. warn(hum.MoveDirection*RootPart.CFrame.lookVector)
  575. local Walktest1 = hum.MoveDirection*Ccf.LookVector
  576. local Walktest2 = hum.MoveDirection*Ccf.RightVector
  577. warn(Walktest1.Z.."/"..Walktest1.X)
  578. warn(Walktest2.Z.."/"..Walktest2.X)
  579. forWFB = Walktest1.X+Walktest1.Z
  580. forWRL = Walktest2.X+Walktest2.Z
  581.  
  582. normalanim = true
  583. animpose = "Idle"
  584.  
  585. local RS = char.Torso["Right Shoulder"]
  586. local LS = char.Torso["Left Shoulder"]
  587. local RH = char.Torso["Right Hip"]
  588. local LH = char.Torso["Left Hip"]
  589. local rootj = Instance.new("Weld",char.Torso)
  590. rootj.Part0 = char.Torso
  591. rootj.Part1 = char.HumanoidRootPart
  592. local RSnor = RS.C0
  593. local LSnor = LS.C0
  594. local RHnor = RH.C0
  595. local LHnor = LH.C0
  596.  
  597. angles = ANGLES
  598. char.Humanoid.Animator:Destroy()
  599. attack = true
  600. mememode = true
  601.  
  602. local TweenService = game:GetService("TweenService")
  603. local RbxUtility = LoadLibrary("RbxUtility")
  604. local Create = RbxUtility.Create
  605.  
  606. function SetTween(SPart,CFr,MoveStyle2,outorin2,AnimTime)
  607. local MoveStyle = Enum.EasingStyle[MoveStyle2]
  608. local outorin = Enum.EasingDirection[outorin2]
  609.  
  610. local dahspeed=1
  611. if attack == true and mememode == true then
  612. dahspeed=3
  613. end
  614.  
  615. if SPart.Name=="Bullet" then
  616. dahspeed=1
  617. end
  618.  
  619. local tweeningInformation = TweenInfo.new(
  620. AnimTime/dahspeed,
  621. MoveStyle,
  622. outorin,
  623. 0,
  624. false,
  625. 0
  626. )
  627. local MoveCF = CFr
  628. local tweenanim = TweenService:Create(SPart,tweeningInformation,MoveCF)
  629. tweenanim:Play()
  630. end
  631.  
  632. function GatherAllInstances(Parent,ig)
  633. local Instances = {}
  634. local Ignore=nil
  635. if ig ~= nil then
  636. Ignore = ig
  637. end
  638.  
  639. local function GatherInstances(Parent,Ignore)
  640. for i, v in pairs(Parent:GetChildren()) do
  641.  
  642. if v ~= Ignore then
  643. GatherInstances(v,Ignore)
  644. table.insert(Instances, v) end
  645. end
  646. end
  647. GatherInstances(Parent,Ignore)
  648. return Instances
  649. end
  650.  
  651. cf = CFrame.new
  652.  
  653.  
  654. function GetLimbs(Char)
  655. local Limbs={}
  656. for i, v in pairs(Char:GetChildren()) do
  657. if v:IsA("BasePart") then
  658. for i, v2 in pairs(v:GetChildren()) do
  659. if v2:IsA("Motor6D") then
  660.  
  661.  
  662. table.insert(Limbs,{v,v2.Part1,v2,CFrame = v2.C0,C1 = v2.C1})
  663.  
  664.  
  665.  
  666.  
  667. end
  668.  
  669. end
  670.  
  671. end
  672. end
  673. return Limbs
  674. end
  675. local Limbs=GetLimbs(char)
  676. function GC0(motor)
  677. local Ret = cf(0,0,0)
  678. for i2 = 1, #Limbs do
  679. local CLimb=Limbs[i2]
  680. if CLimb[3] == motor then
  681. Ret = CLimb.CFrame
  682. end
  683.  
  684. end
  685. return Ret
  686. end
  687.  
  688. mouse.KeyDown:connect(function(key)
  689. key=key:lower()
  690. if key == "n" then
  691. if swordequip then
  692. swordequip = false
  693. Tool0.Parent = nil
  694. else
  695. swordequip = true
  696. Tool0.Parent = plr.Backpack
  697. end
  698. end
  699. end)
  700.  
  701. while game:GetService("RunService").Heartbeat:Wait() do
  702. if normalanim then
  703. sine = sine + 1
  704. end
  705. local touchfloor = workspace:FindPartOnRay(Ray.new(char.HumanoidRootPart.CFrame.Position, ((CFrame.new(char.HumanoidRootPart.Position, char.HumanoidRootPart.Position - Vector3.new(0, 1, 0))).LookVector).Unit * 4), char)
  706. if char.HumanoidRootPart.Velocity.Magnitude > 1 and touchfloor and hum.Sit == false then
  707. animpose = "Walking"
  708. elseif char.HumanoidRootPart.Velocity.Magnitude > 1.5 and touchfloor and hum.Sit == false then
  709. animpose = "Running"
  710. elseif char.HumanoidRootPart.Velocity.Y > 0.5 and touchfloor == nil and hum.Sit == false then
  711. animpose = "Jumping"
  712. elseif char.HumanoidRootPart.Velocity.Y < 0.5 and touchfloor == nil and hum.Sit == false then
  713. animpose = "Falling"
  714. elseif hum.Sit == true and touchfloor then
  715. animpose = "Sit"
  716. else
  717. animpose = "Idle"
  718. end
  719.  
  720. if animpose == "Idle" and normalanim then
  721. local leglift = 0 --30
  722. SetTween(RS,{C0=GC0(RS)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  723. SetTween(LS,{C0=GC0(LS)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  724. SetTween(RH,{C0=GC0(RH)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  725. SetTween(LH,{C0=GC0(LH)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  726. elseif animpose == "Walking" and normalanim then
  727. local leglift = 180 --30
  728. local leglift2 = -180
  729. SetTween(RH,{C0=GC0(RH)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift2/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  730. SetTween(LH,{C0=GC0(LH)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift2/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  731. SetTween(RS,{C0=GC0(RS)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift2/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  732. SetTween(LS,{C0=GC0(LS)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift2/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  733. elseif animpose == "Running" and normalanim then
  734. local leglift = 280 --30
  735. local leglift2 = -280
  736. SetTween(RH,{C0=GC0(RH)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift2/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  737. SetTween(LH,{C0=GC0(LH)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift2/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  738. SetTween(RS,{C0=GC0(RS)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift2/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  739. SetTween(LS,{C0=GC0(LS)*cf(0,0,0)*angles(math.rad((forWRL*10)*math.cos(sine/8) ),math.rad(0),math.rad(-(leglift2/4)*math.cos(sine/8) ))},"Quad","Out",.1)
  740. elseif animpose == "Jumping" and normalanim then
  741.  
  742. elseif animpose == "Falling" and normalanim then
  743.  
  744. elseif animpose == "Sit" and normalanim then
  745.  
  746. end
  747. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement