Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Sparkles3 = Instance.new("Sparkles")
- Sound4 = Instance.new("Sound")
- PointLight5 = Instance.new("PointLight")
- Sound6 = Instance.new("Sound")
- Animation7 = Instance.new("Animation")
- Animation8 = Instance.new("Animation")
- LocalScript9 = Instance.new("LocalScript")
- LocalScript10 = Instance.new("LocalScript")
- Animation11 = Instance.new("Animation")
- Animation12 = Instance.new("Animation")
- Script13 = Instance.new("Script")
- Tool0.Name = "SparkletimeClaymore"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=218498377"
- Tool0.GripForward = Vector3.new(-0, -1, -8.10005167e-06)
- Tool0.GripPos = Vector3.new(0, 0, 3)
- Tool0.GripUp = Vector3.new(0, 8.10005167e-06, -1)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.Rotation = Vector3.new(45, 0, 0)
- Part1.Locked = true
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.Size = Vector3.new(0.200000003, 0.5, 7)
- Part1.CFrame = CFrame.new(-28, 2.65165901, 152, 1, 0, 0, 0, 0.707106709, -0.707106709, 0, 0.707106709, 0.707106709)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = Vector3.new(-28, 2.65165901, 152)
- Part1.Orientation = Vector3.new(45, 0, 0)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=218498178"
- SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=218498286"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
- Sparkles3.Parent = Part1
- Sparkles3.Color = Color3.new(1.77083, 0, 0)
- Sparkles3.SparkleColor = Color3.new(1, 0, 0)
- Sparkles3.Color = Color3.new(1.77083, 0, 0)
- Sound4.Name = "Slash"
- Sound4.Parent = Part1
- Sound4.SoundId = "rbxasset://sounds/swordslash.wav"
- Sound4.Volume = 0.69999998807907
- PointLight5.Parent = Part1
- PointLight5.Color = Color3.new(1, 0, 0)
- PointLight5.Brightness = 25
- PointLight5.Range = 5
- PointLight5.Color = Color3.new(1, 0, 0)
- Sound6.Name = "Explosion"
- Sound6.Parent = Part1
- Sound6.SoundId = "rbxasset://sounds//Rocket shot.wav"
- Sound6.Volume = 1
- Animation7.Name = "Swing1"
- Animation7.Parent = Tool0
- Animation7.AnimationId = "http://www.roblox.com/asset/?id=220502245"
- Animation8.Name = "Swing2"
- Animation8.Parent = Tool0
- Animation8.AnimationId = "http://www.roblox.com/asset/?id=220504509"
- LocalScript9.Parent = Tool0
- table.insert(cors,sandbox(LocalScript9,function()
- --Made by Luckymaxer
- Tool = script.Parent
- Handle = Tool:WaitForChild("Handle")
- Players = game:GetService("Players")
- RunService = game:GetService("RunService")
- Camera = game:GetService("Workspace").CurrentCamera
- Animations = {}
- LocalObjects = {}
- ServerControl = Tool:WaitForChild("ServerControl")
- ClientControl = Tool:WaitForChild("ClientControl")
- ToolEquipped = false
- function SetAnimation(mode, value)
- if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
- for i, v in pairs(Animations) do
- if v.Animation == value.Animation then
- v.AnimationTrack:Stop()
- table.remove(Animations, i)
- end
- end
- local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
- table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
- AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
- elseif mode == "StopAnimation" and value then
- for i, v in pairs(Animations) do
- if v.Animation == value.Animation then
- v.AnimationTrack:Stop()
- table.remove(Animations, i)
- end
- end
- end
- end
- function DisableJump(Boolean)
- if PreventJump then
- PreventJump:disconnect()
- end
- if Boolean then
- PreventJump = Humanoid.Changed:connect(function(Property)
- if Property == "Jump" then
- Humanoid.Jump = false
- end
- end)
- end
- end
- function CheckIfAlive()
- return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
- end
- function Equipped(Mouse)
- Character = Tool.Parent
- Player = Players:GetPlayerFromCharacter(Character)
- Humanoid = Character:FindFirstChild("Humanoid")
- ToolEquipped = true
- if not CheckIfAlive() then
- return
- end
- PlayerMouse = Player:GetMouse()
- Mouse.Button1Down:connect(function()
- InvokeServer("MouseClick", {Down = true})
- end)
- Mouse.Button1Up:connect(function()
- InvokeServer("MouseClick", {Down = false})
- end)
- Mouse.KeyDown:connect(function(Key)
- InvokeServer("KeyPress", {Key = Key, Down = true})
- end)
- Mouse.KeyUp:connect(function(Key)
- InvokeServer("KeyPress", {Key = Key, Down = false})
- end)
- Mouse.Move:connect(function()
- InvokeServer("MouseMove", {Position = Mouse.Hit.p, Target = Mouse.Target})
- end)
- end
- function Unequipped()
- ToolEquipped = false
- LocalObjects = {}
- for i, v in pairs(Animations) do
- if v and v.AnimationTrack then
- v.AnimationTrack:Stop()
- end
- end
- for i, v in pairs({PreventJump, ObjectLocalTransparencyModifier}) do
- if v then
- v:disconnect()
- end
- end
- Animations = {}
- end
- function InvokeServer(mode, value)
- local ServerReturn
- pcall(function()
- ServerReturn = ServerControl:InvokeServer(mode, value)
- end)
- return ServerReturn
- end
- function OnClientInvoke(mode, value)
- if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
- SetAnimation("PlayAnimation", value)
- elseif mode == "StopAnimation" and value then
- SetAnimation("StopAnimation", value)
- elseif mode == "PlaySound" and value then
- value:Play()
- elseif mode == "StopSound" and value then
- value:Stop()
- elseif mode == "MousePosition" then
- return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
- elseif mode == "DisableJump" then
- DisableJump(value)
- elseif mode == "SetLocalTransparencyModifier" and value and ToolEquipped then
- pcall(function()
- local ObjectFound = false
- for i, v in pairs(LocalObjects) do
- if v == value then
- ObjectFound = true
- end
- end
- if not ObjectFound then
- table.insert(LocalObjects, value)
- if ObjectLocalTransparencyModifier then
- ObjectLocalTransparencyModifier:disconnect()
- end
- ObjectLocalTransparencyModifier = RunService.RenderStepped:connect(function()
- for i, v in pairs(LocalObjects) do
- if v.Object and v.Object.Parent then
- local CurrentTransparency = v.Object.LocalTransparencyModifier
- if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
- v.Object.LocalTransparencyModifier = v.Transparency
- end
- else
- table.remove(LocalObjects, i)
- end
- end
- end)
- end
- end)
- end
- end
- ClientControl.OnClientInvoke = OnClientInvoke
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
- end))
- LocalScript10.Name = "MouseIcon"
- LocalScript10.Parent = Tool0
- table.insert(cors,sandbox(LocalScript10,function()
- --Made by Luckymaxer
- Mouse_Icon = "rbxasset://textures/GunCursor.png"
- Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
- Tool = script.Parent
- Mouse = nil
- function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
- end
- end
- function OnEquipped(ToolMouse)
- Mouse = ToolMouse
- UpdateIcon()
- end
- function OnChanged(Property)
- if Property == "Enabled" then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- end))
- Animation11.Name = "Charge"
- Animation11.Parent = Tool0
- Animation11.AnimationId = "http://www.roblox.com/asset/?id=220540334"
- Animation12.Name = "JumpAttack"
- Animation12.Parent = Tool0
- Animation12.AnimationId = "http://www.roblox.com/asset/?id=220512718"
- Script13.Parent = Tool0
- table.insert(cors,sandbox(Script13,function()
- --Made by Luckymaxer
- Tool = script.Parent
- Handle = Tool:WaitForChild("Handle")
- Players = game:GetService("Players")
- Debris = game:GetService("Debris")
- BaseUrl = "http://www.roblox.com/asset/?id="
- BasePart = Instance.new("Part")
- BasePart.Shape = Enum.PartType.Block
- BasePart.Material = Enum.Material.Plastic
- BasePart.TopSurface = Enum.SurfaceType.Smooth
- BasePart.BottomSurface = Enum.SurfaceType.Smooth
- BasePart.FormFactor = Enum.FormFactor.Custom
- BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
- BasePart.CanCollide = true
- BasePart.Locked = true
- BasePart.Anchored = false
- BaseDiamond = BasePart:Clone()
- BaseDiamond.Name = "Diamond"
- BaseDiamond.BrickColor = BrickColor.new("Really red")
- BaseDiamond.Reflectance = 0.5
- BaseDiamond.Size = Vector3.new(1.35, 1.35, 1.35)
- BaseDiamond.CanCollide = false
- DiamondMesh = Instance.new("SpecialMesh")
- DiamondMesh.MeshType = Enum.MeshType.FileMesh
- DiamondMesh.MeshId = (BaseUrl .. "9756362")
- DiamondMesh.TextureId = ""
- DiamondMesh.Scale = Vector3.new(1, 1, 1)
- DiamondMesh.VertexColor = Vector3.new(1, 1, 1)
- DiamondMesh.Offset = Vector3.new(0, 0, 0)
- DiamondMesh.Parent = BaseDiamond
- EnchantingCircle = BasePart:Clone()
- EnchantingCircle.Name = "EnchantingCircle"
- EnchantingCircle.Transparency = 1
- EnchantingCircle.Size = Vector3.new(1, 1, 1)
- EnchantingCircle.CanCollide = false
- EnchantingDecal = Instance.new("Decal")
- EnchantingDecal.Texture = (BaseUrl .. "212259445")
- CircleMesh = Instance.new("BlockMesh")
- CircleMesh.Parent= EnchantingCircle
- TopDecal = EnchantingDecal:Clone()
- TopDecal.Face = Enum.NormalId.Top
- TopDecal.Parent = EnchantingCircle
- BottomDecal = EnchantingDecal:Clone()
- BottomDecal.Face = Enum.NormalId.Bottom
- BottomDecal.Parent = EnchantingCircle
- Animations = {
- Swing1 = {Animation = Tool:WaitForChild("Swing1"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5, Damage = {Min = 15, Max = 25}},
- Swing2 = {Animation = Tool:WaitForChild("Swing2"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5, Damage = {Min = 20, Max = 35}},
- JumpAttack = {Animation = Tool:WaitForChild("JumpAttack"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.5, Damage = {Min = 20, Max = 25}},
- Charge = {Animation = Tool:WaitForChild("Charge"), FadeTime = nil, Weight = nil, Speed = 0.25, Duration = nil},
- }
- Sounds = {
- Slash = Handle:WaitForChild("Slash"),
- Explosion = Handle:WaitForChild("Explosion"),
- }
- TouchDamage = {Min = 999999999, Max = 999999999}
- ToolEquipped = false
- Attacking = false
- MouseDown = false
- FullyCharged = false
- SpecialActive = false
- SpecialReloadTime = 0.001
- Clicks = 0
- FirstClick = false
- Gravity = 196.20
- Rate = (1 / 60)
- ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
- ServerControl.Name = "ServerControl"
- ServerControl.Parent = Tool
- ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
- ClientControl.Name = "ClientControl"
- ClientControl.Parent = Tool
- for i, v in pairs(Tool:GetChildren()) do
- if v:IsA("BasePart") and v ~= Handle then
- v:Destroy()
- end
- end
- Tool.Enabled = true
- function RayCast(Position, Direction, MaxDistance, IgnoreList)
- local IgnoreList = ((type(IgnoreList) == "table" and IgnoreList) or {IgnoreList})
- return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position, Direction.unit * (MaxDistance or 999.999)), IgnoreList)
- end
- function IsTeamMate(Player1, Player2)
- return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
- end
- function TagHumanoid(humanoid, player)
- local Creator_Tag = Instance.new("ObjectValue")
- Creator_Tag.Name = "creator"
- Creator_Tag.Value = player
- Debris:AddItem(Creator_Tag, 2)
- Creator_Tag.Parent = humanoid
- end
- function UntagHumanoid(humanoid)
- for i, v in pairs(humanoid:GetChildren()) do
- if v:IsA("ObjectValue") and v.Name == "creator" then
- v:Destroy()
- end
- end
- end
- function CheckTableForInstance(Table, Instance)
- for i, v in pairs(Table) do
- if v == Instance then
- return true
- end
- end
- return false
- end
- function Blow(Hit)
- if not Hit or not Hit.Parent or not CheckIfAlive() then
- return
- end
- local character = Hit.Parent
- local player = Players:GetPlayerFromCharacter(character)
- if player and IsTeamMate(Player, player) then
- return
- end
- local humanoid = character:FindFirstChild("Humanoid")
- if character == Character or not humanoid or humanoid.Health == 0 then
- return
- end
- local RightArm = Character:FindFirstChild("Right Arm")
- if not RightArm then
- return
- end
- local RightGrip = RightArm:FindFirstChild("RightGrip")
- if not RightGrip or (RightGrip.Part0 ~= RightArm and RightGrip.Part1 ~= RightArm) then
- return
- end
- UntagHumanoid(humanoid)
- TagHumanoid(humanoid, Player)
- local DamageValue = ((CurrentAnimation and CurrentAnimation.Damage) or TouchDamage)
- local DamageAmount = math.random(DamageValue.Min, DamageValue.Max)
- humanoid:TakeDamage(DamageAmount)
- end
- function Attack(PossibleAnims, PossibleSounds)
- if PossibleAnims and #PossibleAnims > 0 then
- if PossibleSounds and #PossibleSounds > 0 then
- PossibleSounds[math.random(1, #PossibleSounds)]:Play()
- end
- CurrentAnimation = PossibleAnims[math.random(1, #PossibleAnims)]
- InvokeClient("PlayAnimation", CurrentAnimation)
- if CurrentAnimation.Duration and CurrentAnimation.Duration > 0 then
- wait(CurrentAnimation.Duration)
- CurrentAnimation = nil
- end
- end
- end
- function MotionEffect()
- local TransparencyRate = 100
- local OriginalTransparency = 0.75
- while ToolEquipped and Attacking do
- local FakeHandle = Handle:Clone()
- for i, v in pairs(FakeHandle:GetChildren()) do
- if not v:IsA("DataModelMesh") then
- v:Destroy()
- end
- end
- FakeHandle.Name = "FakeHandle"
- FakeHandle.Anchored = true
- FakeHandle.CanCollide = false
- FakeHandle.Locked = true
- FakeHandle.Transparency = OriginalTransparency
- Spawn(function()
- for i = 1, (FakeHandle.Transparency * TransparencyRate) do
- FakeHandle.Transparency = FakeHandle.Transparency + (OriginalTransparency / TransparencyRate)
- wait(Rate)
- end
- if FakeHandle and FakeHandle.Parent then
- FakeHandle:Destroy()
- end
- end)
- Debris:AddItem(FakeHandle, 5)
- FakeHandle.Parent = Tool
- wait(Rate)
- end
- end
- function Activated()
- if not Tool.Enabled or not ToolEquipped then
- return
- end
- Attacking = true
- Clicks = (Clicks + 1)
- if not FirstClick then
- FirstClick = true
- local CurrentlyEquipped = true
- ToolUnequipped = Tool.Unequipped:connect(function()
- CurrentlyEquipped = false
- end)
- wait(0.15)
- if ToolUnequipped then
- ToolUnequipped:disconnect()
- end
- if not CurrentlyEquipped then
- return
- end
- Tool.Enabled = false
- Attacking = true
- Spawn(MotionEffect)
- local AttackAnims = {}
- local AttackSounds = {}
- if MouseDown and Clicks == 1 and not SpecialActive then
- AttackAnims = {Animations.Charge}
- Spawn(function()
- if not SpecialActive then
- local MaxChargeTime = 15
- local FullyChargedTime = 0.001
- local ChargeTick = tick()
- local DiamondTick = tick()
- local DiamondRadius = 12
- local DiamondOffset = 6
- local DiamondVelocity = 50
- local CreatedCircle = false
- EnchantmentCircle = EnchantingCircle:Clone()
- EnchantmentCircle.Mesh.Scale = Vector3.new(DiamondRadius, 0.2, DiamondRadius)
- while MouseDown and ToolEquipped and CheckIfAlive() and (tick() - ChargeTick) < MaxChargeTime do
- if not FullyCharged and (tick() - ChargeTick) >= FullyChargedTime then
- FullyCharged = true
- elseif FullyCharged then
- if EnchantmentCircle and EnchantmentCircle.Parent then
- local Weld = EnchantmentCircle:FindFirstChild("CircleMotor")
- if not Weld or not Weld.Part0 or not Weld.Part1 then
- if Weld and Weld.Parent then
- Weld:Destroy()
- end
- Weld = Instance.new("Motor6D")
- Weld.Name = "CircleMotor"
- Weld.Part0 = EnchantmentCircle
- Weld.Part1 = Torso
- Weld.C0 = CFrame.new(0, ((Torso.Size.Y * 1.5)), 0) * CFrame.Angles((math.pi / 2), 0, 0)
- Weld.C1 = CFrame.new() * CFrame.Angles((math.pi / 2), 0, 0)
- Weld.DesiredAngle = 999999
- Weld.MaxVelocity = 0.02
- Weld.Parent = EnchantmentCircle
- end
- end
- if not CreatedCircle then
- CreatedCircle = true
- EnchantmentCircle.Parent = Tool
- EnchantmentCircle.CFrame = Torso.CFrame
- end
- if (tick() - DiamondTick) >= 0.5 then
- DiamondTick = tick()
- for i = 1, math.random(1, 1) do
- local Diamond = BaseDiamond:Clone()
- local DiamondSize = (math.random(500, 1500) * 0.001)
- local DiamondHeight = (math.random(3000, 5000) * 0.001)
- Diamond.Size = Vector3.new(DiamondSize, DiamondHeight, DiamondSize)
- Diamond.Mesh.Scale = (BaseDiamond.Size * Diamond.Size)
- Diamond.CFrame = Torso.CFrame + (Torso.CFrame * CFrame.Angles(0, math.random(-360, 360), 0)).lookVector * ((DiamondRadius / 2) - (math.random(0, (DiamondOffset * 1000)) * 0.001))
- local Mass = (Diamond:GetMass() * Gravity)
- local BodyGyro = Instance.new("BodyGyro")
- BodyGyro.maxTorque = Vector3.new(0, 0, 0)
- BodyGyro.cframe = Diamond.CFrame
- BodyGyro.Parent = Diamond
- local BodyVelocity = Instance.new("BodyVelocity")
- BodyVelocity.maxForce = Vector3.new(0, Mass, 0)
- BodyVelocity.velocity = (Vector3.new(0, 1, 0) * DiamondVelocity)
- BodyVelocity.Parent = Diamond
- Diamond.Velocity = (Vector3.new(0, 1, 0) * DiamondVelocity)
- local Touched = false
- Diamond.Touched:connect(function(Hit)
- if not Hit or not Hit.Parent or Touched then
- return
- end
- local character = Hit.Parent
- if character:IsA("Hat") then
- character = character.Parent
- end
- if character == Character then
- return
- end
- local player = Players:GetPlayerFromCharacter(character)
- if player and IsTeamMate(Player, player) then
- return
- end
- local humanoid = character:FindFirstChild("Humanoid")
- if not humanoid or humanoid.Health == 0 then
- return
- end
- UntagHumanoid(humanoid)
- TagHumanoid(humanoid, Player)
- humanoid:TakeDamage(999999999)
- Touched = true
- end)
- Debris:AddItem(Diamond, 2)
- Diamond.Parent = game:GetService("Workspace")
- end
- end
- end
- wait(Rate)
- end
- if (tick() - ChargeTick) >= MaxChargeTime then
- FullyCharged = false
- Spawn(function()
- InvokeClient("StopAnimation", Animations.Charge)
- end)
- SpecialActive = true
- Delay((SpecialReloadTime / 2), (function()
- SpecialActive = false
- end))
- end
- if EnchantmentCircle and EnchantmentCircle.Parent then
- EnchantmentCircle:Destroy()
- end
- end
- end)
- else
- AttackSounds = {Sounds.Slash}
- AttackAnims = {Animations.Swing1, Animations.Swing2}
- end
- Attack(AttackAnims, AttackSounds)
- FirstClick = false
- Clicks = 0
- Attacking = false
- Tool.Enabled = true
- end
- end
- function CheckIfAlive()
- 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)
- end
- function Equipped()
- Character = Tool.Parent
- Player = Players:GetPlayerFromCharacter(Character)
- Humanoid = Character:FindFirstChild("Humanoid")
- Torso = Character:FindFirstChild("Torso")
- if not CheckIfAlive() then
- return
- end
- local CurrentlyEquipped = true
- EquippedToolUnequipped = Tool.Unequipped:connect(function()
- CurrentlyEquipped = false
- end)
- if EquippedToolUnequipped then
- EquippedToolUnequipped:disconnect()
- end
- if not CurrentlyEquipped then
- return
- end
- MouseDown = false
- ToolEquipped = true
- end
- function Unequipped()
- Clicks = 0
- FirstClick = false
- FullyCharged = false
- Attacking = false
- MouseDown = false
- SpecialActive = false
- if EnchantmentCircle and EnchantmentCircle.Parent then
- EnchantmentCircle:Destroy()
- end
- for i, v in pairs({EquippedToolUnequipped, ToolUnequipped}) do
- if v then
- v:disconnect()
- end
- end
- Spawn(function()
- for i, v in pairs(Animations) do
- InvokeClient("StopAnimation", v)
- end
- end)
- ToolEquipped = false
- end
- function InvokeClient(Mode, Value)
- local ClientReturn = nil
- pcall(function()
- ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
- end)
- return ClientReturn
- end
- ServerControl.OnServerInvoke = (function(player, Mode, Value)
- if player == Player and ToolEquipped and CheckIfAlive() then
- if Mode == "MouseClick" then
- local Down = Value.Down
- if Down and not MouseDown then
- MouseDown = true
- Activated()
- elseif not Down and MouseDown then
- MouseDown = false
- InvokeClient("StopAnimation", Animations.Charge)
- if FullyCharged and not SpecialActive then
- if CurrentAnimation == Animations.Charge and FullyCharged then
- SpecialActive = true
- FullyCharged = false
- local AttackAnims = {Animations.JumpAttack}
- local AttackSounds = {Sounds.Explosion}
- Attack(AttackAnims, AttackSounds)
- local BigDiamond = BaseDiamond:Clone()
- BigDiamond.Anchored = true
- BigDiamond.Size = Vector3.new(10, 10, 10)
- BigDiamond.Mesh.Scale = (BaseDiamond.Size * BigDiamond.Size)
- BigDiamond.CFrame = Torso.CFrame + Torso.CFrame.lookVector * ((Torso.Size.Z / 2) + BigDiamond.Size.Z)
- local ExplosionSound = Sounds.Explosion:Clone()
- ExplosionSound.Parent = BigDiamond
- Debris:AddItem(BigDiamond, 5)
- BigDiamond.Parent = game:GetService("Workspace")
- Delay(1, function()
- ExplosionSound:Play()
- BigDiamond.Transparency = 1
- Delay(1, function()
- if BigDiamond and BigDiamond.Parent then
- BigDiamond:Destroy()
- end
- end)
- local DiamondCFrame = BigDiamond.CFrame
- local DiamondVelocity = 200
- for i = 1, math.random(75, 100) do
- local Diamond = BaseDiamond:Clone()
- local DiamondSize = (math.random(3000, 5000) * 0.001)
- local DiamondHeight = (math.random(3000, 5000) * 0.001)
- Diamond.Size = Vector3.new(DiamondSize, DiamondHeight, DiamondSize)
- Diamond.Mesh.Scale = (BaseDiamond.Size * Diamond.Size)
- Diamond.CFrame = DiamondCFrame * CFrame.Angles((math.random(-3600, 3600) * 0.001), (math.random(-3600, 3600) * 0.001), (math.random(-3600, 3600) * 0.001))
- local Direction = (Diamond.CFrame * CFrame.Angles((math.pi / 2), 0, 0)).lookVector
- local BodyGyro = Instance.new("BodyGyro")
- BodyGyro.maxTorque = Vector3.new(0, 0, 0)
- BodyGyro.cframe = Diamond.CFrame
- BodyGyro.Parent = Diamond
- local Mass = (Diamond:GetMass() * Gravity)
- local BodyVelocity = Instance.new("BodyVelocity")
- BodyVelocity.maxForce = Vector3.new(0, Mass, 0)
- BodyVelocity.velocity = (Direction * DiamondVelocity)
- BodyVelocity.Parent = Diamond
- Diamond.Velocity = (Direction * DiamondVelocity)
- Diamond.Touched:connect(function(Hit)
- if not Hit or not Hit.Parent then
- return
- end
- local character = Hit.Parent
- if character:IsA("Hat") then
- character = character.Parent
- end
- if character == Character then
- return
- end
- local player = Players:GetPlayerFromCharacter(character)
- if player and IsTeamMate(Player, player) then
- return
- end
- local humanoid = character:FindFirstChild("Humanoid")
- if not humanoid or humanoid.Health == 0 then
- return
- end
- UntagHumanoid(humanoid)
- TagHumanoid(humanoid, Player)
- humanoid:TakeDamage(999999999)
- end)
- Debris:AddItem(Diamond, 0.75)
- Diamond.Parent = game:GetService("Workspace")
- end
- end)
- wait(SpecialReloadTime)
- SpecialActive = false
- end
- end
- end
- end
- end
- end)
- Handle.Touched:connect(Blow)
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement