Advertisement
bmrx13

Untitled

Sep 28th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.09 KB | None | 0 0
  1.  
  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 by Mokiros")
  7. local rp = RealPlayer
  8. script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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(),Button2Up=fakeEvent(),Button2Down=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 then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68.  
  69. local Mouse = Player:GetMouse()
  70. local UIS = game:GetService("UserInputService")
  71. local input = function(io,a)
  72. if a then return end
  73. --Since InputObject is a client-side instance, we create and pass table instead
  74. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  75. end
  76. UIS.InputBegan:Connect(input)
  77. UIS.InputEnded:Connect(input)
  78.  
  79. local h,t
  80. --Give the server mouse data 30 times every second, but only if the values changed
  81. --If player is not moving their mouse, client won't fire events
  82. while wait(1/30) do
  83. if h~=Mouse.Hit or t~=Mouse.Target then
  84. h,t=Mouse.Hit,Mouse.Target
  85. Event:FireServer({isMouse=true,Target=t,Hit=h})
  86. end
  87. end]==],Player.Character)
  88.  
  89. ----Sandboxed game object that allows the usage of client-side methods and services
  90. --Real game object
  91. local _rg = game
  92.  
  93. --Metatable for fake service
  94. local fsmt = {
  95. __index = function(self,k)
  96. local s = rawget(self,"_RealService")
  97. if s then
  98. return typeof(s[k])=="function"
  99. and function(_,...)return s[k](s,...)end or s[k]
  100. end
  101. end,
  102. __newindex = function(self,k,v)
  103. local s = rawget(self,"_RealService")
  104. if s then s[k]=v end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return rawget(self,s) or _rg:GetService(s)
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. RunService = FakeService({
  123. _btrs = {},
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126. self._btrs[name] = self.Heartbeat:Connect(fun)
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132. }
  133. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  134. g.service = g.GetService
  135. FakeService(g,game)
  136. --Changing owner to fake player object to support owner:GetMouse()
  137. game,owner = g,g.Players.LocalPlayer
  138. end
  139. function sandbox(var,func)
  140. local env = getfenv(func)
  141. local newenv = setmetatable({},{
  142. __index = function(self,k)
  143. if k=="script" then
  144. return var
  145. else
  146. return env[k]
  147. end
  148. end,
  149. })
  150. setfenv(func,newenv)
  151. return func
  152. end
  153. cors = {}
  154. mas = Instance.new("Model",game:GetService("Lighting"))
  155. Tool0 = Instance.new("Tool")
  156. Part1 = Instance.new("Part")
  157. SpecialMesh2 = Instance.new("SpecialMesh")
  158. Sparkles3 = Instance.new("Sparkles")
  159. Sound4 = Instance.new("Sound")
  160. PointLight5 = Instance.new("PointLight")
  161. Sound6 = Instance.new("Sound")
  162. Animation7 = Instance.new("Animation")
  163. Animation8 = Instance.new("Animation")
  164. LocalScript9 = Instance.new("LocalScript")
  165. LocalScript10 = Instance.new("LocalScript")
  166. Animation11 = Instance.new("Animation")
  167. Animation12 = Instance.new("Animation")
  168. Script13 = Instance.new("Script")
  169. Tool0.Name = "SparkletimeClaymore"
  170. Tool0.Parent = mas
  171. Tool0.TextureId = "http://www.roblox.com/asset/?id=218498377"
  172. Tool0.GripForward = Vector3.new(-0, -1, -8.10005167e-06)
  173. Tool0.GripPos = Vector3.new(0, 0, 3)
  174. Tool0.GripUp = Vector3.new(0, 8.10005167e-06, -1)
  175. Part1.Name = "Handle"
  176. Part1.Parent = Tool0
  177. Part1.Rotation = Vector3.new(45, 0, 0)
  178. Part1.Locked = true
  179. Part1.FormFactor = Enum.FormFactor.Custom
  180. Part1.Size = Vector3.new(0.200000003, 0.5, 7)
  181. Part1.CFrame = CFrame.new(-28, 2.65165901, 152, 1, 0, 0, 0, 0.707106709, -0.707106709, 0, 0.707106709, 0.707106709)
  182. Part1.BottomSurface = Enum.SurfaceType.Smooth
  183. Part1.TopSurface = Enum.SurfaceType.Smooth
  184. Part1.Position = Vector3.new(-28, 2.65165901, 152)
  185. Part1.Orientation = Vector3.new(45, 0, 0)
  186. SpecialMesh2.Parent = Part1
  187. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=218498178"
  188. SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
  189. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=218498286"
  190. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  191. SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
  192. Sparkles3.Parent = Part1
  193. Sparkles3.Color = Color3.new(1.77083, 0, 0)
  194. Sparkles3.SparkleColor = Color3.new(1, 0, 0)
  195. Sparkles3.Color = Color3.new(1.77083, 0, 0)
  196. Sound4.Name = "Slash"
  197. Sound4.Parent = Part1
  198. Sound4.SoundId = "rbxasset://sounds/swordslash.wav"
  199. Sound4.Volume = 0.69999998807907
  200. PointLight5.Parent = Part1
  201. PointLight5.Color = Color3.new(1, 0, 0)
  202. PointLight5.Brightness = 25
  203. PointLight5.Range = 5
  204. PointLight5.Color = Color3.new(1, 0, 0)
  205. Sound6.Name = "Explosion"
  206. Sound6.Parent = Part1
  207. Sound6.SoundId = "rbxasset://sounds//Rocket shot.wav"
  208. Sound6.Volume = 1
  209. Animation7.Name = "Swing1"
  210. Animation7.Parent = Tool0
  211. Animation7.AnimationId = "http://www.roblox.com/asset/?id=220502245"
  212. Animation8.Name = "Swing2"
  213. Animation8.Parent = Tool0
  214. Animation8.AnimationId = "http://www.roblox.com/asset/?id=220504509"
  215. LocalScript9.Parent = Tool0
  216. table.insert(cors,sandbox(LocalScript9,function()
  217. --Made by Luckymaxer
  218.  
  219. Tool = script.Parent
  220. Handle = Tool:WaitForChild("Handle")
  221.  
  222. Players = game:GetService("Players")
  223. RunService = game:GetService("RunService")
  224.  
  225. Camera = game:GetService("Workspace").CurrentCamera
  226.  
  227. Animations = {}
  228. LocalObjects = {}
  229.  
  230. ServerControl = Tool:WaitForChild("ServerControl")
  231. ClientControl = Tool:WaitForChild("ClientControl")
  232.  
  233. ToolEquipped = false
  234.  
  235. function SetAnimation(mode, value)
  236. if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
  237. for i, v in pairs(Animations) do
  238. if v.Animation == value.Animation then
  239. v.AnimationTrack:Stop()
  240. table.remove(Animations, i)
  241. end
  242. end
  243. local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
  244. table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
  245. AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
  246. elseif mode == "StopAnimation" and value then
  247. for i, v in pairs(Animations) do
  248. if v.Animation == value.Animation then
  249. v.AnimationTrack:Stop()
  250. table.remove(Animations, i)
  251. end
  252. end
  253. end
  254. end
  255.  
  256. function DisableJump(Boolean)
  257. if PreventJump then
  258. PreventJump:disconnect()
  259. end
  260. if Boolean then
  261. PreventJump = Humanoid.Changed:connect(function(Property)
  262. if Property == "Jump" then
  263. Humanoid.Jump = false
  264. end
  265. end)
  266. end
  267. end
  268.  
  269. function CheckIfAlive()
  270. return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
  271. end
  272.  
  273. function Equipped(Mouse)
  274. Character = Tool.Parent
  275. Player = Players:GetPlayerFromCharacter(Character)
  276. Humanoid = Character:FindFirstChild("Humanoid")
  277. ToolEquipped = true
  278. if not CheckIfAlive() then
  279. return
  280. end
  281. PlayerMouse = Player:GetMouse()
  282. Mouse.Button1Down:connect(function()
  283. InvokeServer("MouseClick", {Down = true})
  284. end)
  285. Mouse.Button1Up:connect(function()
  286. InvokeServer("MouseClick", {Down = false})
  287. end)
  288. Mouse.KeyDown:connect(function(Key)
  289. InvokeServer("KeyPress", {Key = Key, Down = true})
  290. end)
  291. Mouse.KeyUp:connect(function(Key)
  292. InvokeServer("KeyPress", {Key = Key, Down = false})
  293. end)
  294. Mouse.Move:connect(function()
  295. InvokeServer("MouseMove", {Position = Mouse.Hit.p, Target = Mouse.Target})
  296. end)
  297. end
  298.  
  299. function Unequipped()
  300. ToolEquipped = false
  301. LocalObjects = {}
  302. for i, v in pairs(Animations) do
  303. if v and v.AnimationTrack then
  304. v.AnimationTrack:Stop()
  305. end
  306. end
  307. for i, v in pairs({PreventJump, ObjectLocalTransparencyModifier}) do
  308. if v then
  309. v:disconnect()
  310. end
  311. end
  312. Animations = {}
  313. end
  314.  
  315. function InvokeServer(mode, value)
  316. local ServerReturn
  317. pcall(function()
  318. ServerReturn = ServerControl:InvokeServer(mode, value)
  319. end)
  320. return ServerReturn
  321. end
  322.  
  323. function OnClientInvoke(mode, value)
  324. if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
  325. SetAnimation("PlayAnimation", value)
  326. elseif mode == "StopAnimation" and value then
  327. SetAnimation("StopAnimation", value)
  328. elseif mode == "PlaySound" and value then
  329. value:Play()
  330. elseif mode == "StopSound" and value then
  331. value:Stop()
  332. elseif mode == "MousePosition" then
  333. return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
  334. elseif mode == "DisableJump" then
  335. DisableJump(value)
  336. elseif mode == "SetLocalTransparencyModifier" and value and ToolEquipped then
  337. pcall(function()
  338. local ObjectFound = false
  339. for i, v in pairs(LocalObjects) do
  340. if v == value then
  341. ObjectFound = true
  342. end
  343. end
  344. if not ObjectFound then
  345. table.insert(LocalObjects, value)
  346. if ObjectLocalTransparencyModifier then
  347. ObjectLocalTransparencyModifier:disconnect()
  348. end
  349. ObjectLocalTransparencyModifier = RunService.RenderStepped:connect(function()
  350. for i, v in pairs(LocalObjects) do
  351. if v.Object and v.Object.Parent then
  352. local CurrentTransparency = v.Object.LocalTransparencyModifier
  353. if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
  354. v.Object.LocalTransparencyModifier = v.Transparency
  355. end
  356. else
  357. table.remove(LocalObjects, i)
  358. end
  359. end
  360. end)
  361. end
  362. end)
  363. end
  364. end
  365.  
  366. ClientControl.OnClientInvoke = OnClientInvoke
  367. Tool.Equipped:connect(Equipped)
  368. Tool.Unequipped:connect(Unequipped)
  369. end))
  370. LocalScript10.Name = "MouseIcon"
  371. LocalScript10.Parent = Tool0
  372. table.insert(cors,sandbox(LocalScript10,function()
  373. --Made by Luckymaxer
  374.  
  375. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  376. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  377.  
  378. Tool = script.Parent
  379.  
  380. Mouse = nil
  381.  
  382. function UpdateIcon()
  383. if Mouse then
  384. Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  385. end
  386. end
  387.  
  388. function OnEquipped(ToolMouse)
  389. Mouse = ToolMouse
  390. UpdateIcon()
  391. end
  392.  
  393. function OnChanged(Property)
  394. if Property == "Enabled" then
  395. UpdateIcon()
  396. end
  397. end
  398.  
  399. Tool.Equipped:connect(OnEquipped)
  400. Tool.Changed:connect(OnChanged)
  401.  
  402. end))
  403. Animation11.Name = "Charge"
  404. Animation11.Parent = Tool0
  405. Animation11.AnimationId = "http://www.roblox.com/asset/?id=220540334"
  406. Animation12.Name = "JumpAttack"
  407. Animation12.Parent = Tool0
  408. Animation12.AnimationId = "http://www.roblox.com/asset/?id=220512718"
  409. Script13.Parent = Tool0
  410. table.insert(cors,sandbox(Script13,function()
  411. --Made by Luckymaxer
  412.  
  413. Tool = script.Parent
  414. Handle = Tool:WaitForChild("Handle")
  415.  
  416. Players = game:GetService("Players")
  417. Debris = game:GetService("Debris")
  418.  
  419. BaseUrl = "http://www.roblox.com/asset/?id="
  420.  
  421. BasePart = Instance.new("Part")
  422. BasePart.Shape = Enum.PartType.Block
  423. BasePart.Material = Enum.Material.Plastic
  424. BasePart.TopSurface = Enum.SurfaceType.Smooth
  425. BasePart.BottomSurface = Enum.SurfaceType.Smooth
  426. BasePart.FormFactor = Enum.FormFactor.Custom
  427. BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
  428. BasePart.CanCollide = true
  429. BasePart.Locked = true
  430. BasePart.Anchored = false
  431.  
  432. BaseDiamond = BasePart:Clone()
  433. BaseDiamond.Name = "Diamond"
  434. BaseDiamond.BrickColor = BrickColor.new("Really red")
  435. BaseDiamond.Reflectance = 0.5
  436. BaseDiamond.Size = Vector3.new(1.35, 1.35, 1.35)
  437. BaseDiamond.CanCollide = false
  438. DiamondMesh = Instance.new("SpecialMesh")
  439. DiamondMesh.MeshType = Enum.MeshType.FileMesh
  440. DiamondMesh.MeshId = (BaseUrl .. "9756362")
  441. DiamondMesh.TextureId = ""
  442. DiamondMesh.Scale = Vector3.new(1, 1, 1)
  443. DiamondMesh.VertexColor = Vector3.new(1, 1, 1)
  444. DiamondMesh.Offset = Vector3.new(0, 0, 0)
  445. DiamondMesh.Parent = BaseDiamond
  446.  
  447. EnchantingCircle = BasePart:Clone()
  448. EnchantingCircle.Name = "EnchantingCircle"
  449. EnchantingCircle.Transparency = 1
  450. EnchantingCircle.Size = Vector3.new(1, 1, 1)
  451. EnchantingCircle.CanCollide = false
  452. EnchantingDecal = Instance.new("Decal")
  453. EnchantingDecal.Texture = (BaseUrl .. "212259445")
  454. CircleMesh = Instance.new("BlockMesh")
  455. CircleMesh.Parent= EnchantingCircle
  456. TopDecal = EnchantingDecal:Clone()
  457. TopDecal.Face = Enum.NormalId.Top
  458. TopDecal.Parent = EnchantingCircle
  459. BottomDecal = EnchantingDecal:Clone()
  460. BottomDecal.Face = Enum.NormalId.Bottom
  461. BottomDecal.Parent = EnchantingCircle
  462.  
  463. Animations = {
  464. Swing1 = {Animation = Tool:WaitForChild("Swing1"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5, Damage = {Min = 15, Max = 25}},
  465. Swing2 = {Animation = Tool:WaitForChild("Swing2"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5, Damage = {Min = 20, Max = 35}},
  466. JumpAttack = {Animation = Tool:WaitForChild("JumpAttack"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5, Damage = {Min = 20, Max = 25}},
  467. Charge = {Animation = Tool:WaitForChild("Charge"), FadeTime = nil, Weight = nil, Speed = 0.25, Duration = nil},
  468. }
  469.  
  470. Sounds = {
  471. Slash = Handle:WaitForChild("Slash"),
  472. Explosion = Handle:WaitForChild("Explosion"),
  473. }
  474.  
  475. TouchDamage = {Min = 999999999, Max = 999999999}
  476.  
  477. ToolEquipped = false
  478. Attacking = false
  479. MouseDown = false
  480. FullyCharged = false
  481. SpecialActive = false
  482. SpecialReloadTime = 0.001
  483.  
  484. Clicks = 0
  485. FirstClick = false
  486.  
  487. Gravity = 196.20
  488. Rate = (1 / 60)
  489.  
  490. ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
  491. ServerControl.Name = "ServerControl"
  492. ServerControl.Parent = Tool
  493.  
  494. ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
  495. ClientControl.Name = "ClientControl"
  496. ClientControl.Parent = Tool
  497.  
  498. for i, v in pairs(Tool:GetChildren()) do
  499. if v:IsA("BasePart") and v ~= Handle then
  500. v:Destroy()
  501. end
  502. end
  503.  
  504. Tool.Enabled = true
  505.  
  506. function RayCast(Position, Direction, MaxDistance, IgnoreList)
  507. local IgnoreList = ((type(IgnoreList) == "table" and IgnoreList) or {IgnoreList})
  508. return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position, Direction.unit * (MaxDistance or 999.999)), IgnoreList)
  509. end
  510.  
  511. function IsTeamMate(Player1, Player2)
  512. return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
  513. end
  514.  
  515. function TagHumanoid(humanoid, player)
  516. local Creator_Tag = Instance.new("ObjectValue")
  517. Creator_Tag.Name = "creator"
  518. Creator_Tag.Value = player
  519. Debris:AddItem(Creator_Tag, 2)
  520. Creator_Tag.Parent = humanoid
  521. end
  522.  
  523. function UntagHumanoid(humanoid)
  524. for i, v in pairs(humanoid:GetChildren()) do
  525. if v:IsA("ObjectValue") and v.Name == "creator" then
  526. v:Destroy()
  527. end
  528. end
  529. end
  530.  
  531. function CheckTableForInstance(Table, Instance)
  532. for i, v in pairs(Table) do
  533. if v == Instance then
  534. return true
  535. end
  536. end
  537. return false
  538. end
  539.  
  540. function Blow(Hit)
  541. if not Hit or not Hit.Parent or not CheckIfAlive() then
  542. return
  543. end
  544.  
  545. local character = Hit.Parent
  546.  
  547. local player = Players:GetPlayerFromCharacter(character)
  548. if player and IsTeamMate(Player, player) then
  549. return
  550. end
  551.  
  552. local humanoid = character:FindFirstChild("Humanoid")
  553. if character == Character or not humanoid or humanoid.Health == 0 then
  554. return
  555. end
  556.  
  557. local RightArm = Character:FindFirstChild("Right Arm")
  558. if not RightArm then
  559. return
  560. end
  561. local RightGrip = RightArm:FindFirstChild("RightGrip")
  562. if not RightGrip or (RightGrip.Part0 ~= RightArm and RightGrip.Part1 ~= RightArm) then
  563. return
  564. end
  565.  
  566. UntagHumanoid(humanoid)
  567. TagHumanoid(humanoid, Player)
  568.  
  569. local DamageValue = ((CurrentAnimation and CurrentAnimation.Damage) or TouchDamage)
  570. local DamageAmount = math.random(DamageValue.Min, DamageValue.Max)
  571.  
  572. humanoid:TakeDamage(DamageAmount)
  573.  
  574. end
  575.  
  576. function Attack(PossibleAnims, PossibleSounds)
  577. if PossibleAnims and #PossibleAnims > 0 then
  578. if PossibleSounds and #PossibleSounds > 0 then
  579. PossibleSounds[math.random(1, #PossibleSounds)]:Play()
  580. end
  581. CurrentAnimation = PossibleAnims[math.random(1, #PossibleAnims)]
  582. InvokeClient("PlayAnimation", CurrentAnimation)
  583. if CurrentAnimation.Duration and CurrentAnimation.Duration > 0 then
  584. wait(CurrentAnimation.Duration)
  585. CurrentAnimation = nil
  586. end
  587. end
  588. end
  589.  
  590. function MotionEffect()
  591. local TransparencyRate = 100
  592. local OriginalTransparency = 0.75
  593. while ToolEquipped and Attacking do
  594. local FakeHandle = Handle:Clone()
  595. for i, v in pairs(FakeHandle:GetChildren()) do
  596. if not v:IsA("DataModelMesh") then
  597. v:Destroy()
  598. end
  599. end
  600. FakeHandle.Name = "FakeHandle"
  601. FakeHandle.Anchored = true
  602. FakeHandle.CanCollide = false
  603. FakeHandle.Locked = true
  604. FakeHandle.Transparency = OriginalTransparency
  605. Spawn(function()
  606. for i = 1, (FakeHandle.Transparency * TransparencyRate) do
  607. FakeHandle.Transparency = FakeHandle.Transparency + (OriginalTransparency / TransparencyRate)
  608. wait(Rate)
  609. end
  610. if FakeHandle and FakeHandle.Parent then
  611. FakeHandle:Destroy()
  612. end
  613. end)
  614. Debris:AddItem(FakeHandle, 5)
  615. FakeHandle.Parent = Tool
  616. wait(Rate)
  617. end
  618. end
  619.  
  620. function Activated()
  621. if not Tool.Enabled or not ToolEquipped then
  622. return
  623. end
  624. Attacking = true
  625. Clicks = (Clicks + 1)
  626. if not FirstClick then
  627. FirstClick = true
  628. local CurrentlyEquipped = true
  629. ToolUnequipped = Tool.Unequipped:connect(function()
  630. CurrentlyEquipped = false
  631. end)
  632. wait(0.15)
  633. if ToolUnequipped then
  634. ToolUnequipped:disconnect()
  635. end
  636. if not CurrentlyEquipped then
  637. return
  638. end
  639. Tool.Enabled = false
  640. Attacking = true
  641. Spawn(MotionEffect)
  642. local AttackAnims = {}
  643. local AttackSounds = {}
  644. if MouseDown and Clicks == 1 and not SpecialActive then
  645. AttackAnims = {Animations.Charge}
  646. Spawn(function()
  647. if not SpecialActive then
  648. local MaxChargeTime = 15
  649. local FullyChargedTime = 0.001
  650. local ChargeTick = tick()
  651. local DiamondTick = tick()
  652. local DiamondRadius = 12
  653. local DiamondOffset = 6
  654. local DiamondVelocity = 50
  655. local CreatedCircle = false
  656. EnchantmentCircle = EnchantingCircle:Clone()
  657. EnchantmentCircle.Mesh.Scale = Vector3.new(DiamondRadius, 0.2, DiamondRadius)
  658. while MouseDown and ToolEquipped and CheckIfAlive() and (tick() - ChargeTick) < MaxChargeTime do
  659. if not FullyCharged and (tick() - ChargeTick) >= FullyChargedTime then
  660. FullyCharged = true
  661. elseif FullyCharged then
  662. if EnchantmentCircle and EnchantmentCircle.Parent then
  663. local Weld = EnchantmentCircle:FindFirstChild("CircleMotor")
  664. if not Weld or not Weld.Part0 or not Weld.Part1 then
  665. if Weld and Weld.Parent then
  666. Weld:Destroy()
  667. end
  668. Weld = Instance.new("Motor6D")
  669. Weld.Name = "CircleMotor"
  670. Weld.Part0 = EnchantmentCircle
  671. Weld.Part1 = Torso
  672. Weld.C0 = CFrame.new(0, ((Torso.Size.Y * 1.5)), 0) * CFrame.Angles((math.pi / 2), 0, 0)
  673. Weld.C1 = CFrame.new() * CFrame.Angles((math.pi / 2), 0, 0)
  674. Weld.DesiredAngle = 999999
  675. Weld.MaxVelocity = 0.02
  676. Weld.Parent = EnchantmentCircle
  677. end
  678. end
  679. if not CreatedCircle then
  680. CreatedCircle = true
  681. EnchantmentCircle.Parent = Tool
  682. EnchantmentCircle.CFrame = Torso.CFrame
  683. end
  684. if (tick() - DiamondTick) >= 0.5 then
  685. DiamondTick = tick()
  686. for i = 1, math.random(1, 1) do
  687. local Diamond = BaseDiamond:Clone()
  688. local DiamondSize = (math.random(500, 1500) * 0.001)
  689. local DiamondHeight = (math.random(3000, 5000) * 0.001)
  690. Diamond.Size = Vector3.new(DiamondSize, DiamondHeight, DiamondSize)
  691. Diamond.Mesh.Scale = (BaseDiamond.Size * Diamond.Size)
  692. Diamond.CFrame = Torso.CFrame + (Torso.CFrame * CFrame.Angles(0, math.random(-360, 360), 0)).lookVector * ((DiamondRadius / 2) - (math.random(0, (DiamondOffset * 1000)) * 0.001))
  693. local Mass = (Diamond:GetMass() * Gravity)
  694. local BodyGyro = Instance.new("BodyGyro")
  695. BodyGyro.maxTorque = Vector3.new(0, 0, 0)
  696. BodyGyro.cframe = Diamond.CFrame
  697. BodyGyro.Parent = Diamond
  698. local BodyVelocity = Instance.new("BodyVelocity")
  699. BodyVelocity.maxForce = Vector3.new(0, Mass, 0)
  700. BodyVelocity.velocity = (Vector3.new(0, 1, 0) * DiamondVelocity)
  701. BodyVelocity.Parent = Diamond
  702. Diamond.Velocity = (Vector3.new(0, 1, 0) * DiamondVelocity)
  703. local Touched = false
  704. Diamond.Touched:connect(function(Hit)
  705. if not Hit or not Hit.Parent or Touched then
  706. return
  707. end
  708. local character = Hit.Parent
  709. if character:IsA("Hat") then
  710. character = character.Parent
  711. end
  712. if character == Character then
  713. return
  714. end
  715. local player = Players:GetPlayerFromCharacter(character)
  716. if player and IsTeamMate(Player, player) then
  717. return
  718. end
  719. local humanoid = character:FindFirstChild("Humanoid")
  720. if not humanoid or humanoid.Health == 0 then
  721. return
  722. end
  723. UntagHumanoid(humanoid)
  724. TagHumanoid(humanoid, Player)
  725. humanoid:TakeDamage(999999999)
  726. Touched = true
  727. end)
  728. Debris:AddItem(Diamond, 2)
  729. Diamond.Parent = game:GetService("Workspace")
  730. end
  731. end
  732. end
  733. wait(Rate)
  734. end
  735. if (tick() - ChargeTick) >= MaxChargeTime then
  736. FullyCharged = false
  737. Spawn(function()
  738. InvokeClient("StopAnimation", Animations.Charge)
  739. end)
  740. SpecialActive = true
  741. Delay((SpecialReloadTime / 2), (function()
  742. SpecialActive = false
  743. end))
  744. end
  745. if EnchantmentCircle and EnchantmentCircle.Parent then
  746. EnchantmentCircle:Destroy()
  747. end
  748. end
  749. end)
  750. else
  751. AttackSounds = {Sounds.Slash}
  752. AttackAnims = {Animations.Swing1, Animations.Swing2}
  753. end
  754. Attack(AttackAnims, AttackSounds)
  755. FirstClick = false
  756. Clicks = 0
  757. Attacking = false
  758. Tool.Enabled = true
  759. end
  760. end
  761.  
  762. function CheckIfAlive()
  763. 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)
  764. end
  765.  
  766. function Equipped()
  767. Character = Tool.Parent
  768. Player = Players:GetPlayerFromCharacter(Character)
  769. Humanoid = Character:FindFirstChild("Humanoid")
  770. Torso = Character:FindFirstChild("Torso")
  771. if not CheckIfAlive() then
  772. return
  773. end
  774. local CurrentlyEquipped = true
  775. EquippedToolUnequipped = Tool.Unequipped:connect(function()
  776. CurrentlyEquipped = false
  777. end)
  778. if EquippedToolUnequipped then
  779. EquippedToolUnequipped:disconnect()
  780. end
  781. if not CurrentlyEquipped then
  782. return
  783. end
  784. MouseDown = false
  785. ToolEquipped = true
  786. end
  787.  
  788. function Unequipped()
  789. Clicks = 0
  790. FirstClick = false
  791. FullyCharged = false
  792. Attacking = false
  793. MouseDown = false
  794. SpecialActive = false
  795. if EnchantmentCircle and EnchantmentCircle.Parent then
  796. EnchantmentCircle:Destroy()
  797. end
  798. for i, v in pairs({EquippedToolUnequipped, ToolUnequipped}) do
  799. if v then
  800. v:disconnect()
  801. end
  802. end
  803. Spawn(function()
  804. for i, v in pairs(Animations) do
  805. InvokeClient("StopAnimation", v)
  806. end
  807. end)
  808. ToolEquipped = false
  809. end
  810.  
  811. function InvokeClient(Mode, Value)
  812. local ClientReturn = nil
  813. pcall(function()
  814. ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
  815. end)
  816. return ClientReturn
  817. end
  818.  
  819. ServerControl.OnServerInvoke = (function(player, Mode, Value)
  820. if player == Player and ToolEquipped and CheckIfAlive() then
  821. if Mode == "MouseClick" then
  822. local Down = Value.Down
  823. if Down and not MouseDown then
  824. MouseDown = true
  825. Activated()
  826. elseif not Down and MouseDown then
  827. MouseDown = false
  828. InvokeClient("StopAnimation", Animations.Charge)
  829. if FullyCharged and not SpecialActive then
  830. if CurrentAnimation == Animations.Charge and FullyCharged then
  831. SpecialActive = true
  832. FullyCharged = false
  833. local AttackAnims = {Animations.JumpAttack}
  834. local AttackSounds = {Sounds.Explosion}
  835. Attack(AttackAnims, AttackSounds)
  836. local BigDiamond = BaseDiamond:Clone()
  837. BigDiamond.Anchored = true
  838. BigDiamond.Size = Vector3.new(10, 10, 10)
  839. BigDiamond.Mesh.Scale = (BaseDiamond.Size * BigDiamond.Size)
  840. BigDiamond.CFrame = Torso.CFrame + Torso.CFrame.lookVector * ((Torso.Size.Z / 2) + BigDiamond.Size.Z)
  841. local ExplosionSound = Sounds.Explosion:Clone()
  842. ExplosionSound.Parent = BigDiamond
  843. Debris:AddItem(BigDiamond, 5)
  844. BigDiamond.Parent = game:GetService("Workspace")
  845. Delay(1, function()
  846. ExplosionSound:Play()
  847. BigDiamond.Transparency = 1
  848. Delay(1, function()
  849. if BigDiamond and BigDiamond.Parent then
  850. BigDiamond:Destroy()
  851. end
  852. end)
  853. local DiamondCFrame = BigDiamond.CFrame
  854. local DiamondVelocity = 200
  855. for i = 1, math.random(75, 100) do
  856. local Diamond = BaseDiamond:Clone()
  857. local DiamondSize = (math.random(3000, 5000) * 0.001)
  858. local DiamondHeight = (math.random(3000, 5000) * 0.001)
  859. Diamond.Size = Vector3.new(DiamondSize, DiamondHeight, DiamondSize)
  860. Diamond.Mesh.Scale = (BaseDiamond.Size * Diamond.Size)
  861. Diamond.CFrame = DiamondCFrame * CFrame.Angles((math.random(-3600, 3600) * 0.001), (math.random(-3600, 3600) * 0.001), (math.random(-3600, 3600) * 0.001))
  862. local Direction = (Diamond.CFrame * CFrame.Angles((math.pi / 2), 0, 0)).lookVector
  863. local BodyGyro = Instance.new("BodyGyro")
  864. BodyGyro.maxTorque = Vector3.new(0, 0, 0)
  865. BodyGyro.cframe = Diamond.CFrame
  866. BodyGyro.Parent = Diamond
  867. local Mass = (Diamond:GetMass() * Gravity)
  868. local BodyVelocity = Instance.new("BodyVelocity")
  869. BodyVelocity.maxForce = Vector3.new(0, Mass, 0)
  870. BodyVelocity.velocity = (Direction * DiamondVelocity)
  871. BodyVelocity.Parent = Diamond
  872. Diamond.Velocity = (Direction * DiamondVelocity)
  873. Diamond.Touched:connect(function(Hit)
  874. if not Hit or not Hit.Parent then
  875. return
  876. end
  877. local character = Hit.Parent
  878. if character:IsA("Hat") then
  879. character = character.Parent
  880. end
  881. if character == Character then
  882. return
  883. end
  884. local player = Players:GetPlayerFromCharacter(character)
  885. if player and IsTeamMate(Player, player) then
  886. return
  887. end
  888. local humanoid = character:FindFirstChild("Humanoid")
  889. if not humanoid or humanoid.Health == 0 then
  890. return
  891. end
  892. UntagHumanoid(humanoid)
  893. TagHumanoid(humanoid, Player)
  894. humanoid:TakeDamage(999999999)
  895. end)
  896. Debris:AddItem(Diamond, 0.75)
  897. Diamond.Parent = game:GetService("Workspace")
  898. end
  899. end)
  900. wait(SpecialReloadTime)
  901. SpecialActive = false
  902. end
  903. end
  904. end
  905. end
  906. end
  907. end)
  908.  
  909. Handle.Touched:connect(Blow)
  910.  
  911. Tool.Equipped:connect(Equipped)
  912. Tool.Unequipped:connect(Unequipped)
  913. end))
  914. for i,v in pairs(mas:GetChildren()) do
  915. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  916. pcall(function() v:MakeJoints() end)
  917. end
  918. mas:Destroy()
  919. for i,v in pairs(cors) do
  920. spawn(function()
  921. pcall(v)
  922. end)
  923. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement