A Sword I Think?

Run Settings
LanguageLua
Language Version
Run Command
local temp = owner local owner if game:GetService("RunService"):IsClient() then owner = game:GetService("Players").LocalPlayer else owner = temp end temp = nil function sandbox(var,func) local env = getfenv(func) local newenv = setmetatable({},{ __index = function(self,k) if k=="script" then return var elseif k == "realscript" then return script else return env[k] end end, }) setfenv(func,newenv) return func end local cors = {} local ins = {mas = Instance.new("Model",game:GetService("Lighting"))} ins[([=[Tool0]=])] = Instance.new("Tool") ins[([=[Part1]=])] = Instance.new("Part") ins[([=[Sound2]=])] = Instance.new("Sound") ins[([=[Sound3]=])] = Instance.new("Sound") ins[([=[Sound4]=])] = Instance.new("Sound") ins[([=[SpecialMesh5]=])] = Instance.new("SpecialMesh") ins[([=[Sound6]=])] = Instance.new("Sound") ins[([=[ParticleEmitter7]=])] = Instance.new("ParticleEmitter") ins[([=[ParticleEmitter8]=])] = Instance.new("ParticleEmitter") ins[([=[Sound9]=])] = Instance.new("Sound") ins[([=[Sound10]=])] = Instance.new("Sound") ins[([=[Script11]=])] = Instance.new("Script") ins[([=[Tool0]=])].Name = [=====[LinkedSword]=====] ins[([=[Tool0]=])].Parent = ins[([=[mas]=])] ins[([=[Tool0]=])].TextureId = [=====[http://www.roblox.com/asset/?id=124987047]=====] ins[([=[Tool0]=])].Grip = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0) ins[([=[Tool0]=])].GripForward = Vector3.new(-1, -0, -0) ins[([=[Tool0]=])].GripPos = Vector3.new(0, 0, -1.5) ins[([=[Tool0]=])].GripRight = Vector3.new(0, 1, 0) ins[([=[Tool0]=])].GripUp = Vector3.new(0, 0, 1) ins[([=[Part1]=])].Name = [=====[Handle]=====] ins[([=[Part1]=])].Parent = ins[([=[Tool0]=])] ins[([=[Part1]=])].CFrame = CFrame.new(142.475845, 3.2067337, 81.8882904, -0.132099271, 0.914433897, 0.382570893, -0.718008339, -0.354359388, 0.599078536, 0.683384895, -0.195550695, 0.703381002) ins[([=[Part1]=])].Position = Vector3.new(142.47584533691406, 3.2067337036132812, 81.88829040527344) ins[([=[Part1]=])].Rotation = Vector3.new(-40.41999816894531, 22.489999771118164, -98.22000122070312) ins[([=[Part1]=])].Color = Color3.new(0.388235, 0.372549, 0.384314) ins[([=[Part1]=])].Size = Vector3.new(1, 0.800000011920929, 4) ins[([=[Part1]=])].Orientation = Vector3.new(-36.79999923706055, 28.540000915527344, -116.2699966430664) ins[([=[Part1]=])].BottomSurface = Enum.SurfaceType.Smooth ins[([=[Part1]=])].BrickColor = BrickColor.new("Dark stone grey") ins[([=[Part1]=])].Locked = true ins[([=[Part1]=])].Reflectance = 0.4000000059604645 ins[([=[Part1]=])].TopSurface = Enum.SurfaceType.Smooth ins[([=[Part1]=])].FormFactor = Enum.FormFactor.Custom ins[([=[Part1]=])].formFactor = Enum.FormFactor.Custom ins[([=[Sound2]=])].Name = [=====[Lunge]=====] ins[([=[Sound2]=])].Parent = ins[([=[Part1]=])] ins[([=[Sound2]=])].SoundId = [=====[http://www.roblox.com/asset/?id=12222208]=====] ins[([=[Sound2]=])].Volume = 0.6000000238418579 ins[([=[Sound3]=])].Name = [=====[Slash]=====] ins[([=[Sound3]=])].Parent = ins[([=[Part1]=])] ins[([=[Sound3]=])].SoundId = [=====[http://www.roblox.com/asset/?id=12222216]=====] ins[([=[Sound3]=])].Volume = 0.699999988079071 ins[([=[Sound4]=])].Name = [=====[Unsheath]=====] ins[([=[Sound4]=])].Parent = ins[([=[Part1]=])] ins[([=[Sound4]=])].SoundId = [=====[http://www.roblox.com/asset/?id=12222225]=====] ins[([=[Sound4]=])].Volume = 1 ins[([=[SpecialMesh5]=])].Parent = ins[([=[Part1]=])] ins[([=[SpecialMesh5]=])].MeshId = [=====[http://www.roblox.com/asset/?id=12221720]=====] ins[([=[SpecialMesh5]=])].TextureId = [=====[http://www.roblox.com/asset/?id=12224218]=====] ins[([=[SpecialMesh5]=])].MeshType = Enum.MeshType.FileMesh ins[([=[Sound6]=])].Name = [=====[music]=====] ins[([=[Sound6]=])].Parent = ins[([=[Part1]=])] ins[([=[Sound6]=])].Looped = true ins[([=[Sound6]=])].SoundId = [=====[rbxassetid://1843497734]=====] ins[([=[Sound6]=])].Volume = 2 ins[([=[ParticleEmitter7]=])].Name = [=====[blood]=====] ins[([=[ParticleEmitter7]=])].Parent = ins[([=[Part1]=])] ins[([=[ParticleEmitter7]=])].Speed = NumberRange.new(2, 2) ins[([=[ParticleEmitter7]=])].Rotation = NumberRange.new(-360, 360) ins[([=[ParticleEmitter7]=])].Enabled = false ins[([=[ParticleEmitter7]=])].LightInfluence = 1 ins[([=[ParticleEmitter7]=])].Texture = [=====[http://www.roblox.com/asset/?id=10676876887]=====] ins[([=[ParticleEmitter7]=])].Transparency = NumberSequence.new(1,0,1) ins[([=[ParticleEmitter7]=])].Size = NumberSequence.new(0,0.9999996423721313,1) ins[([=[ParticleEmitter7]=])].Acceleration = Vector3.new(0, -3, 0) ins[([=[ParticleEmitter7]=])].Lifetime = NumberRange.new(2, 2) ins[([=[ParticleEmitter7]=])].Rate = 69 ins[([=[ParticleEmitter7]=])].RotSpeed = NumberRange.new(-60, 60) ins[([=[ParticleEmitter7]=])].SpreadAngle = Vector2.new(-360, 360) ins[([=[ParticleEmitter7]=])].VelocitySpread = -360 ins[([=[ParticleEmitter8]=])].Name = [=====[slicendice]=====] ins[([=[ParticleEmitter8]=])].Parent = ins[([=[Part1]=])] ins[([=[ParticleEmitter8]=])].Speed = NumberRange.new(-0.0010000000474974513, -0.0010000000474974513) ins[([=[ParticleEmitter8]=])].Enabled = false ins[([=[ParticleEmitter8]=])].LightInfluence = 1 ins[([=[ParticleEmitter8]=])].Texture = [=====[http://www.roblox.com/asset/?id=6250126210]=====] ins[([=[ParticleEmitter8]=])].Transparency = NumberSequence.new(1,0.02499997615814209,1) ins[([=[ParticleEmitter8]=])].Size = NumberSequence.new(5,5) ins[([=[ParticleEmitter8]=])].Orientation = Enum.ParticleOrientation.VelocityPerpendicular ins[([=[ParticleEmitter8]=])].Acceleration = Vector3.new(0, -0.014999999664723873, 0) ins[([=[ParticleEmitter8]=])].Lifetime = NumberRange.new(1, 1) ins[([=[ParticleEmitter8]=])].LockedToPart = true ins[([=[ParticleEmitter8]=])].Rate = 2 ins[([=[ParticleEmitter8]=])].RotSpeed = NumberRange.new(-2160, -2160) ins[([=[ParticleEmitter8]=])].SpreadAngle = Vector2.new(-360, 360) ins[([=[ParticleEmitter8]=])].VelocitySpread = -360 ins[([=[Sound9]=])].Name = [=====[move]=====] ins[([=[Sound9]=])].Parent = ins[([=[Part1]=])] ins[([=[Sound9]=])].SoundId = [=====[rbxassetid://4958427918]=====] ins[([=[Sound9]=])].Volume = 3 ins[([=[Sound10]=])].Name = [=====[punch]=====] ins[([=[Sound10]=])].Parent = ins[([=[Part1]=])] ins[([=[Sound10]=])].SoundId = [=====[rbxassetid://9117969892]=====] ins[([=[Sound10]=])].Volume = 4 ins[([=[Script11]=])].Name = [=====[SwordScript]=====] ins[([=[Script11]=])].Parent = ins[([=[Tool0]=])] table.insert(cors,sandbox(ins[([=[Script11]=])],function() --Rescripted by Luckymaxer Tool = script.Parent Tool.ToolTip = "Bloody Hell!" Handle = Tool:WaitForChild("Handle") Mesh = Handle:WaitForChild("Mesh") Players = game:GetService("Players") Debris = game:GetService("Debris") RunService = game:GetService("RunService") BaseUrl = "http://www.roblox.com/asset/?id=" Grips = { Up = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0), Out = CFrame.new(0, 0, -1.5, 0, -1, -0, -1, 0, -0, 0, 0, -1), } DamageValues = { BaseDamage = 5/4, SlashDamage = 10/4, LungeDamage = 30/4, SlicenDiceDamage = 5, } Damage = DamageValues.BaseDamage Sounds = { Slash = Handle:WaitForChild("Slash"), Lunge = Handle:WaitForChild("Lunge"), Unsheath = Handle:WaitForChild("Unsheath"), } local LastAttack = 0 ToolEquipped = false Tool.Enabled = true music = Handle:WaitForChild("music") local hit = music:Clone() hit.Parent = music.Parent hit.Looped = false hit.SoundId = "rbxassetid://5507830073" hit.Volume = 1 local seversfx = hit:Clone() seversfx.SoundId = "rbxassetid://8164951181" seversfx.Parent = hit.Parent seversfx.Volume = 2 local hitsnds = {hit.SoundId,"rbxassetid://5507830815","rbxassetid://5507782816","rbxassetid://5507829691","rbxassetid://5507830449"} function SwordUp() Tool.Grip = Grips.Up end function SwordOut() Tool.Grip = Grips.Out 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 local hitting = false function Attack() Damage = DamageValues.SlashDamage Sounds.Slash:Play() local Anim = Instance.new("StringValue") Anim.Name = "toolanim" Anim.Value = "Slash" Anim.Parent = Tool hitting = true task.delay(.5,function() hitting = false end) end function Lunge() hitting = true Damage = DamageValues.LungeDamage Sounds.Lunge:Play() local Anim = Instance.new("StringValue") Anim.Name = "toolanim" Anim.Value = "Lunge" Anim.Parent = Tool local Force = Instance.new("BodyVelocity") Force.velocity = Vector3.new(0, 10, 0) Force.maxForce = Vector3.new(0, 4000, 0) Debris:AddItem(Force, 0.5) Force.Parent = RootPart wait(0.25) SwordOut() wait(0.25) if Force and Force.Parent then Force:Destroy() end wait(0.5) SwordUp() hitting = false end local use = false function Blow(Hit) if not Hit or not Hit.Parent or not CheckIfAlive() then return end local RightArm = (Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand")) if not RightArm then return end local RightGrip = RightArm:FindFirstChild("RightGrip") if not RightGrip or (RightGrip.Part0 ~= RightArm and RightGrip.Part1 ~= RightArm) or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then return end local character = Hit repeat if character.Parent == workspace then break end character = character.Parent until false local humanoid = character:FindFirstChild("Humanoid") if not humanoid then return end local player = Players:GetPlayerFromCharacter(character) if player and (player == Player or IsTeamMate(Player, player)) then return end if character == Tool.Parent then return end if Hit:GetAttribute("severed") or not hitting then return end UntagHumanoid(humanoid) TagHumanoid(humanoid, Player) humanoid:TakeDamage(Damage) local blood = Handle:WaitForChild("blood"):Clone() blood.Parent = Hit blood.Rate = math.ceil(Hit.Size.Magnitude*5) blood.Enabled = true if math.random(1,8) == 1 then -- sever seversfx:Play() for _,v in pairs(Hit:GetJoints()) do v:Destroy() --[[if v.Part0 == Hit then v.Part0 = nil else v.Part1 = nil end]] end Hit.Velocity = CFrame.new(Handle.Position,Hit.Position).LookVector*20 Hit:SetAttribute("severed",true) end for i = 1,math.random(10,30) do local p = Instance.new("SpawnLocation",realscript) p.Enabled = false game:GetService("Debris"):AddItem(p,3) p.Size = Vector3.new(.1,.1,.1) p.Material = Enum.Material.Marble p.Color = Color3.new(.5) p.CFrame = Hit.CFrame*CFrame.Angles(0,math.rad(math.random(-360,360)),0)*CFrame.new(0,0,math.random(-10,10)/10) p.Velocity = CFrame.new(Hit.Position,p.Position).LookVector*(math.random(30,50)/3)+Vector3.new(0,50,0) p.CanCollide = false end if not hit.Playing then hit.SoundId = hitsnds[math.random(1,#hitsnds)] hit:Play() end game:GetService("Debris"):AddItem(blood,100) end function Activated() if use then return end if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then return end Tool.Enabled = false local Tick = RunService.Stepped:wait() if (Tick - LastAttack) < 0.2 then Lunge() else Attack() end Damage = DamageValues.BaseDamage LastAttack = Tick Tool.Enabled = true end function CheckIfAlive() return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and RootPart and RootPart.Parent and Player and Player.Parent) and true) or false) end local prompts = {} local function activation(setts) -- put in the characters primarypart, or head for default -- Down:Function, Up:Function,Setup: Function, Parent:Instance, Key:Enum.KeyCode setts.Down = setts.Down or function() end setts.Up = setts.Up or function() end local prox = Instance.new("ProximityPrompt",setts.Parent or nil) prox.MaxActivationDistance = .03 prox.KeyboardKeyCode = setts.Key prox.Exclusivity = Enum.ProximityPromptExclusivity.AlwaysShow prox.Style = Enum.ProximityPromptStyle.Custom prox.RequiresLineOfSight = false prox.Triggered:Connect(function(a) setts.Down(a,prox) end) prox.TriggerEnded:Connect(function(a) setts.Up(a,prox) end) if setts.Setup then setts.Setup(prox) end return prox end local setup = function(a) print(a) table.insert(prompts,a) print(#prompts) end local sliceeffcs = Handle:WaitForChild("slicendice") sliceeffcs.Enabled = true local sliceeffcstrans = sliceeffcs.Transparency local sliceeffcstransinvis = NumberSequence.new(1) sliceeffcs.Transparency = sliceeffcstransinvis activation{Key = Enum.KeyCode.V,Down = function(plr,prompt) if use then return end if Character then local hrp = Character:FindFirstChild("HumanoidRootPart") if hrp then use = true local c c = Handle.Touched:Connect(function(t) if t and t.Parent then local char = t.Parent if char then local hum = char:FindFirstChildOfClass("Humanoid") if hum then local hrpother = char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Torso") if hrpother then hum.PlatformStand = true local force = Instance.new("BodyVelocity",hrpother) force.MaxForce = Vector3.one*math.huge -- essentially Vector3.new(math.huge,math.huge,math.huge) force.Velocity = CFrame.new(hrp.Position,hrpother.Position).LookVector*50 Handle:WaitForChild("punch"):Play() task.delay(1,function() hum.PlatformStand = false force:Destroy() end) end end end end end) task.delay(.7,function() use = false pcall(function() c:Disconnect() end) end) Tool.Grip = Grips.Out*CFrame.Angles(0,math.pi/-2,0) local i = 0 repeat game:GetService("RunService").Heartbeat:Wait() i += .15 Tool.Grip *=CFrame.new(0,0,math.sin(i)/7) until use == false Tool.Grip = Grips.Up end end end,Setup = setup} local move = Handle:WaitForChild("move") move.Parent = nil move.PlayOnRemove = true local prts = {} function getprt(par) local prt = prts[1] or Instance.new("Part") if table.find(prts,prt) then table.remove(prts,table.find(prts,prt)) end prt.Parent = par return prt,function() table.insert(prts,prt) prt:remove() end end function getmult() return Character.PrimaryPart.Size.Z end function dash(to,div) if Character then local hrp = Character:FindFirstChild("HumanoidRootPart") if hrp then move.Parent = Handle move:Remove() sliceeffcs.Transparency = sliceeffcstrans local orig = Character.PrimaryPart.CFrame local params = OverlapParams.new() params.FilterType = Enum.RaycastFilterType.Blacklist params.FilterDescendantsInstances = {script,Tool.Parent,Character} local far = (orig.Position-to.Position).Magnitude Damage = DamageValues.SlicenDiceDamage hitting = true for _,v in pairs(workspace:GetPartBoundsInBox(orig:lerp(to,.5),Vector3.new(5*getmult(),8*getmult(),far*getmult()),params)) do Blow(v) end hitting = false far = far/(div or 1)/getmult() if Character.PrimaryPart then local val = (math.ceil(far/2)) for i = 1,val do local clone = Instance.new("Model") for _,v in pairs(Character:GetChildren()) do if v:IsA("BasePart") then local part,rem = getprt(clone) if Character.PrimaryPart == v then clone.PrimaryPart = part end game:GetService("TweenService"):Create(part,TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0),{Transparency = 1}):Play() part.Anchored = true part.CanCollide = false part.Transparency = .7 part.Color = Color3.new(1,1,1) part.Material = "Neon" part.Size = v.Size part.CFrame = v.CFrame task.delay(1,rem) end end clone.Parent = realscript local a = orig:Lerp(to,i/val) clone:SetPrimaryPartCFrame(a) end end Character:SetPrimaryPartCFrame(to) task.spawn(function() task.wait(.636) sliceeffcs.Transparency = sliceeffcstransinvis end) end end end local dashing = false activation{Key = Enum.KeyCode.C,Down = function(plr,prompt) if use then return end dashing = true --slicendice repeat task.wait() if use then continue end use = true task.delay(.2,function() use = false end) local orig = Character.PrimaryPart.CFrame local far = 20*getmult() local new = orig*CFrame.new(0,0,-far) dash(new) until not dashing end,Up = function()dashing = false end,Setup=setup} activation{Key = Enum.KeyCode.R,Down = function(plr,prompt) --slicendice if use then return end use = true task.delay(2,function() use = false end) local orig = Character.PrimaryPart.CFrame local far = 10*getmult() local new = orig*CFrame.new(0,0,-far) for i = 1,10 do dash(new*(CFrame.Angles(0,math.rad(i*36),0)*CFrame.new(0,0,10*getmult()*(i%2==1 and -1 or 1))),2) task.wait(.1) end end,Setup=setup} function Equipped() Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") RootPart = Character:FindFirstChild("HumanoidRootPart") if not CheckIfAlive() then return end if not Character.PrimaryPart then return end for _,v in pairs(prompts) do v.Parent = Character.PrimaryPart end ToolEquipped = true Sounds.Unsheath:Play() music:Play() Humanoid.WalkSpeed+=5 end function Unequipped() music:Stop() ToolEquipped = false Humanoid.WalkSpeed-=5 for _,v in pairs(prompts) do v.Parent = realscript end end SwordUp() Handle.Touched:connect(Blow) Tool.Activated:connect(Activated) Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped) end)) for i,v in pairs(ins.mas:GetChildren()) do v.Parent = owner.Backpack pcall(function() v:MakeJoints() end) end ins.mas:Destroy() for i,v in pairs(cors) do spawn(function() v() end) end
Editor Settings
Theme
Key bindings
Full width
Lines