Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = owner
- local char = plr.Character
- local torso = char:FindFirstChild("Torso")
- local rootpart = char:FindFirstChild("HumanoidRootPart")
- local hum = char:FindFirstChildOfClass("Humanoid")
- local colors = {Color3.fromRGB(0,170,255),Color3.fromRGB(170,0,0),Color3.fromRGB(0,170,0)}
- local color = colors[math.random(1,#colors)]
- if hum.RigType ~= Enum.HumanoidRigType.R6 then warn("Character must be in R6 to use this script.") return end
- local tool = Instance.new("Tool")
- local ParticleEmitter3 = Instance.new("ParticleEmitter")
- local ParticleEmitter4 = Instance.new("ParticleEmitter")
- local ParticleEmitter5 = Instance.new("ParticleEmitter")
- local ParticleEmitter6 = Instance.new("ParticleEmitter")
- local ParticleEmitter7 = Instance.new("ParticleEmitter")
- local ParticleEmitter8 = Instance.new("ParticleEmitter")
- local ParticleEmitter9 = Instance.new("ParticleEmitter")
- local ParticleEmitter10 = Instance.new("ParticleEmitter")
- tool.Name = "Lightsaber"
- tool.Parent = plr['Backpack']
- tool.Grip = CFrame.new(2.29999948, 0.0200000294, 0.029999923, -4.37113883e-08, -1, 0, 1, -4.37113883e-08, 0, 0, 0, 1)
- tool.ToolTip = "Jedi master."
- Part1 = Instance.new("Part")
- Part2 = Instance.new("Part")
- handle = Instance.new("Part")
- Part4 = Instance.new("Part")
- Part5 = Instance.new("Part")
- Part6 = Instance.new("Part")
- Part7 = Instance.new("Part")
- Part8 = Instance.new("Part")
- Part9 = Instance.new("Part")
- Part1.Parent = tool
- Part1.CFrame = CFrame.new(-18.8149967, 1.28000009, 5.46999979, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- Part1.Orientation = Vector3.new(0, 90, -90)
- Part1.Position = Vector3.new(-18.8149967, 1.28000009, 5.46999979)
- Part1.Rotation = Vector3.new(-90, 90, 0)
- Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part1.Size = Vector3.new(1.77999997, 0.400000006, 0.400000006)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Really black")
- Part1.CanCollide = false
- Part1.Locked = true
- Part1.Material = Enum.Material.SmoothPlastic
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Really black")
- Part1.Shape = Enum.PartType.Cylinder
- Part2.Parent = tool
- Part2.CFrame = CFrame.new(-18.8050003, 2.10899997, 5.47700024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.Position = Vector3.new(-18.8050003, 2.10899997, 5.47700024)
- Part2.Transparency = 1
- Part2.Size = Vector3.new(0.0500000007, 0.200000003, 0.0500000007)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.CanCollide = false
- Part2.Locked = true
- Part2.TopSurface = Enum.SurfaceType.Smooth
- handle.Name = "Handle"
- handle.Parent = tool
- handle.CFrame = CFrame.new(-18.8049946, 3.49000025, 5.46999788, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- handle.Orientation = Vector3.new(0, 90, -90)
- handle.Position = Vector3.new(-18.8049946, 3.49000025, 5.46999788)
- handle.Rotation = Vector3.new(-90, 90, 0)
- handle.Transparency = 1
- handle.Size = Vector3.new(6.19999981, 0.699999988, 0.699999988)
- handle.BottomSurface = Enum.SurfaceType.Smooth
- handle.CanCollide = false
- handle.Locked = true
- handle.TopSurface = Enum.SurfaceType.Smooth
- handle.Shape = Enum.PartType.Cylinder
- Part4.Name = "color"
- Part4.Parent = tool
- Part4.CFrame = CFrame.new(-18.9649982, 1.69999957, 5.46999979, -1, 0, 0, 0, 0, -1, 0, -1, 0)
- Part4.Orientation = Vector3.new(90, 180, 0)
- Part4.Position = Vector3.new(-18.9649982, 1.69999957, 5.46999979)
- Part4.Rotation = Vector3.new(90, 0, -180)
- Part4.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part4.Size = Vector3.new(0.180000708, 0.214615837, 0.214615837)
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.BrickColor = BrickColor.new("Institutional white")
- Part4.CanCollide = false
- Part4.Locked = true
- Part4.Material = Enum.Material.Neon
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part4.brickColor = BrickColor.new("Institutional white")
- Part4.Shape = Enum.PartType.Cylinder
- Part5.Parent = tool
- Part5.CFrame = CFrame.new(-18.8149967, 2.1950016, 5.46999979, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- Part5.Orientation = Vector3.new(0, 90, -90)
- Part5.Position = Vector3.new(-18.8149967, 2.1950016, 5.46999979)
- Part5.Rotation = Vector3.new(-90, 90, 0)
- Part5.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part5.Size = Vector3.new(0.109999999, 0.300000012, 0.300000012)
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.BrickColor = BrickColor.new("Institutional white")
- Part5.CanCollide = false
- Part5.Locked = true
- Part5.Material = Enum.Material.Neon
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.brickColor = BrickColor.new("Institutional white")
- Part5.Shape = Enum.PartType.Cylinder
- Part6.Name = "color"
- Part6.Parent = tool
- Part6.CFrame = CFrame.new(-18.8149967, 1.96500063, 5.46999979, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- Part6.Orientation = Vector3.new(0, 90, -90)
- Part6.Position = Vector3.new(-18.8149967, 1.96500063, 5.46999979)
- Part6.Rotation = Vector3.new(-90, 90, 0)
- Part6.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part6.Size = Vector3.new(0.230000004, 0.230000004, 0.230000004)
- Part6.BottomSurface = Enum.SurfaceType.Smooth
- Part6.BrickColor = BrickColor.new("Institutional white")
- Part6.CanCollide = false
- Part6.Locked = true
- Part6.Material = Enum.Material.Neon
- Part6.TopSurface = Enum.SurfaceType.Smooth
- Part6.brickColor = BrickColor.new("Institutional white")
- Part6.Shape = Enum.PartType.Ball
- Part7.Name = "color"
- Part7.Parent = tool
- Part7.CFrame = CFrame.new(-18.8149967, 0.46500203, 5.46999979, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- Part7.Orientation = Vector3.new(0, 90, -90)
- Part7.Position = Vector3.new(-18.8149967, 0.46500203, 5.46999979)
- Part7.Rotation = Vector3.new(-90, 90, 0)
- Part7.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part7.Size = Vector3.new(0.0500000007, 0.419999987, 0.419999987)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.BrickColor = BrickColor.new("Institutional white")
- Part7.CanCollide = false
- Part7.Locked = true
- Part7.Material = Enum.Material.Neon
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.brickColor = BrickColor.new("Institutional white")
- Part7.Shape = Enum.PartType.Cylinder
- Part8.Name = "color"
- Part8.Parent = tool
- Part8.CFrame = CFrame.new(-18.8150005, 0.86500001, 5.46999979, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- Part8.Orientation = Vector3.new(0, 90, -90)
- Part8.Position = Vector3.new(-18.8150005, 0.86500001, 5.46999979)
- Part8.Rotation = Vector3.new(-90, 90, 0)
- Part8.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part8.Size = Vector3.new(0.0500000007, 0.419999987, 0.419999987)
- Part8.BottomSurface = Enum.SurfaceType.Smooth
- Part8.BrickColor = BrickColor.new("Institutional white")
- Part8.CanCollide = false
- Part8.Locked = true
- Part8.Material = Enum.Material.Neon
- Part8.TopSurface = Enum.SurfaceType.Smooth
- Part8.brickColor = BrickColor.new("Institutional white")
- Part8.Shape = Enum.PartType.Cylinder
- Part9.Name = "color"
- Part9.Parent = tool
- Part9.CFrame = CFrame.new(-18.8150005, 0.665000021, 5.46999979, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- Part9.Orientation = Vector3.new(0, 90, -90)
- Part9.Position = Vector3.new(-18.8150005, 0.665000021, 5.46999979)
- Part9.Rotation = Vector3.new(-90, 90, 0)
- Part9.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part9.Size = Vector3.new(0.0500000007, 0.419999987, 0.419999987)
- Part9.BottomSurface = Enum.SurfaceType.Smooth
- Part9.BrickColor = BrickColor.new("Institutional white")
- Part9.CanCollide = false
- Part9.Locked = true
- Part9.Material = Enum.Material.Neon
- Part9.TopSurface = Enum.SurfaceType.Smooth
- Part9.brickColor = BrickColor.new("Institutional white")
- Part9.Shape = Enum.PartType.Cylinder
- ParticleEmitter3.Name = "Inner"
- ParticleEmitter3.Speed = NumberRange.new(4.5, 4.5)
- ParticleEmitter3.Color = ColorSequence.new(Color3.new(1,1,1),Color3.new(1,1,1))
- ParticleEmitter3.LightEmission = 0.5
- ParticleEmitter3.LightInfluence = 0
- ParticleEmitter3.Texture = "rbxassetid://172380355"
- ParticleEmitter3.Transparency = NumberSequence.new(0.7,0.7)
- ParticleEmitter3.ZOffset = -1
- ParticleEmitter3.Size = NumberSequence.new(0.09,0.09)
- ParticleEmitter3.Lifetime = NumberRange.new(1, 1)
- ParticleEmitter3.LockedToPart = true
- ParticleEmitter3.Rate = 10000
- ParticleEmitter7.Name = "Outer"
- ParticleEmitter7.Parent = Part2
- ParticleEmitter7.Speed = NumberRange.new(4.5, 4.5)
- ParticleEmitter7.Color = ColorSequence.new(color,color)
- ParticleEmitter7.LightEmission = 0.5
- ParticleEmitter7.LightInfluence = 0
- ParticleEmitter7.Texture = "rbxassetid://172380355"
- ParticleEmitter7.Transparency = NumberSequence.new(0.95,0.95)
- ParticleEmitter7.ZOffset = -1.1
- ParticleEmitter7.Size = NumberSequence.new(0.33,0.33)
- ParticleEmitter7.Lifetime = NumberRange.new(1, 1)
- ParticleEmitter7.LockedToPart = true
- ParticleEmitter7.Rate = 10000
- ParticleEmitter4 = ParticleEmitter3:Clone()
- ParticleEmitter5 = ParticleEmitter3:Clone()
- ParticleEmitter6 = ParticleEmitter3:Clone()
- ParticleEmitter8 = ParticleEmitter7:Clone()
- ParticleEmitter9 = ParticleEmitter7:Clone()
- ParticleEmitter10 = ParticleEmitter7:Clone()
- ParticleEmitter3.Parent = Part2
- ParticleEmitter4.Parent = Part2
- ParticleEmitter5.Parent = Part2
- ParticleEmitter6.Parent = Part2
- ParticleEmitter7.Parent = Part2
- ParticleEmitter8.Parent = Part2
- ParticleEmitter9.Parent = Part2
- ParticleEmitter10.Parent = Part2
- local spark = Instance.new("ParticleEmitter")
- spark.Enabled = false
- spark.Name = "spark"
- spark.Parent = handle
- spark.Speed = NumberRange.new(0.20000000298023, 0.20000000298023)
- spark.Rotation = NumberRange.new(45, 45)
- spark.Color = ColorSequence.new(Color3.new(1, 0.784314, 0), Color3.new(1, 1, 0.203922))
- spark.LightEmission = 3
- spark.Texture = "rbxassetid://134531274"
- spark.ZOffset = 2
- spark.Size = NumberSequence.new(0.24999976158142,0)
- spark.Lifetime = NumberRange.new(1, 2)
- spark.Rate = 400
- spark.Speed = NumberRange.new(0.5, 1)
- spark.RotSpeed = NumberRange.new(20, 20)
- spark.SpreadAngle = Vector2.new(180, 180)
- spark.VelocitySpread = 180
- local att = Instance.new("Attachment")
- att.Parent = handle
- att.Position = Vector3.new(handle.Size.X/(math.random(40,70)/100),0,0)
- local shock = Instance.new("ParticleEmitter")
- shock.Parent = att
- shock.Speed = NumberRange.new(1, 1)
- shock.Rotation = NumberRange.new(-180, 180)
- shock.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.new(1, 1, 0)),
- ColorSequenceKeypoint.new(0.155, Color3.new(1, 0.721201, 0.0644535)),
- ColorSequenceKeypoint.new(0.166, Color3.new(1, 0.956581, 0.0100378)),
- ColorSequenceKeypoint.new(0.186, Color3.new(1, 0.72522, 0.0635244)),
- ColorSequenceKeypoint.new(0.196, Color3.new(1, 0.757413, 0.0560818)),
- ColorSequenceKeypoint.new(0.587, Color3.new(1, 0.690516, 0.0715474)),
- ColorSequenceKeypoint.new(0.737, Color3.new(1, 0.969307, 0.907922)),
- ColorSequenceKeypoint.new(1, Color3.new(1, 1, 1)),
- })
- shock.Enabled = false
- shock.LightEmission = 1
- shock.LightInfluence = 0
- shock.Texture = "rbxassetid://1084955012"
- shock.Transparency = NumberSequence.new({
- NumberSequenceKeypoint.new(0,0.88311409950256),
- NumberSequenceKeypoint.new(0.0555,0.98257392644882),
- NumberSequenceKeypoint.new(0.111,0.17053742706776),
- NumberSequenceKeypoint.new(0.167,0.39307841658592),
- NumberSequenceKeypoint.new(0.222,0.12906277179718),
- NumberSequenceKeypoint.new(0.278,0.92074340581894),
- NumberSequenceKeypoint.new(0.333,0.41569262742996),
- NumberSequenceKeypoint.new(0.389,0.21503341197968),
- NumberSequenceKeypoint.new(0.444,0.78206729888916),
- NumberSequenceKeypoint.new(0.5,0.23203222453594),
- NumberSequenceKeypoint.new(0.555,0.78981900215149),
- NumberSequenceKeypoint.new(0.61,0.81099885702133),
- NumberSequenceKeypoint.new(0.666,0.91161841154099),
- NumberSequenceKeypoint.new(0.721,0.87456893920898),
- NumberSequenceKeypoint.new(0.777,0.41929379105568),
- NumberSequenceKeypoint.new(0.832,0.30027160048485),
- NumberSequenceKeypoint.new(0.888,0.16400647163391),
- NumberSequenceKeypoint.new(0.943,0.39603871107101),
- NumberSequenceKeypoint.new(0.999,0.70033878087997),
- NumberSequenceKeypoint.new(1,1)
- })
- shock.ZOffset = 0
- shock.Size = NumberSequence.new(0,4.875)
- shock.Lifetime = NumberRange.new(0.5, 0.5)
- shock.Rate = 10
- shock.RotSpeed = NumberRange.new(-100, 100)
- local glow = Instance.new("ParticleEmitter")
- glow.Parent = att
- glow.Speed = NumberRange.new(1, 1)
- glow.Rotation = NumberRange.new(-180, 180)
- glow.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.new(1, 0.666667, 0)),
- ColorSequenceKeypoint.new(0.614, Color3.new(1, 0.69218, 0)),
- ColorSequenceKeypoint.new(0.882, Color3.new(1, 0.961668, 0)),
- ColorSequenceKeypoint.new(1, Color3.new(1, 1, 0)),
- })
- glow.Enabled = false
- glow.LightEmission = 0.5
- glow.LightInfluence = 0
- glow.Texture = "rbxassetid://867619398"
- glow.Transparency = NumberSequence.new(0,1)
- glow.ZOffset = -1
- glow.Size = NumberSequence.new(0,5)
- glow.Lifetime = NumberRange.new(0.5, 0.5)
- glow.Rate = 10
- glow.RotSpeed = NumberRange.new(-100, 100)
- glow.SpreadAngle = Vector2.new(100, 100)
- glow.VelocitySpread = 100
- local light = Instance.new("PointLight")
- light.Color = color
- light.Range = 5
- light.Brightness = 25
- light.Shadows = true
- light.Enabled = true
- light.Parent = handle
- local selection = Instance.new("SelectionBox")
- selection.Parent = handle
- selection.Visible = false
- selection.Color = BrickColor.new("New Yeller")
- selection.Color3 = Color3.new(1, 1, 0.109804)
- selection.Adornee = handle
- selection.LineThickness = 0.050000000745058
- for _,obj in pairs(tool:GetChildren()) do
- if obj:IsA("Part") then
- pcall(function()
- local weld = Instance.new("Weld")
- weld.Part0 = handle
- weld.Part1 = obj
- weld.C0 = handle.CFrame:Inverse()
- weld.C1 = obj.CFrame:Inverse()
- weld.Parent = tool
- end)
- end
- if obj:IsA("Part") and obj.Name == "color" then
- obj.Color = color
- end
- end
- local at1,at2,Trail = Instance.new("Attachment"),Instance.new("Attachment"),Instance.new("Trail")
- at1.Parent,at2.Parent,Trail.Parent = handle,handle,handle
- at1.Position = Vector3.new(-3.1, 0, 0)
- at2.Position = Vector3.new(3.1, 0, 0)
- Trail.Enabled = false
- Trail.Attachment0 = at1
- Trail.Attachment1 = at2
- Trail.Color = ColorSequence.new(color,color)
- Trail.Transparency = NumberSequence.new(0,1)
- Trail.Lifetime = NumberSequence.new(0.5,0.5)
- local swings = {4374879236,4374878756,4374877983} -- 4374878364
- local swingsound = Instance.new("Sound")
- swingsound.SoundId = 'rbxassetid://' .. swings[math.random(1,#swings)]
- swingsound.Volume = 1
- swingsound.Parent = handle
- local hitsound = Instance.new("Sound")
- hitsound.SoundId = 'rbxassetid://1335649595'
- hitsound.Volume = 1
- hitsound.Parent = handle
- local humsound = Instance.new("Sound")
- humsound.SoundId = 'rbxassetid://605578076'
- humsound.Volume = 0.5
- humsound.Looped = true
- humsound.Parent = handle
- local onsound = Instance.new("Sound")
- onsound.SoundId = 'rbxassetid://605604103'
- onsound.Volume = 1
- onsound.Parent = handle
- local offsound = Instance.new("Sound")
- offsound.SoundId = 'rbxassetid://605607641'
- offsound.Volume = 1
- offsound.Parent = handle
- local damage = math.random(20,25)
- local animval = 1
- local counter = 0
- local cooldown = 0
- local resetcooldown = 0.1
- local attacking = false
- local damaging = false
- local equipping = false
- local anims = {33169596,204062532,218504594}
- local animation = Instance.new("Animation")
- animation.AnimationId = "rbxassetid://" .. anims[math.random(1,#anims)]
- local swinganim = hum:LoadAnimation(animation)
- local equipanimation = Instance.new("Animation")
- equipanimation.AnimationId = "rbxassetid://86504773"
- local equipanim = hum:LoadAnimation(equipanimation)
- local idleanimation = Instance.new("Animation")
- idleanimation.AnimationId = "rbxassetid://94108418"
- local idleanim = hum:LoadAnimation(idleanimation)
- local Connection,CurrentHealth
- local screen,healthbar,healthstat,staminabar,staminastat,blockbar,blockstat
- local stamina,staminamax = 100,100
- local blockhealth,blockhealthmax = 100,100
- local stamina_counter,block_counter = 0,0
- function limb_collide(obj,mode)
- if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) then else return end
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- --
- local t = {}
- --
- local cb = Instance.new("Part")
- cb.Name = 'limb'
- cb.Transparency = 1
- cb.CanCollide = true
- cb.Anchored = false
- cb.CFrame = obj.CFrame
- cb.Size = obj.Size
- cb.Massless = true
- cb.Locked = true
- game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = cb
- weld.Part1 = obj
- weld.Parent = cb
- obj.Massless = true
- obj.Anchored = false
- if mode then
- cb.Parent = obj.Parent
- else
- cb.Parent = script
- end
- table.insert(t,1,cb)
- --
- if not string.match(obj.Name:lower(),'torso') and not string.match(obj.Name:lower(),'rootpart') and not string.match(obj.Name:lower(),'head') then
- local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
- local cb2 = Instance.new("Part")
- cb2.Name = 'limb'
- cb2.Transparency = 1
- cb2.CanCollide = true
- cb2.Anchored = false
- cb2.CFrame = obj.CFrame
- cb2.Size = lv
- cb2.Massless = true
- cb2.Locked = true
- local weld2 = Instance.new("Weld")
- weld2.Part0 = cb
- weld2.Part1 = cb2
- weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
- weld2.Parent = cb2
- if mode then
- cb2.Parent = obj.Parent
- else
- cb2.Parent = script
- end
- table.insert(t,1,cb2)
- end
- --
- return t
- end
- function Ragdoll(targchar,headless,insta,kill)
- local pc = targchar
- local targhum = pc:FindFirstChild("Humanoid")
- local js,js2 = {},{}
- for _,obj in pairs(pc:GetDescendants()) do
- if obj:IsA("BasePart") or obj:IsA("UnionOperation") then
- obj.Massless = true
- obj.Locked = true
- end
- end
- if kill == true then
- pc.Archivable = true
- local old_pc = pc
- pc = pc:Clone()
- for i,v in pairs(pc:GetDescendants()) do
- limb_collide(v,true)
- if v:IsA("ParticleEmitter") then
- v.Enabled = false
- end
- if v:IsA("BodyVelocity") or v:IsA("BodyPosition") or v:IsA("BodyAngularVelocity") or v:IsA("BodyForce") or v:IsA("BodyGyro") or v:IsA("BodyThrust") or v:IsA("BodyMover") then
- v:Destroy()
- end
- if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
- v:Destroy()
- end
- if v:IsA("Humanoid") then
- v.BreakJointsOnDeath = false
- v.Health = 0
- v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- v.PlatformStand = true
- end
- end
- for i,v in pairs(old_pc:GetDescendants()) do
- if v:IsA("BasePart") or v:IsA("UnionOperation") or v:IsA("ForceField") or v:IsA("Accessory") or v:IsA("Decal") or v:IsA("Texture") or v:IsA("SurfaceGui") then
- v:destroy()
- end
- if v:IsA("Humanoid") then
- v.BreakJointsOnDeath = true
- v.Health = 0
- v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- v.PlatformStand = true
- end
- end
- pc.Parent = workspace
- end
- --if kill and targhum:FindFirstChild("Ragdolled") then return; end;
- if pc ~= nil then
- local hum = pc:FindFirstChild'Humanoid'
- local LArm = pc:FindFirstChild'Left Arm'
- local RArm = pc:FindFirstChild'Right Arm'
- local LLeg = pc:FindFirstChild'Left Leg'
- local RLeg = pc:FindFirstChild'Right Leg'
- local torso = pc:FindFirstChild'Torso'
- local head = pc:FindFirstChild'Head'
- local LUA = pc:FindFirstChild'LeftUpperArm'
- local LLA = pc:FindFirstChild'LeftLowerArm'
- local LH = pc:FindFirstChild'LeftHand'
- local RUA = pc:FindFirstChild'RightUpperArm'
- local RLA = pc:FindFirstChild'RightLowerArm'
- local RH = pc:FindFirstChild'RightHand'
- local LUL = pc:FindFirstChild'LeftUpperLeg'
- local LLL = pc:FindFirstChild'LeftLowerLeg'
- local LF = pc:FindFirstChild'LeftFoot'
- local RUL = pc:FindFirstChild'RightUpperLeg'
- local RLL = pc:FindFirstChild'RightLowerLeg'
- local RF = pc:FindFirstChild'RightFoot'
- local UT = pc:FindFirstChild'UpperTorso'
- local LT = pc:FindFirstChild'LowerTorso'
- if hum and LArm and RArm and LLeg and RLeg and head then
- hum.BreakJointsOnDeath = false
- if insta then
- if hum.RigType==Enum.HumanoidRigType.R6 then
- for _,v in pairs(torso:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if not LArm:FindFirstChild('Dismembered') then
- local at1 = Instance.new("Attachment")
- at1.Parent = torso
- at1.Visible = vis
- at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
- at1.Position = Vector3.new(-1,1,0)
- local at1p2 = Instance.new("Attachment")
- at1p2.Parent = LArm
- at1p2.Visible = vis
- at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
- at1p2.Position = Vector3.new(.5,1,0)
- local bis = Instance.new("BallSocketConstraint")
- bis.Parent = LArm
- bis.Attachment0 = at1
- bis.Attachment1 = at1p2
- bis.LimitsEnabled = true
- bis.UpperAngle = 15
- bis.Visible = vis2
- bis.TwistLimitsEnabled = true
- bis.UpperAngle = -45
- bis.TwistLowerAngle = -45
- table.insert(js,1,bis)
- end
- if not RArm:FindFirstChild('Dismembered') then
- local at2 = Instance.new("Attachment")
- at2.Parent = torso
- at2.Visible = vis
- at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
- at2.Position = Vector3.new(1,1,0)
- local at2p2 = Instance.new("Attachment")
- at2p2.Parent = RArm
- at2p2.Visible = vis
- at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
- at2p2.Position = Vector3.new(-.5,1,0)
- local bis2 = Instance.new("BallSocketConstraint")
- bis2.Parent = RArm
- bis2.Attachment0 = at2
- bis2.Attachment1 = at2p2
- bis2.LimitsEnabled = true
- bis2.UpperAngle = 15
- bis2.Visible = vis2
- bis2.TwistLimitsEnabled = true
- bis2.UpperAngle = -45
- bis2.TwistLowerAngle = -45
- table.insert(js,1,bis2)
- end
- if not RLeg:FindFirstChild('Dismembered') then
- local at3 = Instance.new("Attachment")
- at3.Parent = torso
- at3.Visible = vis
- at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at3.Position = Vector3.new(.5,-1,0)
- local at3p2 = Instance.new("Attachment")
- at3p2.Parent = RLeg
- at3p2.Visible = vis
- at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
- at3p2.Position = Vector3.new(0,1,0)
- local bis3 = Instance.new("BallSocketConstraint")
- bis3.Parent = RLeg
- bis3.Attachment0 = at3
- bis3.Attachment1 = at3p2
- bis3.LimitsEnabled = true
- bis3.UpperAngle = 180-15
- bis3.Visible = vis2
- table.insert(js,1,bis3)
- end
- if not LLeg:FindFirstChild('Dismembered') then
- local at4 = Instance.new("Attachment")
- at4.Parent = torso
- at4.Visible = vis
- at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at4.Position = Vector3.new(-.5,-1,0)
- local at4p2 = Instance.new("Attachment")
- at4p2.Parent = LLeg
- at4p2.Visible = vis
- at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
- at4p2.Position = Vector3.new(0,1,0)
- local bis4 = Instance.new("BallSocketConstraint")
- bis4.Parent = LLeg
- bis4.Attachment0 = at4
- bis4.Attachment1 = at4p2
- bis4.LimitsEnabled = true
- bis4.UpperAngle = 180-15
- bis4.Visible = vis2
- table.insert(js,1,bis4)
- end
- if not headless and not head:FindFirstChild('Dismembered') then
- local at5 = Instance.new("Attachment")
- at5.Parent = torso
- at5.Visible = vis
- at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
- at5.Position = Vector3.new(0,1,0)
- local at5p2 = Instance.new("Attachment")
- at5p2.Parent = head
- at5p2.Visible = vis
- at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
- at5p2.Position = Vector3.new(0,-.5,0)
- local bis5 = Instance.new("BallSocketConstraint")
- bis5.Parent = head
- bis5.Attachment0 = at5p2
- bis5.Attachment1 = at5
- bis5.LimitsEnabled = true
- bis5.UpperAngle = 75
- bis5.Visible = vis2
- bis5.TwistLimitsEnabled = true
- bis5.UpperAngle = -45
- bis5.TwistLowerAngle = -45
- table.insert(js,1,bis5)
- else
- --head:BreakJoints()
- end
- end
- else
- hum.Died:Connect(function()
- if hum.RigType==Enum.HumanoidRigType.R6 then
- for _,v in pairs(torso:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if not LArm:FindFirstChild('Dismembered') then
- local at1 = Instance.new("Attachment")
- at1.Parent = torso
- at1.Visible = vis
- at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
- at1.Position = Vector3.new(-1,1,0)
- local at1p2 = Instance.new("Attachment")
- at1p2.Parent = LArm
- at1p2.Visible = vis
- at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
- at1p2.Position = Vector3.new(.5,1,0)
- local bis = Instance.new("BallSocketConstraint")
- bis.Parent = LArm
- bis.Attachment0 = at1
- bis.Attachment1 = at1p2
- bis.LimitsEnabled = true
- bis.UpperAngle = 15
- bis.Visible = vis2
- bis.TwistLimitsEnabled = true
- bis.UpperAngle = -45
- bis.TwistLowerAngle = -45
- table.insert(js,1,bis)
- end
- if not RArm:FindFirstChild('Dismembered') then
- local at2 = Instance.new("Attachment")
- at2.Parent = torso
- at2.Visible = vis
- at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
- at2.Position = Vector3.new(1,1,0)
- local at2p2 = Instance.new("Attachment")
- at2p2.Parent = RArm
- at2p2.Visible = vis
- at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
- at2p2.Position = Vector3.new(-.5,1,0)
- local bis2 = Instance.new("BallSocketConstraint")
- bis2.Parent = RArm
- bis2.Attachment0 = at2
- bis2.Attachment1 = at2p2
- bis2.LimitsEnabled = true
- bis2.UpperAngle = 15
- bis2.Visible = vis2
- bis2.TwistLimitsEnabled = true
- bis2.UpperAngle = -45
- bis2.TwistLowerAngle = -45
- table.insert(js,1,bis2)
- end
- if not RLeg:FindFirstChild('Dismembered') then
- local at3 = Instance.new("Attachment")
- at3.Parent = torso
- at3.Visible = vis
- at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at3.Position = Vector3.new(.5,-1,0)
- local at3p2 = Instance.new("Attachment")
- at3p2.Parent = RLeg
- at3p2.Visible = vis
- at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
- at3p2.Position = Vector3.new(0,1,0)
- local bis3 = Instance.new("BallSocketConstraint")
- bis3.Parent = RLeg
- bis3.Attachment0 = at3
- bis3.Attachment1 = at3p2
- bis3.LimitsEnabled = true
- bis3.UpperAngle = 180-15
- bis3.Visible = vis2
- table.insert(js,1,bis3)
- end
- if not LLeg:FindFirstChild('Dismembered') then
- local at4 = Instance.new("Attachment")
- at4.Parent = torso
- at4.Visible = vis
- at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at4.Position = Vector3.new(-.5,-1,0)
- local at4p2 = Instance.new("Attachment")
- at4p2.Parent = LLeg
- at4p2.Visible = vis
- at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
- at4p2.Position = Vector3.new(0,1,0)
- local bis4 = Instance.new("BallSocketConstraint")
- bis4.Parent = LLeg
- bis4.Attachment0 = at4
- bis4.Attachment1 = at4p2
- bis4.LimitsEnabled = true
- bis4.UpperAngle = 180-15
- bis4.Visible = vis2
- table.insert(js,1,bis4)
- end
- if not headless and not head:FindFirstChild('Dismembered') then
- local at5 = Instance.new("Attachment")
- at5.Parent = torso
- at5.Visible = vis
- at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
- at5.Position = Vector3.new(0,1,0)
- local at5p2 = Instance.new("Attachment")
- at5p2.Parent = head
- at5p2.Visible = vis
- at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
- at5p2.Position = Vector3.new(0,-.5,0)
- local bis5 = Instance.new("BallSocketConstraint")
- bis5.Parent = head
- bis5.Attachment0 = at5p2
- bis5.Attachment1 = at5
- bis5.LimitsEnabled = true
- bis5.UpperAngle = 75
- bis5.Visible = vis2
- bis5.TwistLimitsEnabled = true
- bis5.UpperAngle = -45
- bis5.TwistLowerAngle = -45
- table.insert(js,1,bis5)
- else
- --head:BreakJoints()
- end
- end
- end)
- end
- elseif head and hum then
- hum.BreakJointsOnDeath = false
- if insta then
- if hum.RigType==Enum.HumanoidRigType.R15 then
- for _,v in pairs(pc:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if not LF:FindFirstChild('Dismembered') then
- local bsc1 = Instance.new("BallSocketConstraint",LF)
- bsc1.Attachment0 = LF.LeftAnkleRigAttachment
- bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
- table.insert(js,1,bsc1)
- end
- if not LLL:FindFirstChild('Dismembered') then
- local bsc2 = Instance.new("BallSocketConstraint",LLL)
- bsc2.Attachment0 = LLL.LeftKneeRigAttachment
- bsc2.Attachment1 = LUL.LeftKneeRigAttachment
- table.insert(js,1,bsc2)
- end
- if not LUL:FindFirstChild('Dismembered') then
- local bsc3 = Instance.new("BallSocketConstraint",LUL)
- bsc3.Attachment0 = LUL.LeftHipRigAttachment
- bsc3.Attachment1 = LT.LeftHipRigAttachment
- table.insert(js,1,bsc3)
- end
- if not RF:FindFirstChild('Dismembered') then
- local bsc4 = Instance.new("BallSocketConstraint",RF)
- bsc4.Attachment0 = RF.RightAnkleRigAttachment
- bsc4.Attachment1 = RLL.RightAnkleRigAttachment
- table.insert(js,1,bsc4)
- end
- if not RLL:FindFirstChild('Dismembered') then
- local bsc5 = Instance.new("BallSocketConstraint",RLL)
- bsc5.Attachment0 = RLL.RightKneeRigAttachment
- bsc5.Attachment1 = RUL.RightKneeRigAttachment
- table.insert(js,1,bsc5)
- end
- if not RUL:FindFirstChild('Dismembered') then
- local bsc6 = Instance.new("BallSocketConstraint",RUL)
- bsc6.Attachment0 = RUL.RightHipRigAttachment
- bsc6.Attachment1 = LT.RightHipRigAttachment
- table.insert(js,1,bsc6)
- end
- if not LH:FindFirstChild('Dismembered') then
- local bsc7 = Instance.new("BallSocketConstraint",LH)
- bsc7.Attachment0 = LH.LeftWristRigAttachment
- bsc7.Attachment1 = LLA.LeftWristRigAttachment
- table.insert(js,1,bsc7)
- end
- if not LLA:FindFirstChild('Dismembered') then
- local bsc8 = Instance.new("BallSocketConstraint",LLA)
- bsc8.Attachment0 = LLA.LeftElbowRigAttachment
- bsc8.Attachment1 = LUA.LeftElbowRigAttachment
- table.insert(js,1,bsc8)
- end
- if not LUA:FindFirstChild('Dismembered') then
- local bsc9 = Instance.new("BallSocketConstraint",LUA)
- bsc9.Attachment0 = LUA.LeftShoulderAttachment
- bsc9.Attachment1 = UT.LeftCollarAttachment
- table.insert(js,1,bsc9)
- end
- if not RH:FindFirstChild('Dismembered') then
- local bsc10 = Instance.new("BallSocketConstraint",RH)
- bsc10.Attachment0 = RH.RightWristRigAttachment
- bsc10.Attachment1 = RLA.RightWristRigAttachment
- table.insert(js,1,bsc10)
- end
- if not RLA:FindFirstChild('Dismembered') then
- local bsc11 = Instance.new("BallSocketConstraint",RLA)
- bsc11.Attachment0 = RLA.RightElbowRigAttachment
- bsc11.Attachment1 = RUA.RightElbowRigAttachment
- table.insert(js,1,bsc11)
- end
- if not RUA:FindFirstChild('Dismembered') then
- local bsc12 = Instance.new("BallSocketConstraint",RUA)
- bsc12.Attachment0 = RUA.RightShoulderAttachment
- bsc12.Attachment1 = UT.RightCollarAttachment
- table.insert(js,1,bsc12)
- end
- if not LT:FindFirstChild('Dismembered') then
- local bsc13 = Instance.new("BallSocketConstraint",LT)
- bsc13.Attachment0 = LT.WaistRigAttachment
- bsc13.Attachment1 = UT.WaistRigAttachment
- table.insert(js,1,bsc13)
- end
- if not headless and not head:FindFirstChild('Dismembered') then
- local bsc14 = Instance.new("BallSocketConstraint",head)
- bsc14.Attachment0 = UT.NeckRigAttachment
- bsc14.Attachment1 = head.NeckRigAttachment
- bsc14.LimitsEnabled = true
- bsc14.UpperAngle = -75
- bsc14.TwistLimitsEnabled = true
- bsc14.UpperAngle = -45
- bsc14.TwistLowerAngle = -45
- table.insert(js,1,bsc14)
- else
- --head:BreakJoints()
- end
- end
- else
- hum.Died:Connect(function()
- if hum.RigType==Enum.HumanoidRigType.R15 then
- for _,v in pairs(pc:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if not LF:FindFirstChild('Dismembered') then
- local bsc1 = Instance.new("BallSocketConstraint",LF)
- bsc1.Attachment0 = LF.LeftAnkleRigAttachment
- bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
- table.insert(js,1,bsc1)
- end
- if not LLL:FindFirstChild('Dismembered') then
- local bsc2 = Instance.new("BallSocketConstraint",LLL)
- bsc2.Attachment0 = LLL.LeftKneeRigAttachment
- bsc2.Attachment1 = LUL.LeftKneeRigAttachment
- table.insert(js,1,bsc2)
- end
- if not LUL:FindFirstChild('Dismembered') then
- local bsc3 = Instance.new("BallSocketConstraint",LUL)
- bsc3.Attachment0 = LUL.LeftHipRigAttachment
- bsc3.Attachment1 = LT.LeftHipRigAttachment
- table.insert(js,1,bsc3)
- end
- if not RF:FindFirstChild('Dismembered') then
- local bsc4 = Instance.new("BallSocketConstraint",RF)
- bsc4.Attachment0 = RF.RightAnkleRigAttachment
- bsc4.Attachment1 = RLL.RightAnkleRigAttachment
- table.insert(js,1,bsc4)
- end
- if not RLL:FindFirstChild('Dismembered') then
- local bsc5 = Instance.new("BallSocketConstraint",RLL)
- bsc5.Attachment0 = RLL.RightKneeRigAttachment
- bsc5.Attachment1 = RUL.RightKneeRigAttachment
- table.insert(js,1,bsc5)
- end
- if not RUL:FindFirstChild('Dismembered') then
- local bsc6 = Instance.new("BallSocketConstraint",RUL)
- bsc6.Attachment0 = RUL.RightHipRigAttachment
- bsc6.Attachment1 = LT.RightHipRigAttachment
- table.insert(js,1,bsc6)
- end
- if not LH:FindFirstChild('Dismembered') then
- local bsc7 = Instance.new("BallSocketConstraint",LH)
- bsc7.Attachment0 = LH.LeftWristRigAttachment
- bsc7.Attachment1 = LLA.LeftWristRigAttachment
- table.insert(js,1,bsc7)
- end
- if not LLA:FindFirstChild('Dismembered') then
- local bsc8 = Instance.new("BallSocketConstraint",LLA)
- bsc8.Attachment0 = LLA.LeftElbowRigAttachment
- bsc8.Attachment1 = LUA.LeftElbowRigAttachment
- table.insert(js,1,bsc8)
- end
- if not LUA:FindFirstChild('Dismembered') then
- local bsc9 = Instance.new("BallSocketConstraint",LUA)
- bsc9.Attachment0 = LUA.LeftShoulderAttachment
- bsc9.Attachment1 = UT.LeftCollarAttachment
- table.insert(js,1,bsc9)
- end
- if not RH:FindFirstChild('Dismembered') then
- local bsc10 = Instance.new("BallSocketConstraint",RH)
- bsc10.Attachment0 = RH.RightWristRigAttachment
- bsc10.Attachment1 = RLA.RightWristRigAttachment
- table.insert(js,1,bsc10)
- end
- if not RLA:FindFirstChild('Dismembered') then
- local bsc11 = Instance.new("BallSocketConstraint",RLA)
- bsc11.Attachment0 = RLA.RightElbowRigAttachment
- bsc11.Attachment1 = RUA.RightElbowRigAttachment
- table.insert(js,1,bsc11)
- end
- if not RUA:FindFirstChild('Dismembered') then
- local bsc12 = Instance.new("BallSocketConstraint",RUA)
- bsc12.Attachment0 = RUA.RightShoulderAttachment
- bsc12.Attachment1 = UT.RightCollarAttachment
- table.insert(js,1,bsc12)
- end
- if not LT:FindFirstChild('Dismembered') then
- local bsc13 = Instance.new("BallSocketConstraint",LT)
- bsc13.Attachment0 = LT.WaistRigAttachment
- bsc13.Attachment1 = UT.WaistRigAttachment
- table.insert(js,1,bsc13)
- end
- if not headless and not head:FindFirstChild('Dismembered') then
- local bsc14 = Instance.new("BallSocketConstraint",head)
- bsc14.Attachment0 = UT.NeckRigAttachment
- bsc14.Attachment1 = head.NeckRigAttachment
- bsc14.LimitsEnabled = true
- bsc14.UpperAngle = -75
- bsc14.TwistLimitsEnabled = true
- bsc14.UpperAngle = -45
- bsc14.TwistLowerAngle = -45
- table.insert(js,1,bsc14)
- else
- --head:BreakJoints()
- end
- end
- end)
- end
- end
- end
- return js,js2
- end
- --function start_saber()
- function blow(hit)
- local targchar,targtorso,targhum,killval,hitval,finishval
- pcall(function()
- targchar = hit.Parent
- end)
- pcall(function()
- targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("HumanoidRootPart")
- end)
- pcall(function()
- targhum = targchar:FindFirstChildOfClass("Humanoid")
- end)
- pcall(function()
- killval = targhum:FindFirstChild("killer")
- end)
- pcall(function()
- hitval = targhum:FindFirstChild("hit " .. plr.Name)
- end)
- pcall(function()
- finishval = targhum:FindFirstChild("finishing")
- end)
- if CheckIfAlive() and targchar and targhum and targhum ~= hum and hum and not killval and not hitval and not finishval and attacking and damaging then
- local temphitval = Instance.new("ObjectValue",targhum)
- temphitval.Name = ("hit " .. plr.Name)
- game:GetService("Debris"):AddItem(temphitval,.6)
- if targhum.Health > 0 then
- targhum:TakeDamage(damage)
- end
- if 0 >= targhum.Health then
- local tempkillval = Instance.new("ObjectValue",targhum)
- tempkillval.Name = "killer"
- tempkillval.Value = plr
- Ragdoll(targchar,false,true,true)
- end
- hitsound.TimePosition = 0.3
- hitsound.PlaybackSpeed = math.random(10,11)/10
- hitsound:Play()
- elseif not CheckIfAlive() then
- --[[tool.Parent = workspace]]
- end
- end
- function attack()
- swingsound.PlaybackSpeed = math.random(95,105)/100
- swingsound.SoundId = 'rbxassetid://' .. swings[math.random(1,#swings)]
- swingsound:play()
- animval = animval + 1
- if animval > #anims then animval = 1 end
- animation.AnimationId = "rbxassetid://" .. anims[animval]
- swinganim = hum:LoadAnimation(animation)
- if animval == 1 then
- swinganim:Play(.05,1,1.5) -- front swing
- elseif animval == 2 then
- tool.Grip = CFrame.new(2.29999948, 0.0200000294, 0.029999923, -1, 8.74227766e-08, 0, -8.74227766e-08, -1, 0, 0, 0, 1)
- swinganim:Play(.04,1,1.7) -- left swing
- elseif animval == 3 then
- --tool.Grip = CFrame.new(-0.0644850433, -0.192117706, 1.77630055, 4.37113883e-08, 1, -4.37113847e-08, -1, 4.37113883e-08, 4.37113918e-08, 4.37113918e-08, 4.37113847e-08, 1)
- swinganim:Play(.04,1,1.5) -- right swing
- end
- end
- function CheckIfAlive()
- local alive = false
- if (plr and plr.Parent and char and char.Parent and hum and hum.Parent and hum.Health > 0 and torso and torso.Parent) then
- alive = true
- end
- return alive
- end
- function Activated()
- if (10 >= stamina) or attacking or equipping or not CheckIfAlive() then return end
- attacking = true
- stamina = stamina - 10
- stamina_counter = 1
- attack()
- damaging = true
- Trail.Enabled = true
- wait(.6)
- damaging = false
- tool.Grip = CFrame.new(2.29999948, 0.0200000294, 0.029999923, -4.37113883e-08, -1, 0, 1, -4.37113883e-08, 0, 0, 0, 1)
- hum.WalkSpeed = 16
- Trail.Enabled = false
- attacking = false
- end
- function create_gui(p)
- local screen = Instance.new("ScreenGui")
- local Frame1 = Instance.new("Frame")
- local Frame2 = Instance.new("Frame")
- local staminabar = Instance.new("Frame")
- local staminastat = Instance.new("TextBox")
- local TextLabel5 = Instance.new("TextLabel")
- local Frame6 = Instance.new("Frame")
- local healthbar = Instance.new("Frame")
- local TextLabel8 = Instance.new("TextLabel")
- local healthstat = Instance.new("TextBox")
- local Frame10 = Instance.new("Frame")
- local blockbar = Instance.new("Frame")
- local blockstat = Instance.new("TextBox")
- local TextLabel13 = Instance.new("TextLabel")
- screen.Parent = p
- screen.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame1.Parent = screen
- Frame1.Size = UDim2.new(1, 0, 1, 0)
- Frame1.BackgroundColor = BrickColor.new("Institutional white")
- Frame1.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame1.BackgroundTransparency = 1
- Frame2.Name = "Stamina"
- Frame2.Parent = Frame1
- Frame2.Position = UDim2.new(0.317999989, 0, 0.899393916, 0)
- Frame2.Size = UDim2.new(0.331917137, 0, 0.0316969417, 0)
- Frame2.BackgroundColor = BrickColor.new("Tr. Flu. Blue")
- Frame2.BackgroundColor3 = Color3.new(0.858824, 0.737255, 1)
- staminabar.Name = "bar"
- staminabar.Parent = Frame2
- staminabar.Size = UDim2.new(1, 0, 1, 0)
- staminabar.BackgroundColor = BrickColor.new("Fire Yellow")
- staminabar.BackgroundColor3 = Color3.new(1, 0.941177, 0.27451)
- staminastat.Name = "stat"
- staminastat.Parent = Frame2
- staminastat.Position = UDim2.new(0.325197548, 0, 0, 0)
- staminastat.Size = UDim2.new(0.5, 0, 1, 0)
- staminastat.BackgroundColor = BrickColor.new("Institutional white")
- staminastat.BackgroundColor3 = Color3.new(1, 1, 1)
- staminastat.BackgroundTransparency = 1
- staminastat.ZIndex = 3
- staminastat.Font = Enum.Font.SourceSans
- staminastat.FontSize = Enum.FontSize.Size24
- staminastat.Text = tostring(math.floor(stamina)) .. "/" .. tostring(math.floor(staminamax))
- staminastat.TextColor = BrickColor.new("Institutional white")
- staminastat.TextColor3 = Color3.new(1, 1, 1)
- staminastat.TextSize = 20
- staminastat.TextStrokeTransparency = 0
- staminastat.TextWrap = true
- staminastat.TextWrapped = true
- TextLabel5.Name = "title"
- TextLabel5.Parent = Frame2
- TextLabel5.Position = UDim2.new(0.172155678, 0, 0, 0)
- TextLabel5.Size = UDim2.new(0.5, 0, 1, 0)
- TextLabel5.BackgroundColor = BrickColor.new("Institutional white")
- TextLabel5.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel5.BackgroundTransparency = 1
- TextLabel5.ZIndex = 3
- TextLabel5.Font = Enum.Font.SourceSans
- TextLabel5.FontSize = Enum.FontSize.Size24
- TextLabel5.Text = "Stamina:"
- TextLabel5.TextColor = BrickColor.new("Institutional white")
- TextLabel5.TextColor3 = Color3.new(1, 1, 1)
- TextLabel5.TextSize = 20
- TextLabel5.TextStrokeTransparency = 0
- TextLabel5.TextWrap = true
- TextLabel5.TextWrapped = true
- Frame6.Name = "Health"
- Frame6.Parent = Frame1
- Frame6.Position = UDim2.new(0.317578763, 0, 0.859090745, 0)
- Frame6.Size = UDim2.new(0.332338333, 0, 0.0316969417, 0)
- Frame6.BackgroundColor = BrickColor.new("Persimmon")
- Frame6.BackgroundColor3 = Color3.new(1, 0.25098, 0.262745)
- healthbar.Name = "bar"
- healthbar.Parent = Frame6
- healthbar.Size = UDim2.new(1, 0, 1, 0)
- healthbar.BackgroundColor = BrickColor.new("Bright green")
- healthbar.BackgroundColor3 = Color3.new(0.286275, 1, 0.235294)
- TextLabel8.Name = "title"
- TextLabel8.Parent = Frame6
- TextLabel8.Position = UDim2.new(0.172155678, 0, 0, 0)
- TextLabel8.Size = UDim2.new(0.5, 0, 1, 0)
- TextLabel8.BackgroundColor = BrickColor.new("Institutional white")
- TextLabel8.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel8.BackgroundTransparency = 1
- TextLabel8.ZIndex = 3
- TextLabel8.Font = Enum.Font.SourceSans
- TextLabel8.FontSize = Enum.FontSize.Size24
- TextLabel8.Text = "Health:"
- TextLabel8.TextColor = BrickColor.new("Institutional white")
- TextLabel8.TextColor3 = Color3.new(1, 1, 1)
- TextLabel8.TextSize = 20
- TextLabel8.TextStrokeTransparency = 0
- TextLabel8.TextWrap = true
- TextLabel8.TextWrapped = true
- healthstat.Name = "stat"
- healthstat.Parent = Frame6
- healthstat.Position = UDim2.new(0.325197548, 0, 0, 0)
- healthstat.Size = UDim2.new(0.5, 0, 1, 0)
- healthstat.BackgroundColor = BrickColor.new("Institutional white")
- healthstat.BackgroundColor3 = Color3.new(1, 1, 1)
- healthstat.BackgroundTransparency = 1
- healthstat.ZIndex = 3
- healthstat.Font = Enum.Font.SourceSans
- healthstat.FontSize = Enum.FontSize.Size24
- healthstat.Text = tostring(math.floor(hum.Health)) .. "/" .. tostring(math.floor(hum.MaxHealth))
- healthstat.TextColor = BrickColor.new("Institutional white")
- healthstat.TextColor3 = Color3.new(1, 1, 1)
- healthstat.TextSize = 20
- healthstat.TextStrokeTransparency = 0
- healthstat.TextWrap = true
- healthstat.TextWrapped = true
- Frame10.Name = "Block"
- Frame10.Parent = Frame1
- Frame10.Position = UDim2.new(0.317999989, 0, 0.940303028, 0)
- Frame10.Size = UDim2.new(0.331917137, 0, 0.0316969417, 0)
- Frame10.BackgroundColor = BrickColor.new("Salmon")
- Frame10.BackgroundColor3 = Color3.new(1, 0.647059, 0.619608)
- blockbar.Name = "bar"
- blockbar.Parent = Frame10
- blockbar.Size = UDim2.new(1, 0, 1, 0)
- blockbar.BackgroundColor = BrickColor.new("Carnation pink")
- blockbar.BackgroundColor3 = Color3.new(1, 0.545098, 0.827451)
- blockstat.Name = "stat"
- blockstat.Parent = Frame10
- blockstat.Position = UDim2.new(0.325197548, 0, 0, 0)
- blockstat.Size = UDim2.new(0.5, 0, 1, 0)
- blockstat.BackgroundColor = BrickColor.new("Institutional white")
- blockstat.BackgroundColor3 = Color3.new(1, 1, 1)
- blockstat.BackgroundTransparency = 1
- blockstat.ZIndex = 3
- blockstat.Font = Enum.Font.SourceSans
- blockstat.FontSize = Enum.FontSize.Size24
- blockstat.Text = tostring(math.floor(blockhealth)) .. "/" .. tostring(math.floor(blockhealthmax))
- blockstat.TextColor = BrickColor.new("Institutional white")
- blockstat.TextColor3 = Color3.new(1, 1, 1)
- blockstat.TextSize = 20
- blockstat.TextStrokeTransparency = 0
- blockstat.TextWrap = true
- blockstat.TextWrapped = true
- TextLabel13.Name = "title"
- TextLabel13.Parent = Frame10
- TextLabel13.Position = UDim2.new(0.172155678, 0, 0, 0)
- TextLabel13.Size = UDim2.new(0.5, 0, 1, 0)
- TextLabel13.BackgroundColor = BrickColor.new("Institutional white")
- TextLabel13.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel13.BackgroundTransparency = 1
- TextLabel13.ZIndex = 3
- TextLabel13.Font = Enum.Font.SourceSans
- TextLabel13.FontSize = Enum.FontSize.Size24
- TextLabel13.Text = "Block:"
- TextLabel13.TextColor = BrickColor.new("Institutional white")
- TextLabel13.TextColor3 = Color3.new(1, 1, 1)
- TextLabel13.TextSize = 20
- TextLabel13.TextStrokeTransparency = 0
- TextLabel13.TextWrap = true
- TextLabel13.TextWrapped = true
- return screen,healthbar,healthstat,staminabar,staminastat,blockbar,blockstat
- end
- function update()
- healthstat.Text = tostring(math.floor(hum.Health)) .. "/" .. tostring(math.floor(hum.MaxHealth))
- game:GetService("TweenService"):Create(healthbar,TweenInfo.new(.25),{Size = UDim2.new((hum.Health/hum.MaxHealth), 0, 1, 0)}):Play()
- --
- staminastat.Text = tostring(math.floor(stamina)) .. "/" .. tostring(math.floor(staminamax))
- game:GetService("TweenService"):Create(staminabar,TweenInfo.new(.25),{Size = UDim2.new((stamina/staminamax), 0, 1, 0)}):Play()
- --
- blockstat.Text = tostring(math.floor(blockhealth)) .. "/" .. tostring(math.floor(blockhealthmax))
- game:GetService("TweenService"):Create(blockbar,TweenInfo.new(.25),{Size = UDim2.new((blockhealth/blockhealthmax), 0, 1, 0)}):Play()
- end
- function clash()
- att.Position = Vector3.new(handle.Size.X/(math.random(40,70)/100),0,0)
- spark.Enabled = true
- shock.Enabled = true
- glow.Enabled = true
- spawn(function()
- wait(0.1)
- spark.Enabled = false
- shock.Enabled = false
- glow.Enabled = false
- end)
- blockhealth = blockhealth - 15
- block_counter = 1
- spawn(function()
- local kb = 25
- local b = Instance.new("BodyVelocity")
- b.Parent = rootpart
- b.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- b.Velocity = rootpart.CFrame.LookVector*(kb)*(-1.25) + Vector3.new(0,1,0)
- --swinganim:Stop()
- game:GetService("Debris"):AddItem(b,0.1)
- end)
- end
- function HealthChanged(NewHealth)
- if hum then
- if CheckIfAlive() and (CurrentHealth > hum.Health) and (blockhealth >= 15) then
- if (0 >= cooldown) and not blocking then
- cooldown = 0.6
- blocking = true
- --selection.Visible = true
- end
- if blocking and attacking then
- clash()
- hum.Health = CurrentHealth
- else
- CurrentHealth = hum.Health
- return
- end
- hitsound.TimePosition = 0.3
- hitsound.PlaybackSpeed = math.random(95,105)/100
- hitsound:Play()
- end
- end
- CurrentHealth = hum.Health
- end
- function Equipped()
- char = tool.Parent
- plr = game:GetService("Players"):GetPlayerFromCharacter(char)
- hum = char:FindFirstChildOfClass("Humanoid")
- torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
- swinganim = hum:LoadAnimation(animation)
- idleanim = hum:LoadAnimation(idleanimation)
- equipanim = hum:LoadAnimation(equipanimation)
- screen,healthbar,healthstat,staminabar,staminastat,blockbar,blockstat = create_gui(plr['PlayerGui'])
- if CheckIfAlive() then
- equipping = true
- offsound:Stop()
- humsound:Resume()
- onsound:Play()
- equipanim:Play(.1,.8,2)
- idleanim:Play(.05,1,1.5)
- CurrentHealth = hum.Health
- Connection = hum.HealthChanged:Connect(HealthChanged)
- spawn(function()
- if 0 >= counter then
- counter = 1
- repeat wait(0.1) until (0 >= counter)
- equipping = false
- end
- end)
- else
- tool.Parent = workspace
- end
- end
- function Unequipped()
- hitsound:Stop()
- swingsound:Stop()
- onsound:Stop()
- humsound:Pause()
- offsound:Play()
- idleanim:Stop()
- equipanim:Stop()
- swinganim:Stop()
- Connection:Disconnect()
- if screen then
- screen:Destroy()
- end
- end
- tool.Equipped:Connect(Equipped)
- tool.Unequipped:Connect(Unequipped)
- tool.Activated:Connect(Activated)
- handle.Touched:Connect(blow)
- spawn(function()
- while wait(0.1) and tool and handle do
- if not CheckIfAlive() then --[[tool.Parent = workspace]] return end
- pcall(function()
- if screen then
- update()
- end
- end)
- if counter > 0 then
- counter = counter - 0.1
- elseif 0 > counter then
- counter = 0
- end
- if cooldown > 0 then
- cooldown = cooldown - 0.1
- if resetcooldown >= cooldown then
- blocking = false
- --selection.Visible = false
- end
- elseif 0 > cooldown then
- cooldown = 0
- end
- if stamina_counter > 0 then
- stamina_counter = stamina_counter - 0.1
- elseif 0 > stamina_counter then
- stamina_counter = 0
- end
- if block_counter > 0 then
- block_counter = block_counter - 0.1
- elseif 0 > block_counter then
- block_counter = 0
- end
- end
- end)
- while wait(0.5) do
- if not CheckIfAlive() then --[[tool.Parent = workspace]] return end
- if (0 >= stamina_counter) and (staminamax > stamina) then
- stamina = stamina + 5
- if (stamina > staminamax) then
- stamina = staminamax
- end
- elseif 0 > stamina then
- stamina = 0
- end
- if (0 >= block_counter) and (blockhealthmax > blockhealth) then
- if (0 > blockhealth) then
- blockhealth = 0
- end
- blockhealth = blockhealth + 7
- if (blockhealth > blockhealthmax) then
- blockhealth = blockhealthmax
- end
- elseif (0 > blockhealth) then
- blockhealth = 0
- end
- end
- --end
- --start_saber()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement