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"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Sound3 = Instance.new("Sound")
- LocalScript4 = Instance.new("LocalScript")
- Tool5 = Instance.new("Tool")
- Script6 = Instance.new("Script")
- Part7 = Instance.new("Part")
- SpecialMesh8 = Instance.new("SpecialMesh")
- Sound9 = Instance.new("Sound")
- Sound10 = Instance.new("Sound")
- Sound11 = Instance.new("Sound")
- Sound12 = Instance.new("Sound")
- Sound13 = Instance.new("Sound")
- Sound14 = Instance.new("Sound")
- Sound15 = Instance.new("Sound")
- Sound16 = Instance.new("Sound")
- Sound17 = Instance.new("Sound")
- Sound18 = Instance.new("Sound")
- Sound19 = Instance.new("Sound")
- Sound20 = Instance.new("Sound")
- Sound21 = Instance.new("Sound")
- Sound22 = Instance.new("Sound")
- Sound23 = Instance.new("Sound")
- Sound24 = Instance.new("Sound")
- Sound25 = Instance.new("Sound")
- Sound26 = Instance.new("Sound")
- LocalScript27 = Instance.new("LocalScript")
- Tool28 = Instance.new("Tool")
- LocalScript29 = Instance.new("LocalScript")
- Part30 = Instance.new("Part")
- Tool31 = Instance.new("Tool")
- Part32 = Instance.new("Part")
- SpecialMesh33 = Instance.new("SpecialMesh")
- Sound34 = Instance.new("Sound")
- Sound35 = Instance.new("Sound")
- PointLight36 = Instance.new("PointLight")
- LocalScript37 = Instance.new("LocalScript")
- Sound38 = Instance.new("Sound")
- LocalScript39 = Instance.new("LocalScript")
- Script40 = Instance.new("Script")
- Tool41 = Instance.new("Tool")
- BoolValue42 = Instance.new("BoolValue")
- BoolValue43 = Instance.new("BoolValue")
- BoolValue44 = Instance.new("BoolValue")
- LocalScript45 = Instance.new("LocalScript")
- LocalScript46 = Instance.new("LocalScript")
- Part47 = Instance.new("Part")
- SpecialMesh48 = Instance.new("SpecialMesh")
- Sound49 = Instance.new("Sound")
- Sound50 = Instance.new("Sound")
- Sound51 = Instance.new("Sound")
- Sound52 = Instance.new("Sound")
- Sound53 = Instance.new("Sound")
- Animation54 = Instance.new("Animation")
- Animation55 = Instance.new("Animation")
- Animation56 = Instance.new("Animation")
- Animation57 = Instance.new("Animation")
- Animation58 = Instance.new("Animation")
- Script59 = Instance.new("Script")
- Animation60 = Instance.new("Animation")
- Tool0.Name = "BoomboxGearThree"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=192488987 "
- Tool0.GripForward = Vector3.new(1, -0, -0)
- Tool0.GripPos = Vector3.new(1, -1.25, 0)
- Tool0.GripRight = Vector3.new(0, 0, 1)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.CanCollide = false
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.Size = Vector3.new(3.20000005, 1.60000002, 1.20000005)
- Part1.CFrame = CFrame.new(11.29, 0.800014019, -0.0900000036, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = Vector3.new(11.29, 0.800014019, -0.0900000036)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=192488915 "
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=192488947 "
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- Sound3.Parent = Part1
- Sound3.Volume = 1
- Sound3.Looped = true
- LocalScript4.Name = "Client"
- LocalScript4.Parent = Tool0
- table.insert(cors,sandbox(LocalScript4,function()
- wait(1)
- local Tool = script.Parent
- local songgui
- Sound = Tool.Handle:FindFirstChild("Sound")
- local Player = game:GetService("Players").LocalPlayer
- local Mouse = Player:GetMouse()
- Tool.Unequipped:connect(function()
- if songgui then
- songgui:Destroy()
- end
- Sound:Stop()
- end)
- Tool.Equipped:connect(function()
- if Player.PlayerGui:FindFirstChild("ChooseSongGui") then return end
- local sg = Instance.new("ScreenGui")
- sg.Name = "ChooseSongGui"
- local frame = Instance.new("Frame")
- frame.Style = "RobloxRound"
- frame.Size = UDim2.new(0.25, 0, 0.25, 0)
- frame.Position = UDim2.new((1-frame.Size.X.Scale)/2, 0, (1-frame.Size.Y.Scale)/2, 0)
- frame.Parent = sg
- frame.Draggable = true
- local text = Instance.new("TextLabel")
- text.BackgroundTransparency = 1
- text.TextStrokeTransparency = 0
- text.TextColor3 = Color3.new(1, 1, 1)
- text.Size = UDim2.new(1, 0, 0.6, 0)
- text.TextScaled = true
- text.Text = "Lay down the beat!\nPut in the ID number for a song you love that's been uploaded to ROBLOX.\nLeave it blank to stop playing music."
- text.Parent = frame
- local input = Instance.new("TextBox")
- input.BackgroundColor3 = Color3.new(0, 0, 0)
- input.BackgroundTransparency = 0.5
- input.BorderColor3 = Color3.new(1, 1, 1)
- input.TextColor3 = Color3.new(1, 1, 1)
- input.TextStrokeTransparency = 1
- input.TextScaled = true
- input.Text = "142376088"
- input.Size = UDim2.new(1, 0, 0.2, 0)
- input.Position = UDim2.new(0, 0, 0.6, 0)
- input.Parent = frame
- local button = Instance.new("TextButton")
- button.Style = "RobloxButton"
- button.Size = UDim2.new(0.75, 0, 0.2, 0)
- button.Position = UDim2.new(0.125, 0, 0.8, 0)
- button.TextColor3 = Color3.new(1, 1, 1)
- button.TextStrokeTransparency = 0
- button.Text = "Play!"
- button.TextScaled = true
- button.Parent = frame
- button.MouseButton1Click:connect(function()
- if Sound then
- Sound:Stop()
- end
- Sound.Parent = Tool.Handle
- Sound.Volume = 4
- Sound.EmitterSize = 14
- Sound.Looped = true
- Sound.PlayOnRemove = false
- Sound.SoundId = "http://www.roblox.com/asset/?id="..input.Text
- Sound:Play()
- sg:Destroy()
- end)
- sg.Parent = Player.PlayerGui
- songgui = sg
- end)
- --connect
- end))
- Tool5.Name = "Darkheart"
- Tool5.Parent = mas
- Tool5.GripForward = Vector3.new(-1, -0, -0)
- Tool5.GripPos = Vector3.new(0, 0, -1.5)
- Tool5.GripRight = Vector3.new(0, 1, 0)
- Tool5.GripUp = Vector3.new(0, 0, 1)
- Script6.Name = "SwordScript"
- Script6.Parent = Tool5
- table.insert(cors,sandbox(Script6,function()
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 7
- local slash_damage = 16
- local lunge_damage = 22
- 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 LungeSound = Instance.new("Sound")
- LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
- LungeSound.Parent = sword
- LungeSound.Volume = .6
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function DarkKill(character, humanoid, attacker)
- if (character:FindFirstChild("ForceField") ~= nil) then return end
- local childs = character:GetChildren()
- local colors = {}
- tagHumanoid(humanoid, attacker)
- humanoid.Health = 0
- for i=1,#childs do
- if (childs[i].className == "Part") then
- colors[i] = childs[i].BrickColor
- childs[i].BrickColor = BrickColor.new(26)
- childs[i].CanCollide = true
- childs[i].Anchored = true
- end
- end
- wait(.25)
- for i=1,#childs do
- if (childs[i].className == "Part") then
- local b = Instance.new("BodyVelocity")
- b.velocity = Vector3.new(math.random() - .5, 0, math.random() - .5).unit * 80
- b.maxForce = Vector3.new(1e5,1e5,1e5)
- b.Parent = childs[i]
- end
- end
- for i=1,#childs do
- if (childs[i].className == "Part") then
- childs[i].Anchored = false
- end
- end
- end
- 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
- -- 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
- hum.Health = hum.Health + (damage * .3)
- if humanoid.Health > damage then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- else
- DarkKill(humanoid.Parent, humanoid, vPlayer)
- end
- end
- end
- 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 lunge()
- damage = lunge_damage
- LungeSound: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) --Tool.Parent.Torso.CFrame.lookVector * 80
- force.Parent = Tool.Parent.Torso
- wait(.25)
- swordOut()
- wait(.25)
- force.Parent = nil
- wait(.5)
- swordUp()
- damage = slash_damage
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-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()
- if (t - last_attack < .2) then
- lunge()
- else
- attack()
- end
- 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))
- Part7.Name = "Handle"
- Part7.Parent = Tool5
- Part7.BrickColor = BrickColor.new("Dark stone grey")
- Part7.Reflectance = 0.69999998807907
- Part7.Rotation = Vector3.new(90, 0, 0)
- Part7.FormFactor = Enum.FormFactor.Plate
- Part7.Size = Vector3.new(1, 0.800000012, 4)
- Part7.CFrame = CFrame.new(28.0499992, 2.00001407, -7.3000021, 1, 1.21649741e-18, 8.69960326e-19, 8.69961463e-19, -9.53674316e-07, -0.99999994, -1.21649648e-18, 0.99999994, -9.53674316e-07)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Position = Vector3.new(28.0499992, 2.00001407, -7.3000021)
- Part7.Orientation = Vector3.new(89.9799957, 180, 180)
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh8.Parent = Part7
- SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=12221720"
- SpecialMesh8.Scale = Vector3.new(0.800000012, 0.800000012, 1)
- SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=12224218"
- SpecialMesh8.VertexColor = Vector3.new(0, 0, 0)
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- SpecialMesh8.Scale = Vector3.new(0.800000012, 0.800000012, 1)
- Sound9.Parent = Part7
- Sound9.SoundId = "rbxasset://sounds/swordslash.wav"
- Sound9.Volume = 0.69999998807907
- Sound10.Parent = Part7
- Sound10.SoundId = "rbxasset://sounds/swordlunge.wav"
- Sound10.Volume = 0.60000002384186
- Sound11.Parent = Part7
- Sound11.SoundId = "rbxasset://sounds/unsheath.wav"
- Sound11.Volume = 1
- Sound12.Parent = Part7
- Sound12.SoundId = "rbxasset://sounds/swordslash.wav"
- Sound12.Volume = 0.69999998807907
- Sound13.Parent = Part7
- Sound13.SoundId = "rbxasset://sounds/swordlunge.wav"
- Sound13.Volume = 0.60000002384186
- Sound14.Parent = Part7
- Sound14.SoundId = "rbxasset://sounds/unsheath.wav"
- Sound14.Volume = 1
- Sound15.Parent = Part7
- Sound15.SoundId = "rbxasset://sounds/swordslash.wav"
- Sound15.Volume = 0.69999998807907
- Sound16.Parent = Part7
- Sound16.SoundId = "rbxasset://sounds/swordlunge.wav"
- Sound16.Volume = 0.60000002384186
- Sound17.Parent = Part7
- Sound17.SoundId = "rbxasset://sounds/unsheath.wav"
- Sound17.Volume = 1
- Sound18.Parent = Part7
- Sound18.SoundId = "rbxasset://sounds/swordslash.wav"
- Sound18.Volume = 0.69999998807907
- Sound19.Parent = Part7
- Sound19.SoundId = "rbxasset://sounds/swordlunge.wav"
- Sound19.Volume = 0.60000002384186
- Sound20.Parent = Part7
- Sound20.SoundId = "rbxasset://sounds/unsheath.wav"
- Sound20.Volume = 1
- Sound21.Parent = Part7
- Sound21.SoundId = "rbxasset://sounds/swordslash.wav"
- Sound21.Volume = 0.69999998807907
- Sound22.Parent = Part7
- Sound22.SoundId = "rbxasset://sounds/swordlunge.wav"
- Sound22.Volume = 0.60000002384186
- Sound23.Parent = Part7
- Sound23.SoundId = "rbxasset://sounds/unsheath.wav"
- Sound23.Volume = 1
- Sound24.Parent = Part7
- Sound24.SoundId = "rbxasset://sounds/swordslash.wav"
- Sound24.Volume = 0.69999998807907
- Sound25.Parent = Part7
- Sound25.SoundId = "rbxasset://sounds/swordlunge.wav"
- Sound25.Volume = 0.60000002384186
- Sound26.Parent = Part7
- Sound26.SoundId = "rbxasset://sounds/unsheath.wav"
- Sound26.Volume = 1
- LocalScript27.Name = "Local Gui"
- LocalScript27.Parent = Tool5
- Tool28.Name = "Handcuffs"
- Tool28.Parent = mas
- Tool28.GripForward = Vector3.new(-0, -0, 1)
- Tool28.GripRight = Vector3.new(0, 1, 0)
- Tool28.GripUp = Vector3.new(1, 0, 0)
- LocalScript29.Parent = Tool28
- table.insert(cors,sandbox(LocalScript29,function()
- script.Parent.Equipped:connect(function(m)
- m.Button1Down:connect(function()
- if m.Target~=nil then
- print(m.Target:GetFullName())
- p=nil
- _,p=pcall(function() return game.Players[m.Target.Parent.Name] end)
- print(p)
- print(m.Target.Parent.Name)
- if p~=nil then
- local detained=p
- coroutine.wrap(function()
- local c=p
- while p==c do wait() pcall(function()
- p.Character.Torso.Anchored,p.Character.Torso.CFrame=true,game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,0,-2.5)
- end) end
- print('END OF DETAIN LOOP')
- pcall(function() c.Character.Torso.Anchored=false end)
- end)()
- else print('no p') end
- end
- end)
- end)
- end))
- Part30.Name = "Handle"
- Part30.Parent = Tool28
- Part30.Size = Vector3.new(0.960001051, 1, 0.940000176)
- Part30.CFrame = CFrame.new(-31.9100113, 0.500003994, 5.30000114, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part30.BottomSurface = Enum.SurfaceType.Smooth
- Part30.TopSurface = Enum.SurfaceType.Smooth
- Part30.Position = Vector3.new(-31.9100113, 0.500003994, 5.30000114)
- Tool31.Name = "LaserGun"
- Tool31.Parent = mas
- Tool31.TextureId = "http://www.roblox.com/asset?id=130093050"
- Tool31.GripPos = Vector3.new(0, -0.100000001, 0.75)
- Tool31.CanBeDropped = false
- Part32.Name = "Handle"
- Part32.Parent = Tool31
- Part32.Rotation = Vector3.new(-180, 0, -180)
- Part32.CanCollide = false
- Part32.FormFactor = Enum.FormFactor.Custom
- Part32.Size = Vector3.new(0.580000222, 1.34000099, 2.48000145)
- Part32.CFrame = CFrame.new(32.1100006, 0.670002997, 6.46999979, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part32.BottomSurface = Enum.SurfaceType.Smooth
- Part32.TopSurface = Enum.SurfaceType.Smooth
- Part32.Position = Vector3.new(32.1100006, 0.670002997, 6.46999979)
- Part32.Orientation = Vector3.new(0, 180, 0)
- SpecialMesh33.Parent = Part32
- SpecialMesh33.MeshId = "http://www.roblox.com/asset?id=130099641"
- SpecialMesh33.Scale = Vector3.new(0.649999976, 0.649999976, 0.649999976)
- SpecialMesh33.TextureId = "http://www.roblox.com/asset/?id=130267361"
- SpecialMesh33.MeshType = Enum.MeshType.FileMesh
- SpecialMesh33.Scale = Vector3.new(0.649999976, 0.649999976, 0.649999976)
- Sound34.Name = "Fire"
- Sound34.Parent = Part32
- Sound34.Pitch = 1.2000000476837
- Sound34.SoundId = "http://www.roblox.com/asset?id=114488148"
- Sound34.Volume = 1
- Sound35.Name = "Reload"
- Sound35.Parent = Part32
- Sound35.Pitch = 0.5
- Sound35.SoundId = "http://www.roblox.com/asset?id=94255248"
- PointLight36.Parent = Part32
- PointLight36.Color = Color3.new(1, 0, 0)
- PointLight36.Brightness = 4
- PointLight36.Range = 6
- PointLight36.Color = Color3.new(1, 0, 0)
- LocalScript37.Name = "ToolScript"
- LocalScript37.Parent = Tool31
- table.insert(cors,sandbox(LocalScript37,function()
- -----------------
- --| Constants |--
- -----------------
- local SHOT_SPEED = 100
- local SHOT_TIME = 1000
- local NOZZLE_OFFSET = Vector3.new(0, 0.4, -1.1)
- -----------------
- --| Variables |--
- -----------------
- local PlayersService = Game:GetService('Players')
- local DebrisService = Game:GetService('Debris')
- local Tool = script.Parent
- local Handle = Tool:WaitForChild('Handle')
- local FireSound = Handle:WaitForChild('Fire')
- local ReloadSound = Handle:WaitForChild('Reload')
- local HitFadeSound = script:WaitForChild('HitFade')
- local PointLight = Handle:WaitForChild('PointLight')
- local Character = nil
- local Humanoid = nil
- local Player = nil
- local BaseShot = nil
- -----------------
- --| Functions |--
- -----------------
- -- Returns a character ancestor and its Humanoid, or nil
- local function FindCharacterAncestor(subject)
- if subject and subject ~= Workspace then
- local humanoid = subject:FindFirstChild('Humanoid')
- if humanoid then
- return subject, humanoid
- else
- return FindCharacterAncestor(subject.Parent)
- end
- end
- return nil
- end
- -- Removes any old creator tags and applies new ones to the specified target
- local function ApplyTags(target)
- while target:FindFirstChild('creator') do
- target.creator:Destroy()
- end
- local creatorTag = Instance.new('ObjectValue')
- creatorTag.Value = Player
- creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
- local iconTag = Instance.new('StringValue')
- iconTag.Value = Tool.TextureId
- iconTag.Name = 'icon'
- iconTag.Parent = creatorTag
- creatorTag.Parent = target
- DebrisService:AddItem(creatorTag, 4)
- end
- -- Returns all objects under instance with Transparency
- local function GetTransparentsRecursive(instance, partsTable)
- local partsTable = partsTable or {}
- for _, child in pairs(instance:GetChildren()) do
- if child:IsA('BasePart') or child:IsA('Decal') then
- table.insert(partsTable, child)
- end
- GetTransparentsRecursive(child, partsTable)
- end
- return partsTable
- end
- local function SelectionBoxify(instance)
- local selectionBox = Instance.new('SelectionBox')
- selectionBox.Adornee = instance
- selectionBox.Color = BrickColor.new('Really red')
- selectionBox.Parent = instance
- return selectionBox
- end
- local function Light(instance)
- local light = PointLight:Clone()
- light.Range = light.Range + 2
- light.Parent = instance
- end
- local function FadeOutObjects(objectsWithTransparency, fadeIncrement)
- repeat
- local lastObject = nil
- for _, object in pairs(objectsWithTransparency) do
- object.Transparency = object.Transparency + fadeIncrement
- lastObject = object
- end
- wait()
- until lastObject.Transparency >= 1 or not lastObject
- end
- local function Dematerialize(character, humanoid, firstPart)
- humanoid.WalkSpeed = 0
- local parts = {}
- for _, child in pairs(character:GetChildren()) do
- if child:IsA('BasePart') then
- child.Anchored = true
- table.insert(parts, child)
- elseif child:IsA('LocalScript') or child:IsA('Script') then
- child:Destroy()
- end
- end
- local selectionBoxes = {}
- local firstSelectionBox = SelectionBoxify(firstPart)
- Light(firstPart)
- wait(0.05)
- for _, part in pairs(parts) do
- if part ~= firstPart then
- table.insert(selectionBoxes, SelectionBoxify(part))
- Light(part)
- end
- end
- local objectsWithTransparency = GetTransparentsRecursive(character)
- FadeOutObjects(objectsWithTransparency, 0.1)
- wait(0.5)
- humanoid.Health = 0
- DebrisService:AddItem(character, 2)
- local fadeIncrement = 0.05
- Delay(0.2, function()
- FadeOutObjects({firstSelectionBox}, fadeIncrement)
- if character then
- character:Destroy()
- end
- end)
- FadeOutObjects(selectionBoxes, fadeIncrement)
- end
- local function OnTouched(shot, otherPart)
- local character, humanoid = FindCharacterAncestor(otherPart)
- if character and humanoid and character ~= Character then
- ApplyTags(humanoid)
- if shot then
- local hitFadeSound = shot:FindFirstChild(HitFadeSound.Name)
- if hitFadeSound then
- hitFadeSound.Parent = humanoid.Torso
- hitFadeSound:Play()
- end
- shot:Destroy()
- end
- Dematerialize(character, humanoid, otherPart)
- end
- end
- local function OnEquipped()
- Character = Tool.Parent
- Humanoid = Character:WaitForChild('Humanoid')
- Player = PlayersService:GetPlayerFromCharacter(Character)
- end
- local function OnActivated()
- if Tool.Enabled and Humanoid.Health > 0 then
- Tool.Enabled = false
- FireSound:Play()
- local handleCFrame = Handle.CFrame
- local firingPoint = handleCFrame.p + handleCFrame:vectorToWorldSpace(NOZZLE_OFFSET)
- local shotCFrame = CFrame.new(firingPoint, Humanoid.TargetPoint)
- local laserShotClone = BaseShot:Clone()
- laserShotClone.CFrame = shotCFrame + (shotCFrame.lookVector * (BaseShot.Size.Z / 2))
- local bodyVelocity = Instance.new('BodyVelocity')
- bodyVelocity.velocity = shotCFrame.lookVector * SHOT_SPEED
- bodyVelocity.Parent = laserShotClone
- laserShotClone.Touched:connect(function(otherPart)
- OnTouched(laserShotClone, otherPart)
- end)
- DebrisService:AddItem(laserShotClone, SHOT_TIME)
- laserShotClone.Parent = Tool
- wait(0) -- FireSound length
- ReloadSound:Play()
- wait(0) -- ReloadSound length
- Tool.Enabled = true
- end
- end
- local function OnUnequipped()
- end
- --------------------
- --| Script Logic |--
- --------------------
- BaseShot = Instance.new('Part')
- BaseShot.Name = 'Effect'
- BaseShot.FormFactor = Enum.FormFactor.Custom
- BaseShot.Size = Vector3.new(0.2, 0.2, 3)
- BaseShot.CanCollide = false
- BaseShot.BrickColor = BrickColor.new('Really red')
- SelectionBoxify(BaseShot)
- Light(BaseShot)
- HitFadeSound:Clone().Parent = BaseShot
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
- Tool.Activated:connect(OnActivated)
- end))
- Sound38.Name = "HitFade"
- Sound38.Parent = LocalScript37
- Sound38.SoundId = "http://www.roblox.com/asset?id=130113415"
- LocalScript39.Name = "MouseIcon"
- LocalScript39.Parent = Tool31
- table.insert(cors,sandbox(LocalScript39,function()
- local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
- local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
- local Tool = script.Parent
- local Mouse = nil
- local function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
- end
- end
- local function OnEquipped(mouse)
- Mouse = mouse
- UpdateIcon()
- end
- local function OnChanged(property)
- if property == 'Enabled' then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- end))
- Script40.Name = "Shu_hold"
- Script40.Parent = Tool31
- table.insert(cors,sandbox(Script40,function()
- --This script gives you a next-gen hold script better than the current one. You actually hold the barrel parallel to your face. Put it in any gun you want. Original script by Xliver101, Converted to universal script by ToastyToaster.
- selected = false
- RSH, LSH = nil, nil
- GRP = nil
- RW, LW = Instance.new("Weld"), Instance.new("Weld")
- anim = "none"
- function WaitForChild(obj, ch_n)
- local t = time()
- while not obj:FindFirstChild(ch_n) and time() - t < 10 do wait(0.1) end
- return obj:FindFirstChild(ch_n)
- end
- script.Parent.Equipped:connect(function()
- if selected then return end
- selected = true
- player = game.Players:playerFromCharacter(script.Parent.Parent)
- local ch = script.Parent.Parent
- WaitForChild(ch, "Torso")
- RSH = WaitForChild(ch.Torso, "Right Shoulder")
- LSH = WaitForChild(ch.Torso, "Left Shoulder")
- GRP = WaitForChild(ch["Right Arm"], "RightGrip")
- _G.Grip = GRP
- --
- RSH.Part1 = nil
- LSH.Part1 = nil
- --
- RW.Part0 = ch.Torso
- RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
- RW.C1 = CFrame.new(0, 0.5, 0)
- RW.Part1 = ch["Right Arm"]
- RW.Parent = ch.Torso
- _G.R = RW
- --
- LW.Part0 = ch.Torso
- LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
- LW.C1 = CFrame.new(0, 0.5, 0)
- LW.Part1 = ch["Left Arm"]
- LW.Parent = ch.Torso
- _G.L = LW
- --
- GRP.C0 = CFrame.new(0, -1, -0.5) * CFrame.fromEulerAnglesXYZ(-1.22, -0.45, 0.22)
- for i = 0, 1, 0.05 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0.25) * CFrame.fromEulerAnglesXYZ(1.3*i, 0, -0.5*i)
- LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7*i, 0, 0.8*i)
- LW.C1 = CFrame.new(0.3*i, 1+1*i, 0)
- end
- wait()
- local rg = (ch["Right Arm"]:FindFirstChild("RightGrip") or GRP)
- if rg ~= GRP then
- GRP.Parent = ch["Right Arm"]
- rg:remove()
- end
- end)
- script.Parent.Unequipped:connect(function()
- selected = false
- local pl = player
- RW.C0 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- LW.C0 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- LW.C1 = CFrame.new(0,0,0)
- RW.Parent = nil
- LW.Parent = nil
- RSH.Part1 = pl.Character["Right Arm"]
- LSH.Part1 = pl.Character["Left Arm"]
- end)
- function armReload()
- for i = 0, 1, 0.1 do
- wait()
- LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.3*i, 0, 0.9*i)
- LW.C1 = CFrame.new(0.3*i, 1+1*i, 0)
- end
- end
- function gunOut()
- for i = 0, 0.3, 0.06 do
- wait()
- GRP.C0 = CFrame.new(0+i, -1-i, 0+(2*i)) * CFrame.fromEulerAnglesXYZ(-2.22, -0.45, 0.42)
- LW.C0 = CFrame.new(-1, 0.5, 0) * CFrame.fromEulerAnglesXYZ(4.2, 0, 2.9)
- LW.C1 = CFrame.new(0.8*i, 1.1+i, -0.3)
- end
- end
- function gunReturn()
- RW.C0 = CFrame.new(1.5, 0.5, 0.25) * CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
- LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
- LW.C1 = CFrame.new(0.3, 1+1, 0)
- GRP.C0 = CFrame.new(0, -1, -0.5) * CFrame.fromEulerAnglesXYZ(-1.22, -0.45, 0.22)
- end
- end))
- Tool41.Name = "Sword"
- Tool41.Parent = mas
- Tool41.TextureId = "http://www.roblox.com/asset/?id=94746192"
- Tool41.GripForward = Vector3.new(1, -0, -0)
- Tool41.GripPos = Vector3.new(0, -1.5, 0)
- Tool41.GripRight = Vector3.new(0, 0, 1)
- Tool41.ToolTip = "Sword"
- Tool41.CanBeDropped = false
- BoolValue42.Name = "PlayOverhead"
- BoolValue42.Parent = Tool41
- BoolValue43.Name = "PlaySlash"
- BoolValue43.Parent = Tool41
- BoolValue44.Name = "PlayThrust"
- BoolValue44.Parent = Tool41
- LocalScript45.Name = "AnimationScript"
- LocalScript45.Parent = Tool41
- table.insert(cors,sandbox(LocalScript45,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))
- LocalScript46.Name = "Local Gui"
- LocalScript46.Parent = Tool41
- table.insert(cors,sandbox(LocalScript46,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))
- Part47.Name = "Handle"
- Part47.Parent = Tool41
- Part47.BrickColor = BrickColor.new("Dark stone grey")
- Part47.Reflectance = 1
- Part47.Rotation = Vector3.new(0, -90, 0)
- Part47.FormFactor = Enum.FormFactor.Custom
- Part47.Size = Vector3.new(0.600000024, 3.60000038, 0.400000036)
- Part47.CFrame = CFrame.new(23.5799007, 1.80000806, 7.10000706, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Part47.BottomSurface = Enum.SurfaceType.Smooth
- Part47.TopSurface = Enum.SurfaceType.Smooth
- Part47.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part47.Position = Vector3.new(23.5799007, 1.80000806, 7.10000706)
- Part47.Orientation = Vector3.new(0, -90, 0)
- Part47.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh48.Parent = Part47
- SpecialMesh48.MeshId = "http://www.roblox.com/asset/?id=94746028"
- SpecialMesh48.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- SpecialMesh48.TextureId = "http://www.roblox.com/asset/?ID=94746105"
- SpecialMesh48.MeshType = Enum.MeshType.FileMesh
- SpecialMesh48.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- Sound49.Name = "SlashSound"
- Sound49.Parent = Part47
- Sound49.SoundId = "rbxasset://sounds//swordslash.wav"
- Sound49.Volume = 0.34999999403954
- Sound50.Name = "OverheadSound"
- Sound50.Parent = Part47
- Sound50.Pitch = 1.1699999570847
- Sound50.SoundId = "rbxasset://sounds//swordslash.wav"
- Sound51.Name = "LungeSound"
- Sound51.Parent = Part47
- Sound51.Pitch = 0.80000001192093
- Sound51.SoundId = "rbxasset://sounds//swordlunge.wav"
- Sound51.Volume = 0.25
- Sound52.Name = "UnsheathSound"
- Sound52.Parent = Part47
- Sound52.Pitch = 1.2999999523163
- Sound52.SoundId = "rbxasset://sounds//unsheath.wav"
- Sound52.Volume = 0.28000000119209
- Sound53.Name = "HitSound"
- Sound53.Parent = Part47
- Sound53.SoundId = "http://www.roblox.com/asset/?id=98220998"
- Animation54.Name = "IdleAnim3"
- Animation54.Parent = Tool41
- Animation54.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
- Animation55.Name = "OverheadAnim2"
- Animation55.Parent = Tool41
- Animation55.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
- Animation56.Name = "SlashAnim2"
- Animation56.Parent = Tool41
- Animation56.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
- Animation57.Name = "ThrustAnim2"
- Animation57.Parent = Tool41
- Animation57.AnimationId = "http://www.roblox.com/Asset?ID=94161333"
- Animation58.Name = "UnequipAnim2"
- Animation58.Parent = Tool41
- Animation58.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
- Script59.Name = "SwordScript"
- Script59.Parent = Tool41
- table.insert(cors,sandbox(Script59,function()
- r = game:service("RunService")
- local damage = 0
- sword = script.Parent.Handle
- Tool = script.Parent
- local damages,values,sounds = {30,45,65},{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))
- Animation60.Name = "EquipAnim5"
- Animation60.Parent = Tool41
- Animation60.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
- 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