Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Dis sword can counter from goku spammers ENJOY!
- 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")
- BoolValue1 = Instance.new("BoolValue")
- BoolValue2 = Instance.new("BoolValue")
- BoolValue3 = Instance.new("BoolValue")
- Part4 = Instance.new("Part")
- SpecialMesh5 = Instance.new("SpecialMesh")
- Sound6 = Instance.new("Sound")
- Sound7 = Instance.new("Sound")
- Sound8 = Instance.new("Sound")
- Sound9 = Instance.new("Sound")
- Sound10 = Instance.new("Sound")
- Sound11 = Instance.new("Sound")
- Script12 = Instance.new("Script")
- Script13 = Instance.new("Script")
- LocalScript14 = Instance.new("LocalScript")
- LocalScript15 = Instance.new("LocalScript")
- Script16 = Instance.new("Script")
- Animation17 = Instance.new("Animation")
- Animation18 = Instance.new("Animation")
- Animation19 = Instance.new("Animation")
- Animation20 = Instance.new("Animation")
- Animation21 = Instance.new("Animation")
- Animation22 = Instance.new("Animation")
- Tool0.Name = "Sword"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=120894242"
- Tool0.GripPos = Vector3.new(0, -2.79999995, 0)
- Tool0.ToolTip = "Mixamo"
- BoolValue1.Name = "PlayOverhead"
- BoolValue1.Parent = Tool0
- BoolValue1.Value = true
- BoolValue2.Name = "PlaySlash"
- BoolValue2.Parent = Tool0
- BoolValue2.Value = true
- BoolValue3.Name = "PlayThrust"
- BoolValue3.Parent = Tool0
- Part4.Name = "Handle"
- Part4.Parent = Tool0
- Part4.BrickColor = BrickColor.new("Really black")
- Part4.Reflectance = 1
- Part4.Rotation = Vector3.new(-115.290001, 58.3499985, 104.279999)
- Part4.FormFactor = Enum.FormFactor.Custom
- Part4.Size = Vector3.new(1, 5.99999857, 1)
- Part4.CFrame = CFrame.new(15.5499144, 20.4776459, 29.7129097, -0.129414797, -0.508500516, 0.851280689, -0.224160001, 0.85127914, 0.474421859, -0.965921283, -0.129425809, -0.224153638)
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part4.Position = Vector3.new(15.5499144, 20.4776459, 29.7129097)
- Part4.Orientation = Vector3.new(-28.3199997, 104.75, -14.75)
- Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- SpecialMesh5.Parent = Part4
- SpecialMesh5.MeshId = "rbxassetid://497301002"
- SpecialMesh5.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- SpecialMesh5.TextureId = "rbxassetid://497301004"
- SpecialMesh5.MeshType = Enum.MeshType.FileMesh
- SpecialMesh5.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- Sound6.Name = "HitSound"
- Sound6.Parent = Part4
- Sound6.Pitch = 0.80000001192093
- Sound6.SoundId = "http://www.roblox.com/Asset?ID=96667969"
- Sound6.Volume = 0.75
- Sound7.Name = "LungeSound"
- Sound7.Parent = Part4
- Sound7.Pitch = 0.80000001192093
- Sound7.SoundId = "rbxasset://sounds//swordlunge.wav"
- Sound7.Volume = 0.25
- Sound8.Name = "OverheadSound"
- Sound8.Parent = Part4
- Sound8.Pitch = 0.94999998807907
- Sound8.SoundId = "rbxasset://sounds//swordslash.wav"
- Sound9.Name = "SlashSound"
- Sound9.Parent = Part4
- Sound9.Pitch = 0.80000001192093
- Sound9.SoundId = "rbxasset://sounds//swordslash.wav"
- Sound9.Volume = 0.34999999403954
- Sound10.Name = "UnsheathSound"
- Sound10.Parent = Part4
- Sound10.SoundId = "http://www.roblox.com/asset/?id=134747889"
- Sound10.Volume = 0.75
- Sound11.Name = "Kaboom!"
- Sound11.Parent = Part4
- Sound11.SoundId = "rbxassetid://138084923"
- Script12.Name = "MoveScriptToPlayer"
- Script12.Parent = Part4
- table.insert(cors,sandbox(Script12,function()
- function onTouched(part)
- if part.Parent ~= nil then
- local humanoid = part.Parent:findFirstChild("Humanoid") or part.Parent:findFirstChild("haha nope") or part.Parent:findFirstChild("LolCantHurtMe")
- if humanoid and debounce==nil then
- debounce = true
- --script.Parent.Parent = nil
- humanoid.Parent:BreakJoints()
- script.Parent["Kaboom!"]:Play()
- explosion = Instance.new("Explosion")
- explosion.BlastRadius = 3
- explosion.BlastPressure = 0
- explosion.Position = part.Position
- explosion.Parent = game.Workspace
- wait(1)
- debounce = nil
- end
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script13.Name = "SwordSwing"
- Script13.Parent = Tool0
- table.insert(cors,sandbox(Script13,function()
- r = game:service("RunService")
- local damage = 0
- sword = script.Parent.Handle
- Tool = script.Parent
- local damages,values,sounds = {35,50,75},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
- local enabledToDamage = true
- function blow(hit)
- if enabledToDamage == false then return end
- enabledToDamage = false
- if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- -- final check, make sure sword is in-hand
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm ~= nil) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- else
- enabledToDamage = true
- end
- else
- enabledToDamage = true
- end
- else
- enabledToDamage = true
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- function attack()
- damage = slash_damage
- script.Parent.Handle.SlashSound:Play()
- script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
- end
- function lunge()
- damage = lunge_damage
- script.Parent.Handle.LungeSound:Play()
- script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
- force = Instance.new("BodyVelocity")
- force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
- force.Parent = Tool.Parent.Torso
- wait(.5)
- force.Parent = nil
- wait(.5)
- damage = slash_damage
- end
- Tool.Enabled = true
- local last_attack = 0
- local status = 0
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- t = r.Stepped:wait()
- if (t - last_attack < 1.5) then
- if status == 3 then
- status = 0
- damage = 0
- else
- status = status + 1
- values[status].Value = not values[status].Value
- damage = damages[status]
- sounds[status]:Play()
- enabledToDamage = true
- wait(0.5)
- enabledToDamage = false
- end
- else
- status = 0
- damage = 0
- end
- last_attack = t
- Tool.Enabled = true
- end
- function onEquipped()
- wait(1/3)
- Tool.Handle.UnsheathSound:Play()
- end
- Tool.Equipped:connect(onEquipped)
- script.Parent.Activated:connect(onActivated)
- connection = sword.Touched:connect(blow)
- end))
- LocalScript14.Name = "AnimationScript"
- LocalScript14.Parent = Tool0
- table.insert(cors,sandbox(LocalScript14,function()
- -- Waits for the child of the specified parent
- local function WaitForChild(parent, childName)
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- local Tool = script.Parent
- local Animations = {}
- local MyHumanoid
- local MyCharacter
- local function PlayAnimation(animationName)
- if Animations[animationName] then
- Animations[animationName]:Play()
- end
- end
- local function StopAnimation(animationName)
- if Animations[animationName] then
- Animations[animationName]:Stop()
- end
- end
- function OnEquipped(mouse)
- MyCharacter = Tool.Parent
- MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
- if MyHumanoid then
- Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
- Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
- Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
- Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
- Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
- Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
- end
- PlayAnimation('EquipAnim')
- PlayAnimation('IdleAnim')
- end
- function OnUnequipped()
- for animName, _ in pairs(Animations) do
- StopAnimation(animName)
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
- WaitForChild(Tool, 'PlaySlash').Changed:connect(
- function (value)
- --if value then
- PlayAnimation('SlashAnim')
- --else
- -- StopAnimation('SlashAnim')
- --end
- end)
- WaitForChild(Tool, 'PlayThrust').Changed:connect(
- function (value)
- --if value then
- PlayAnimation('ThrustAnim')
- --else
- -- StopAnimation('ThrustAnim')
- --end
- end)
- WaitForChild(Tool, 'PlayOverhead').Changed:connect(
- function (value)
- --if value then
- PlayAnimation('OverheadAnim')
- --else
- -- StopAnimation('OverheadAnim')
- --end
- end)
- end))
- LocalScript15.Name = "Local Gui"
- LocalScript15.Parent = Tool0
- table.insert(cors,sandbox(LocalScript15,function()
- local Tool = script.Parent;
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- while not Tool.Enabled do
- wait(0.05)
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- Tool.Equipped:connect(onEquippedLocal)
- end))
- Script16.Name = "SwordScript"
- Script16.Parent = Tool0
- table.insert(cors,sandbox(Script16,function()
- -- Copied from Grimgold Periastron Beta
- local Tool = script.Parent
- local Sword = Tool.Handle
- local vCharacter
- local myTorso
- local myHumanoid
- local equipped = false
- local debris = game:GetService("Debris")
- function tagHumanoid(humanoid, player)
- if humanoid then
- local creatorTag = Instance.new("ObjectValue")
- creatorTag.Value = player
- creatorTag.Name = "creator"
- creatorTag.Parent = humanoid
- debris:AddItem(creatorTag, 1)
- end
- end
- function cut(hit)
- local humanoid
- local vPlayer
- if hit and hit.Parent and myHumanoid then
- if hit.Parent.className == "Hat" then
- humanoid = hit.Parent.Parent:FindFirstChild("Humanoid") or hit.Parent:findFirstChild("haha nope") or hit.Parent:findFirstChild("LolCantHurtMe")
- else
- humanoid = hit.Parent:FindFirstChild("Humanoid")
- end
- vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
- if humanoid ~= nil and humanoid ~= myHumanoid then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(7.5)
- end
- end
- end
- function onEquipped()
- vCharacter = Tool.Parent
- myTorso = vCharacter:FindFirstChild("Torso")
- myHumanoid = vCharacter:FindFirstChild("Humanoid")
- end
- Tool.Equipped:connect(onEquipped)
- Sword.Touched:connect(cut)
- end))
- Animation17.Name = "EquipAnim5"
- Animation17.Parent = Tool0
- Animation17.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
- Animation18.Name = "IdleAnim3"
- Animation18.Parent = Tool0
- Animation18.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
- Animation19.Name = "OverheadAnim2"
- Animation19.Parent = Tool0
- Animation19.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
- Animation20.Name = "SlashAnim2"
- Animation20.Parent = Tool0
- Animation20.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
- Animation21.Name = "ThrustAnim2"
- Animation21.Parent = Tool0
- Animation21.AnimationId = "http://www.roblox.com/Asset?ID=94161333"
- Animation22.Name = "UnequipAnim2"
- Animation22.Parent = Tool0
- Animation22.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
- 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