Advertisement
waconline

moonlight sword

Oct 27th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.84 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  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. --[[This is a local script so run as local(obviously)]]--
  153. --------------------------------------------------------------------------------------------------
  154. --------------------------------------------------------------------------------------------------
  155. Me = owner
  156. Char = Me.Character
  157. Mouse = Me:GetMouse()
  158. Mode={"BloodLust","Normal"}
  159. DTable={}
  160. Combo = 0
  161. Name="MoonLight Katana"
  162. PrimaryColor = "Really black"
  163. SecondaryColor="Toothpaste"
  164. pcall(function() Char:FindFirstChild("WepModel"):Destroy() Me.Backpack:FindFirstChild(Name):Destroy() end)
  165. Activated = false
  166. Sheathed = true
  167. Dashing = True
  168. Selected = false
  169. ADB=false
  170. DiffColor = false
  171. Camera=game:service("Workspace").CurrentCamera
  172. LeftArm = Char["Left Arm"]
  173. RightArm = Char["Right Arm"]
  174. HRP = Char.HumanoidRootPart["RootJoint"]
  175. SavedRoot = HRP.C0
  176. necko=CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  177. if script.Parent.className ~= "HopperBin" then
  178. h = Instance.new("HopperBin", Me.Backpack)
  179. h.Name = Name
  180. script.Name = "''"
  181. script.Parent = h
  182. end
  183. bin = script.Parent
  184. local WepModel = Instance.new("Model", Char)
  185. WepModel.Name = "WepModel"
  186. local Debz = game:service("Debris")
  187. ------[[ Create Function ]]------
  188. Create = {}
  189. function Create:Part(parent, x,y,z, color, transparency, cancollide, anchored, shape)
  190. c = Instance.new("Part",parent)
  191. c.Material = "SmoothPlastic"
  192. if shape ~= nil then
  193. c.Shape = shape
  194. end
  195. c.TopSurface,c.BottomSurface = 0,0
  196. c.Locked = true
  197. c.formFactor = "Custom"
  198. c.Size = Vector3.new(x,y,z)
  199. if color ~= "random" then
  200. c.BrickColor = color
  201. else c.BrickColor = BrickColor:Random() end
  202. c.Transparency = transparency
  203. c.CanCollide = cancollide
  204. if anchored ~= nil then c.Anchored = anchored end
  205. if parent ~= nil then c.Parent = parent end
  206. return c
  207. end;
  208. function Create:BG(parent)
  209. local c = Instance.new("BodyGyro",parent)
  210. c.P = 20e+003
  211. c.cframe = parent.CFrame
  212. c.maxTorque = Vector3.new(c.P,c.P,c.P)
  213. return c
  214. end;
  215. function Create:BP(parent, pos)
  216. local bp = Instance.new("BodyPosition",parent)
  217. bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  218. bp.position = pos
  219. return bp
  220. end;
  221. function Create:F(parent, size, heat, color, secondarycolor, enabled)
  222. f = Instance.new("Fire",parent)
  223. f.Size = size
  224. f.Heat = heat
  225. if enabled ~= nil then f.Enabled = enabled end
  226. if color ~= nil then f.Color = BrickColor.new(color).Color end
  227. if secondarycolor ~= nil then f.SecondaryColor = BrickColor.new(secondarycolor).Color end
  228. return f
  229. end;
  230. function Create:FM(parent, meshid, x,y,z, meshtexture)
  231. if meshid == "cylinder" then
  232. mesh = Instance.new("CylinderMesh",parent)
  233. mesh.Scale = Vector3.new(x,y,z)
  234. return mesh
  235. else
  236. mesh = Instance.new("SpecialMesh",parent)
  237. if meshid ~= "sphere" then
  238. if type(meshid) == "number" then mesh.MeshId = "rbxassetid://"..meshid else
  239. mesh.MeshId = "rbxassetid://"..meshids[meshid]
  240. end
  241. else mesh.MeshType = 3 end
  242. mesh.Scale = Vector3.new(x,y,z)
  243. if meshtexture ~= nil then
  244. if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else
  245. mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end
  246. end
  247. return mesh
  248. end
  249. end
  250. function Create:Weld(parent,P0,P1,nam,c0,c1)
  251. Weld = Instance.new("Weld",parent)
  252. if P0 then Weld.Part0 = P0 else error("Invalid Part0",2) end
  253. if P1 then Weld.Part1 = P1 else print("Invalid Part1") end
  254. if name then Weld.Name = nam else Weld.Name = "Weld" end
  255. if c0 then Weld.C0 = c0 else print("Invalid C0") end
  256. if c1 then Weld.C1 = c1 else Weld.C1 = CFrame.new(0,0.5,0) end
  257. return Weld
  258. end
  259. M = {["Cos"] = function(a) return math.cos(a) end;
  260. ["Sin"] = function(a) return math.sin(a) end;
  261. ["Rad"] = function(a) return math.rad(a) end}
  262. L0L=Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),1,false,false)
  263. L0LWeld=Create:Weld(L0L,Char.Torso,L0L,"L0LWeld",CFrame.new(0,0,0)*CFrame.fromEulerAnglesXYZ(0,math.rad(-90),math.rad(90)),CFrame.new(0,-0.951,0))
  264. coroutine.wrap(function()
  265. for i = 0,1,1/50 do wait()
  266. angle = math.rad(360*i)
  267. end
  268. end)()
  269. local Delete = function(parent,time)
  270. if time then
  271. Debz:AddItem(parent,time)
  272. else
  273. parent:Destroy()
  274. end end
  275. Lite = Instance.new("PointLight")
  276. Lite.Color = Color3.new(0,0,156)
  277. Lite.Range = 10
  278. Lite.Brightness = 10
  279. Lite.Parent = Char.Torso
  280. Handle = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  281. Instance.new("BlockMesh",Handle).Scale = Vector3.new(0.2,1.15,0.275)
  282. HandleWeld=Create:Weld(Handle,Char.Torso,Handle,"HandleWeld",CFrame.new(1.5,1.8,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75))
  283. Hitbox = Create:Part(WepModel,1,6,0.5,BrickColor.new(PrimaryColor),1,false,false)
  284. Hitbox.Name = "Hitbox"
  285. Instance.new("BlockMesh", Hitbox)
  286. BoxWeld=Create:Weld(Hitbox,Handle,Hitbox,"Boxweld",CFrame.new(0,-2.5,0),CFrame.new(0,-0.25,0))
  287. Sheath = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  288. Instance.new("BlockMesh",Sheath).Scale = Vector3.new(0.3,3,0.3)
  289. SheathWeld=Create:Weld(Char.Torso,Char.Torso,Sheath,"SheathWeld",CFrame.new(0.25,-0.1,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75),CFrame.new(0.2,0.5,0))
  290. for i = 1,6 do
  291. Boxes = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false)
  292. Instance.new("BlockMesh",Boxes).Scale = Vector3.new(0.225,0.2,0.31)
  293. BoxesWeld=Create:Weld(Boxes,Char.Torso,Boxes,"BoxesWeld",CFrame.new(1.95,0,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75),CFrame.new(1.55,i*0.5,0))
  294. end
  295. SheathTip = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  296. SheathMesh = Instance.new("SpecialMesh", SheathTip)
  297. SheathMesh.MeshType = "Wedge"
  298. SheathMesh.Scale = Vector3.new(0.3,0.75,0.3)
  299. SheathTipWeld=Create:Weld(Char.Torso,Sheath,SheathTip,"SheathTipWeld",CFrame.new(0.25,-2,0.65)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.65,0.14,0.25))
  300. print(SheathTip.Position,SheathTip.Transparency)
  301. HandleBase = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  302. Instance.new("BlockMesh",HandleBase).Scale = Vector3.new(0.45,0.25,0.45)
  303. HandleBaseWeld=Create:Weld(HandleBase,Handle,HandleBase,"HandleBaseWeld",CFrame.new(0,-0.175,0))
  304. Blade = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false)
  305. Instance.new("BlockMesh",Blade).Scale = Vector3.new(0.2,3,0.155)
  306. BladeWeld=Create:Weld(Blade,Handle,Blade,"BladeWeld",CFrame.new(0,-1.75,0))
  307. Blade2 = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  308. Instance.new("BlockMesh",Blade2).Scale = Vector3.new(0.1,3,0.156)
  309. Blade2Weld=Create:Weld(Blade2,Handle,Blade2,"Blade2Weld",CFrame.new(0,-1.75,0))
  310. Tip = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false)
  311. TipMesh = Instance.new("SpecialMesh", Tip)
  312. TipMesh.MeshType = "Wedge"
  313. TipMesh.Scale = Vector3.new(0.155,0.5,0.2)
  314. TipWeld=Create:Weld(Tip,Handle,Tip,"TipWeld",CFrame.new(0,-4.5,0)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.01,0.5,0))
  315. Tip2 = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  316. Tip2Mesh = Instance.new("SpecialMesh", Tip2)
  317. Tip2Mesh.MeshType = "Wedge"
  318. Tip2Mesh.Scale = Vector3.new(0.16,0.3,0.1)
  319. Tip2Weld=Create:Weld(Tip2,Handle,Tip2,"Tip2Weld",CFrame.new(0,-4.4,0)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.01,0.5,0))
  320. function Dash()
  321. Dashing = true
  322. DBounce=true
  323. playSound(153092348,Hitbox,1,1)
  324. local vel = Instance.new("BodyVelocity", Char.Torso)
  325. vel.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  326. coroutine.resume(coroutine.create(function()
  327. while Dashing == true do wait()
  328. vel.velocity = Char.Head.CFrame.lookVector * 70
  329. Effect(Char.Torso, 1,0.5,1, 0,0,1, 0,0,0,BrickColor.new("Navy blue"),true, 20329976,Char.Torso.CFrame*CFrame.new(0,-2.75,0).p)
  330. end
  331. end))
  332. wait(1)
  333. vel:remove()
  334. Dashing = false
  335. wait(1)
  336. DBounce=false
  337. end
  338. --Sound Func
  339. function playSound(id,parent,volume,pitch)
  340. local sound = Instance.new("Sound",parent or workspace)
  341. sound.SoundId = "http://www.roblox.com/asset?id="..id
  342. sound.Volume = volume or 1
  343. sound.Pitch = pitch or 1
  344. coroutine.wrap(function()
  345. wait()
  346. sound:Play()
  347. wait(10)
  348. sound:Stop()
  349. sound:Destroy()
  350. end)()
  351. return sound
  352. end
  353. --Play Sound
  354. function Shoot()
  355. Activated = true
  356. Charging = true
  357. Idle()
  358. StartTrail(Tip)
  359. for i = 0,1,0.1 do wait()
  360. RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0)
  361. RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-i*1.575,i*0.15)
  362. end
  363. coroutine.wrap(function()
  364. while Charging == true do wait()
  365. Effect2(Tip,0.4,0.4,0.4,0,0,0,BrickColor.new(SecondaryColor))
  366. end
  367. end)()
  368. end
  369. function FirstSlash()
  370. playSound(10209645,Hitbox,1,1)
  371. Activated = true
  372. Combo = 1
  373. StartTrail(Tip)
  374. pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(5,10), hit.CFrame.p) end) end)
  375. Walk()
  376. for i = 0,1,0.175 do wait()
  377. LW.C1 = CFrame.new(0,0.5,0)*CFrame.fromEulerAnglesXYZ(0,0,i*0.3)
  378. RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(i*2.15,i*-0.75,i*-1.5)
  379. HRP.C0 = SavedRoot*CFrame.fromEulerAnglesXYZ(0,0,i*2)
  380. Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,-1.45*i)
  381. end
  382. EndTrail()
  383. Hitdmg:disconnect(wait(0.1))
  384. Activated = false
  385. end
  386. function SecondSlash()
  387. playSound(10209645,Hitbox,1,1.2)
  388. Activated = true
  389. Combo = 2
  390. StartTrail(Tip)
  391. pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(5,10), hit.CFrame.p) end) end)
  392. for i = 0,1,0.2 do wait()
  393. RW.C0 = CFrame.new(1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0)
  394. RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-i*1.5,0)
  395. end
  396. for i = 0,1,0.2 do wait()
  397. Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,0.725*i)
  398. RW.C1 = CFrame.new(0,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-1.5,i*-1.5)
  399. HRP.C0 = HRP.C1*CFrame.fromEulerAnglesXYZ(0,0,i*-0.875)
  400. end
  401. EndTrail()
  402. Hitdmg:disconnect(wait(0.1))
  403. Activated = false
  404. end
  405. function ThirdSlash()
  406. playSound(10209645,Hitbox,1,1.3)
  407. Activated=true
  408. Combo=3
  409. StartTrail(Tip)
  410. for i = 0,1,0.2 do wait()
  411. HRP.C1 = HRP.C1*CFrame.fromEulerAnglesXYZ(0,0,i*-0.25)
  412. RW.C0 = CFrame.new(1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0)
  413. RW.C1 = CFrame.new(0,i,-0.15)*CFrame.fromEulerAnglesXYZ(i*-1.05,0,i*0.85)
  414. LW.C0 = CFrame.new(-1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0)
  415. LW.C1 = CFrame.new(0,i,-0.15)*CFrame.fromEulerAnglesXYZ(i*-1.05,0,i*-0.85)
  416. Char.Torso.Neck.C0=necko
  417. HandleWeld.C0 = CFrame.new(0,-1.075,0.6)*CFrame.fromEulerAnglesXYZ(math.rad(45/2),math.rad(90),math.rad(69))
  418. HandleWeld.C1 = CFrame.new(0,0.3,0.25)*CFrame.Angles(math.rad(-40),math.rad(-12),math.rad(-10))
  419. end
  420. pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(5,10), hit.CFrame.p,0)
  421. if hit:IsA("Part") then
  422. local evel = Instance.new("BodyVelocity", hit)
  423. evel.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  424. evel.velocity = Char.Torso.CFrame.lookVector * 100
  425. Delete(evel,0.025)
  426. end end) end)
  427. for i = 0,1,0.2 do wait()
  428. RW.C1 = RW.C1*CFrame.new(0,-0.05,0)*CFrame.fromEulerAnglesXYZ(i*0.75,0,0)
  429. LW.C1 = LW.C1*CFrame.new(0,-0.05,0)*CFrame.fromEulerAnglesXYZ(i*0.75,0,0)
  430. end
  431. Hitdmg:disconnect(wait(0.1))
  432. EndTrail()
  433. Activated=false
  434. end
  435. function BDown()
  436. if Activated then return end
  437. if Combo == 0 then
  438. FirstSlash()
  439. coroutine.wrap(function()
  440. wait(0.2)
  441. if Activated == false then
  442. Combo = 0
  443. end
  444. end)()
  445. elseif Combo == 1 then
  446. SecondSlash()
  447. coroutine.wrap(function()
  448. wait(0.2)
  449. if Activated == false then
  450. Combo = 0
  451. end
  452. end)()
  453. elseif Combo == 2 then
  454. ThirdSlash()
  455. coroutine.wrap(function()
  456. wait(0.2)
  457. if Activated == false then
  458. Combo = 0
  459. end
  460. end)()
  461. end
  462. end
  463. function key(key)
  464. if Activated then return end
  465. if key == "x" and not DBounce then
  466. Dash()
  467. end
  468. end
  469. function Walk()
  470. Camera.CameraSubject=Char.Humanoid
  471. Char.Humanoid.WalkSpeed = 25
  472. RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45,0,-0.2)
  473. RW.C1 = CFrame.new(0,0.35,0)*CFrame.fromEulerAnglesXYZ(3.5,0.5,0.9)
  474. LW.C0 = CFrame.new(-1.4,0.45,0)*CFrame.fromEulerAnglesXYZ(0.4,0.25,-0.5)
  475. LW.C1 = CFrame.new(0,0.5,0)
  476. HRP.C0 = SavedRoot*CFrame.fromEulerAnglesXYZ(0,0,-1.5)
  477. HRP.C1=CFrame.new(0,0,0,-1,-0,-0,0,0,1,0,1,0)
  478. Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,1.5)
  479. HandleWeld.Part0 = RightArm
  480. HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0)
  481. HandleWeld.C1 = CFrame.new(0,0.5,0)
  482. HandleWeld.Part1 = Handle
  483. end
  484.  
  485. function Idle()
  486. if RW and LW then
  487. RW.Part0 = Char.Torso
  488. RW.C0 = CFrame.new(1.5, 0.5, -0)*CFrame.fromEulerAnglesXYZ(0,0,0.2)
  489. RW.C1 = CFrame.new(0, 0.5, 0)
  490. RW.Part1 = RightArm
  491. LW.Part0 = Char.Torso
  492. LW.C0 = CFrame.new(-1.5, 0.5, 0)*CFrame.fromEulerAnglesXYZ(0,0,-0.2)
  493. LW.C1 = CFrame.new(0, 0.5, 0)
  494. LW.Part1 = LeftArm
  495. Char.Torso.Neck.C0=necko
  496. Camera.CameraSubject=Char.Humanoid
  497. HRP.C0=SavedRoot
  498. HRP.C1=CFrame.new(0,0,0,-1,-0,-0,0,0,1,0,1,0)
  499. Char.Humanoid.WalkSpeed = 18
  500. HandleWeld.Part0 = RightArm
  501. HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0)
  502. HandleWeld.C1 = CFrame.new(0,0.5,0)
  503. HandleWeld.Part1 = Handle
  504. end
  505. end
  506. function Selection()
  507. for i = 0,1,0.1 do wait()
  508. RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45*i,0,i*-0.2)
  509. end
  510. playSound(130785405,Hitbox,1,1)
  511.  
  512. HandleWeld.Part0 = RightArm
  513. HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0)
  514. HandleWeld.C1 = CFrame.new(0,0.5,0)
  515. HandleWeld.Part1 = Handle
  516. for i = 0,1,0.15 do wait()
  517. RW.C1 = CFrame.new(0,0.35,0)*CFrame.fromEulerAnglesXYZ(i*3.5,i*0.75,i)
  518. LW.C0 = CFrame.new(-1.4,0.45,0)*CFrame.fromEulerAnglesXYZ(i*0.4,i*0.25,i*-0.25)
  519. end
  520. Idle()
  521. Selected = true
  522. Sheathed = false
  523. end
  524. function s(mouse)
  525. if Sheathing then return end
  526. mouse.KeyDown:connect(key)
  527. mouse.Button1Down:connect(function() BDown(mouse) end)
  528. RSH = Char.Torso["Right Shoulder"]
  529. LSH = Char.Torso["Left Shoulder"]
  530. RW=Create:Weld(RightArm,Char.Torso,RightArm,"RW",CFrame.new(1.5, 0.5, -0)*CFrame.fromEulerAnglesXYZ(1.5,1.15,-0.25))
  531. LW=Create:Weld(LeftArm,Char.Torso,LeftArm,"LW",CFrame.new(-1.5, 0.5, 0)*CFrame.fromEulerAnglesXYZ(-0.5,0,-0.1))
  532. Selection()
  533. Idle()
  534. Sheathed = false
  535. end
  536. function ds()
  537. Sheathing = true
  538. RW.C0 = CFrame.new(1.5, 0.5, -0)
  539. RW.C1 = CFrame.new(0, 0.5, 0)
  540. for i =0,1,0.1 do wait()
  541. RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45*i,0,i*-0.2)
  542. end
  543. playSound(130785407,Hitbox,1,1)
  544. HandleWeld.Part0 = Char.Torso
  545. HandleWeld.C0 = CFrame.new(1.5,1.8,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75)
  546. HandleWeld.C1 = CFrame.new(0,0.5,0)
  547. HandleWeld.Part1 = Handle
  548. pcall(function() HRP.C0 = SavedRoot
  549. RW.Parent = nil
  550. LW.Parent = nil
  551. Char.Torso.Neck.C0 = necko
  552. RSH.Parent = Char.Torso
  553. LSH.Parent = Char.Torso end)
  554. Sheathing = false
  555. Sheathed = true
  556. Char.Humanoid.WalkSpeed = 18
  557. end
  558. bin.Selected:connect(s)
  559. bin.Deselected:connect(ds)
  560. function StartTrail(part,color)
  561. trailin = true
  562. local lastPoint = part.Position
  563. coroutine.wrap(function()
  564. while trailin do wait()
  565. local point = CFrame.new(lastPoint, part.Position) * CFrame.Angles(-math.pi/2, 0, 0)
  566. local mag = (lastPoint - part.Position).magnitude
  567. local p = Create:Part(Char,1,1,1,BrickColor.new(PrimaryColor),0.1,false,true)
  568. if color then p.BrickColor = BrickColor.new(color) end
  569. Instance.new("SpecialMesh",p).Scale=Vector3.new(0.125, mag, 0.125)
  570. p.CFrame = point * CFrame.new(0, mag/1.95, 0)
  571. lastPoint = part.Position
  572. coroutine.wrap(function() for i = 0,1,0.1 do wait() p.Transparency = i end p:Destroy() end)()
  573. end
  574. end)()
  575. end
  576. function EndTrail()
  577. trailin = false
  578. end
  579. Damage = function(hit, dmg, pos,time)
  580. if ADB == false then
  581. ADB = true
  582. coroutine.wrap(function()
  583. if time ==nil then
  584. ADB=false
  585. else
  586. wait(time)
  587. end
  588. ADB = false
  589. end)()
  590. if hit.Parent==nil and hit.Parent.Torso == nil then
  591. return
  592. print("hai")
  593. end
  594. if hit~=nil and hit.Parent ~= Char then
  595. hum = hit.Parent:FindFirstChild("Humanoid")
  596. if hum and hum.Health ~= 0 then
  597. playSound(153092292,Hitbox,1,1)
  598. critcalchance = math.ceil(math.random(1,15))
  599. if critcalchance == 5 then
  600. pcall(function() hum.Health = hum.Health - dmg*2 end)
  601. if hum.Health == 0 then
  602. KO=true
  603. else
  604. KO=false
  605. end
  606. crit = true
  607. else
  608. pcall(function() hum.Health = hum.Health - dmg end)
  609. if hum.Health == 0 then
  610. KO=true
  611. else
  612. KO=false
  613. end
  614. crit = false
  615. end
  616. mod = Instance.new("Model",game:service("Workspace"))
  617. if not KO then
  618. if crit == true then
  619. mod.Name = "-"..(dmg*2)
  620. else
  621. mod.Name = "-"..dmg
  622. end
  623. else
  624. mod.Name = "KO!"
  625. crit=true
  626. end
  627. if not crit then
  628. p = Create:Part(mod,0.25,0.15,0.25, BrickColor.new(SecondaryColor),0.25,false,false)
  629. else
  630. p = Create:Part(mod,0.35,0.25,0.35, BrickColor.new("Really red"),0.25,false,false)
  631. end
  632. p.CFrame = CFrame.new(pos)*CFrame.new(0,1,math.random(-2,2))
  633. BP = Create:BP(p,p.Position+Vector3.new(0,6,0))
  634. BP.P = 1500
  635. s = Instance.new("SelectionBox",p)
  636. s.Adornee = s.Parent
  637. s.Transparency=p.Transparency
  638. s.Color = p.BrickColor
  639. local BGUI = Instance.new("BillboardGui",p)
  640. BGUI.Size = UDim2.new(1,0,1,0)
  641. BGUI.StudsOffset = Vector3.new(0,1,0)
  642. BGUI.Adornee = BGUI.Parent
  643. local frame = Instance.new("Frame",BGUI)
  644. frame.Size = UDim2.new(1, 0, 1, 0)
  645. frame.BackgroundTransparency = 1
  646. frame.BackgroundColor3 = Color3.new(1, 1, 1)
  647. local BText = Instance.new("TextLabel",BGUI)
  648. BText.TextStrokeTransparency = 0
  649. BText.TextStrokeColor3 = BrickColor.new(PrimaryColor).Color
  650. BText.BackgroundTransparency = 1
  651. BText.Position = UDim2.new(0, 0, 0.1, 0)
  652. BText.FontSize = "Size18"
  653. BText.Size = UDim2.new(0.9, 0, 0.4, 0)
  654. if not crit and not KO then
  655. BText.Font = "SourceSans"
  656. BText.TextColor3 = BrickColor.new(SecondaryColor).Color
  657. elseif crit and not KO then
  658. BText.FontSize = "Size24"
  659. BText.Font = "SourceSans"
  660. BText.TextColor3 = BrickColor.new("Really red").Color
  661. elseif KO and crit then
  662. BText.FontSize = "Size36"
  663. BText.Font = "Legacy"
  664. BText.TextColor3 = BrickColor.new("Really red").Color
  665. end
  666. BText.Font = "SourceSans"
  667. BText.Text = mod.Name
  668. Delete(mod,2.5)
  669. coroutine.wrap(function()
  670. wait(0.5)
  671. for i = 0,1,0.035 do wait()
  672. BText.TextTransparency = i
  673. BText.TextStrokeTransparency = BText.TextStrokeTransparency + i
  674. end
  675. end)()
  676. end
  677. end
  678. end
  679. end
  680. function Effect(part,x1,y1,z1,x2,y2,z2,x3,y3,z3,color,meshid,id,pos,collid)
  681. S=Create:Part(Char, 1,1,1, color, 0, false, true)
  682. if collid then
  683. S.CanCollide=collid
  684. else
  685. S.CanCollide=false
  686. end
  687. S.CFrame = CFrame.new(pos)
  688. S.CFrame=S.CFrame*CFrame.new(x2,y2,z2)*CFrame.fromEulerAnglesXYZ(x3,y3,z3)
  689. if meshid == true then
  690. local msh1 = Instance.new("SpecialMesh",S)
  691. msh1.Scale = Vector3.new(1,1,1)
  692. msh1.MeshType = "FileMesh"
  693. msh1.MeshId = "http://www.roblox.com/asset/?id="..id..""
  694. end
  695. if meshid == "block" then
  696. msh1 = Instance.new("BlockMesh",S)
  697. msh1.Scale = Vector3.new(1,1,1)
  698. elseif meshid == "ball" then
  699. local msh1 = Instance.new("SpecialMesh",S)
  700. msh1.Scale = Vector3.new(1,1,1)
  701. msh1.MeshType = "Sphere"
  702. end
  703. coroutine.resume(coroutine.create(function(Part,CF) for i=1, 9 do Part.Mesh.Scale = Part.Mesh.Scale + Vector3.new(x1, y1, z1) Part.Transparency=i*.1 wait() end Part:Destroy() end),S,S.CFrame)
  704. end
  705. Lightning = function(Start,End,Times,Offset,Color,Thickness,Transparency)
  706. local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset}
  707. for i=1,Times do
  708. local li = Instance.new("Part",workspace)
  709. li.Material = "SmoothPlastic"
  710. li.TopSurface = "SmoothNoOutlines"
  711. li.BottomSurface = "SmoothNoOutlines"
  712. li.RightSurface = "SmoothNoOutlines"
  713. li.LeftSurface = "SmoothNoOutlines"
  714. li.Anchored = true li.Transparency =
  715. Transparency or 0.4 li.BrickColor =
  716. BrickColor.new(Color)
  717. li.formFactor = "Custom"
  718. li.CanCollide = false
  719. li.Size = Vector3.new(1,1,1)
  720. lim = Instance.new("BlockMesh",li)
  721. lim.Scale = Vector3.new(Thickness,Thickness,magz/Times)
  722. local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  723. function touch(hit)
  724. if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent ~= Char then
  725. Damage(hit, math.random(5,10), hit.CFrame.p)
  726. end end li.Touched:connect(touch)
  727. local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
  728. if Times == i then
  729. local magz2 = (curpos - End).magnitude lim.Scale = Vector3.new(Thickness,Thickness,magz2)
  730. li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
  731. else
  732. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  733. end
  734. curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p game.Debris:AddItem(li,0.25)
  735. end
  736. end
  737. function Effect2(part,x1,y1,z1,x2,y2,z2,color)
  738. local msh2 = Instance.new("BlockMesh")
  739. msh2.Scale = Vector3.new(x1, y1, z1)
  740. S=Create:Part(Char, 1,1,1, color, 0.5, false, true)
  741. msh2.Parent = S
  742. S.CFrame=part.CFrame*CFrame.new(x2, y2, z2)*CFrame.fromEulerAnglesXYZ(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  743. coroutine.resume(coroutine.create(function(Part,CF) for i=1, 9 do Part.Mesh.Scale = Part.Mesh.Scale + Vector3.new(0.1,0.1,0.1) Part.CFrame=Part.CFrame*CFrame.fromEulerAnglesXYZ(math.random(-50,50),math.random(-50,50),math.random(-50,50)) Part.Transparency=i*.1 wait() end Part.Parent=nil end),S,S.CFrame)
  744. end
  745. coroutine.wrap(function()
  746. game:service("RunService").RenderStepped:connect(function()
  747. if not Sheathed and not Activated and not Sheathing and Combo == 0 then
  748. if Vector3.new(Char.Torso.Velocity.x, 0, Char.Torso.Velocity.z).magnitude > 2 then
  749. Walk()
  750. else
  751. Idle()
  752. end
  753. end
  754. end)
  755. end)()
  756. pcall(function() script.source.Value = "l0l" end)
  757. while true do game:GetService("RunService").RenderStepped:wait(-9001)
  758. if not Sheathed then
  759. wait(math.random(-1,2))
  760. lightswitch = math.random(1,2)
  761. if lightswitch == 1 then
  762. Lightning(HandleBase.CFrame*CFrame.new(0,1,0).p,Tip.CFrame.p,math.random(3,6),math.random(-0.75,0.75),"Navy blue",0.04,0.2)
  763. elseif lightswitch == 2 then
  764. Lightning(HandleBase.CFrame*CFrame.new(0,1,0).p,Tip.CFrame.p,math.random(3,6),math.random(-0.75,0.75),PrimaryColor,0.04,0.2)
  765. end
  766. end
  767. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement