Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- 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"))
- Script0 = Instance.new("Script")
- Script1 = Instance.new("Script")
- LocalScript2 = Instance.new("LocalScript")
- Part3 = Instance.new("Part")
- SpecialMesh4 = Instance.new("SpecialMesh")
- Sound5 = Instance.new("Sound")
- Tool6 = Instance.new("Tool")
- Part7 = Instance.new("Part")
- SpecialMesh8 = Instance.new("SpecialMesh")
- Sound9 = Instance.new("Sound")
- Script10 = Instance.new("Script")
- Script11 = Instance.new("Script")
- LocalScript12 = Instance.new("LocalScript")
- Script10.Name = "Destroy"
- Script10.Parent = Tool6
- table.insert(cors,sandbox(Script10,function()
- local Tool = script.Parent --make sure this is a Tool object
- Tool.Equipped:connect(function(Mouse)
- Mouse.Button1Down:connect(function()
- script.Parent.Handle.Touched:connect(function(hit)
- hit.Transparency = 0
- for n = 1,40 do
- wait()
- hit.BrickColor = BrickColor.Random()
- end
- wait()
- hit:Destroy()
- end)
- end)
- end)
- end))
- Script11.Name = "Sword Script"
- Script11.Parent = Tool6
- table.insert(cors,sandbox(Script11,function()
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 10
- local slash_damage = 10
- sword = script.Parent.Handle
- Tool = script.Parent
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
- SlashSound.Parent = sword
- SlashSound.Volume = .7
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function blow(hit)
- 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
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- 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
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1.1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- function swordAcross()
- -- parry
- end
- Tool.Enabled = true
- local last_attack = 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()
- attack()
- last_attack = t
- --wait(.5)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- end))
- LocalScript12.Name = "Local Gui"
- LocalScript12.Parent = Tool6
- Part7.Name = "Handle"
- Part7.Parent = Tool6
- Part7.BrickColor = BrickColor.new("Dark stone grey")
- Part7.Reflectance = 0.40000000596046
- Part7.Rotation = Vector3.new(-90.0299988, -0.0399999991, -35.3699989)
- Part7.Locked = true
- Part7.FormFactor = Enum.FormFactor.Plate
- Part7.Size = Vector3.new(1, 0.800000012, 3)
- Part7.CFrame = CFrame.new(-1567.85327, 1.50039995, -2444.01294, 0.815435171, 0.578847528, -0.000649310299, 0.000796274282, -3.93885717e-21, 0.999999642, 0.578847408, -0.81543535, -0.000460921437)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Position = Vector3.new(-1567.85327, 1.50039995, -2444.01294)
- Part7.Orientation = Vector3.new(-89.9499969, -125.369995, 90)
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh8.Parent = Part7
- SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=16198309"
- SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=16198294"
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- Sound9.Parent = Part7
- Sound9.SoundId = "http://www.roblox.com/Asset/?ID=12135982"
- Sound9.Volume = 0.69999998807907
- Tool6.Name = "DeleteTool"
- Tool6.Parent = mas
- Tool6.TextureId = "http://www.roblox.com/asset?id=73241901"
- Tool6.GripForward = Vector3.new(-1, -0, -0)
- Tool6.GripPos = Vector3.new(0, 0, -0.5)
- Tool6.GripRight = Vector3.new(0, 1, 0)
- Tool6.GripUp = Vector3.new(0, 0, 1)
- Tool6.ToolTip = "Delete"
- Part7.Name = "Handle"
- Part7.Parent = Tool6
- Part7.BrickColor = BrickColor.new("Dark stone grey")
- Part7.Reflectance = 0.40000000596046
- Part7.Rotation = Vector3.new(-90.0299988, -0.0399999991, -35.3699989)
- Part7.Locked = true
- Part7.FormFactor = Enum.FormFactor.Plate
- Part7.Size = Vector3.new(1, 0.800000012, 3)
- Part7.CFrame = CFrame.new(-1567.85327, 1.50039995, -2444.01294, 0.815435171, 0.578847528, -0.000649310299, 0.000796274282, -3.93885717e-21, 0.999999642, 0.578847408, -0.81543535, -0.000460921437)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Position = Vector3.new(-1567.85327, 1.50039995, -2444.01294)
- Part7.Orientation = Vector3.new(-89.9499969, -125.369995, 90)
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh8.Parent = Part7
- SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=16198309"
- SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=16198294"
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- Sound9.Parent = Part7
- Sound9.SoundId = "http://www.roblox.com/Asset/?ID=12135982"
- Sound9.Volume = 0.69999998807907
- Script10.Name = "Destroy"
- Script10.Parent = Tool6
- table.insert(cors,sandbox(Script10,function()
- script.Parent.Activated:connect(function(mouse)
- mouse.KeyUp:connect(function()
- script.Parent.Handle.Touched:connect(function(hit)
- hit.Transparency = 0
- for n = 1,40 do
- wait()
- hit.BrickColor = BrickColor.Random()
- end
- wait()
- hit:Destroy()
- end)
- end)
- end)
- end))
- Script11.Name = "Sword Script"
- Script11.Parent = Tool6
- table.insert(cors,sandbox(Script11,function()
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 10
- local slash_damage = 10
- sword = script.Parent.Handle
- Tool = script.Parent
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
- SlashSound.Parent = sword
- SlashSound.Volume = .7
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function blow(hit)
- 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
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- 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
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1.1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- function swordAcross()
- -- parry
- end
- Tool.Enabled = true
- local last_attack = 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()
- attack()
- last_attack = t
- --wait(.5)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- end))
- LocalScript12.Name = "Local Gui"
- LocalScript12.Parent = Tool6
- 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