Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----Sherrif gun Version 8.1 A very OP weapon made by narfh---
- [[-- Updates:
- New raycasting effects
- Fire effect is now realistic
- More OP
- Ragdoll on death
- Music sounds
- Ammo!
- Awesome fade
- --]]
- local maxammo = 60
- local ammo = 60
- player = game.Players.LocalPlayer
- Character = player.Character
- Head = Character.Head
- Torso = Character.Torso
- RightArm = Character["Right Arm"]
- local Sounds = {
- Bang = Instance.new("Sound"),
- Hit = Instance.new("Sound"),
- click = Instance.new("Sound"),
- Dead = Instance.new("Sound")
- }
- Sounds["Dead"].SoundId = "rbxassetid://1089403"
- Sounds["Dead"].Volume = 10
- Sounds["Bang"].SoundId = "rbxassetid://31173863"
- Sounds["Bang"].Volume = 10
- Sounds["Hit"].SoundId = "rbxassetid://31173771"
- Sounds["Hit"].Volume = 0.5
- Sounds["click"].SoundId = "rbxassetid://156286438"
- Sounds["click"].Volume = 5
- function PlaySound(soundname, pitch)
- Sounds[soundname].Parent = Character.Torso
- Sounds[soundname].Pitch = pitch
- Sounds[soundname]:Play()
- local oldsound = Sounds[soundname]
- coroutine.resume(coroutine.create(function()
- wait(4)
- oldsound:Destroy()
- end))
- Sounds[soundname] = Sounds[soundname]:clone()
- end
- it=Instance.new
- function weld(parent,part0,part1,c0)
- local weld = it("Weld")
- weld.Parent = parent
- weld.Part0 = part0
- weld.Part1 = part1
- weld.C0 = c0
- return weld
- end
- function ragJoint(hit,r,d)
- d = d or 0
- local rpar,r0,r1 = r.Parent,r.Part0,r.Part1
- if d > 0 then wait(d) end
- local p = hit:Clone()
- p:BreakJoints()
- p:ClearAllChildren()
- p.FormFactor = "Custom"
- p.Size = p.Size/2
- p.Transparency = 1
- p.CanCollide = true
- p.Name = "Colliduh"
- p.Parent = hit
- local w = Instance.new("Weld",p)
- w.Part0 = hit
- w.Part1 = p
- w.C0 = CFrame.new(0,-p.Size.Y/2,0)
- local rot = Instance.new("Rotate",rpar)
- rot.Name = r.Name
- rot.Part0 = r0
- rot.Part1 = r1
- rot.C0 = r.C0
- rot.C1 = r.C1
- r0.Velocity = Vector3.new()
- r1.Velocity = Vector3.new()
- r:Destroy()
- end
- local tool2 = game:GetService("InsertService"):LoadAsset(97885508):GetChildren()[1]
- tool2.Parent = player.Backpack
- tool2.Firescript:Remove()
- tool2.Script:Remove()
- tool2.LocalScript:Remove()
- tool2.Name = "Bang"
- tool2.ToolTip = "1 shot KO'd"
- local collided = false
- Handle = tool2.Handle
- local gui = Instance.new("BillboardGui",player.PlayerGui)
- gui.Size = UDim2.new(0,25,0,25)
- gui.AlwaysOnTop = true
- local mid = {"http://www.roblox.com/asset/?id=85561125","http://www.roblox.com/asset/?id=85561640","http://www.roblox.com/asset/?id=85561157","http://www.roblox.com/asset/?id=85643448","http://www.roblox.com/asset/?id=49092825","http://www.roblox.com/asset/?id=36527138"}
- Handle = tool2.Handle
- function wrongP()
- vDebounce = false
- end
- GuiMain=Instance.new("ScreenGui")
- Radar=Instance.new("Frame")
- GuiMain.Parent=player.PlayerGui
- Radar.Parent=GuiMain
- Radar.Size=UDim2.new(3,0,3,0)
- Radar.Position=UDim2.new(0,0,-0.1,0)
- Radar.BackgroundTransparency=1
- Radar.BackgroundColor=BrickColor.new("Institutional white")
- Radar.Name="HealthScreen"
- function FadeIn()
- for i=1,0,-0.05 do
- Radar.BackgroundTransparency=i
- wait(0.15)
- end
- end
- tool2.Equipped:connect(function(mouse)
- --store the character of the person using the tool
- player = tool2
- mouse.Button1Down:connect(function()
- --make and do a hit test along the ray
- local ray = Ray.new(tool2.Handle.CFrame.p, (mouse.Hit.p - tool2.Handle.CFrame.p).unit*1000)
- local hit, position = game.Workspace:FindPartOnRay(ray, player)
- if Character == nil then return end
- if ammo == 0 then PlaySound("click", 1) print'press r!' vDebounce = false return end
- PlaySound("Bang", math.random(75,125)/100 )
- ammo = ammo - 1
- wait(0.4)
- local animation2 = Instance.new("Animation")
- animation2.Name = "reloading"
- animation2.AnimationId = "http://www.roblox.com/asset/?id=97884303"
- local animTrack2 = Character.Humanoid:LoadAnimation(animation2)
- animTrack2:Play()
- local wa = Instance.new("Part",player)
- wa.Transparency = 1
- wa.CanCollide = false
- wa.Size = Vector3.new(1, 1, 1)
- wa:BreakJoints()
- local Weld3 = Instance.new("Weld",wa)
- Weld3.Part0 = Handle
- Weld3.Part1 = wa
- Weld3.C0 = CFrame.new(0, 0, -2) * CFrame.Angles(0, 0, 0)
- local light1=Instance.new("PointLight")
- light1.Brightness=50
- light1.Color=Color3.new(255,255,0)
- light1.Range=10
- light1.Parent=Handle
- vDebounce = false
- for i = 1,3 do wait()
- local p = Instance.new("Part",workspace)
- p.FormFactor="Custom"
- p.Size=Vector3.new(1,1,1)
- p.TopSurface = 0
- p.BottomSurface = 0
- local colorc = {"Bright yellow","Deep orange","Gold","New Yeller"}
- local Fire = BrickColor.new(colorc[math.random(1, #colorc)])
- p.BrickColor = Fire
- p.CanCollide=false
- p.Anchored=true
- p.CFrame =(Handle.CFrame*CFrame.new(0,0.5,-1.3))*CFrame.Angles(math.random(-3,3),math.random(-3,3),math.random(-3,3))
- light1:remove()
- game.Debris:AddItem(p,.1)
- end
- wait(0.165)
- local ray = Ray.new(tool2.Handle.CFrame.p, (mouse.Hit.p - tool2.Handle.CFrame.p).unit*1000)
- hit, position = game.Workspace:FindPartOnRay(ray, player)
- local ray = Ray.new(Handle.CFrame.p, (mouse.Hit.p - Handle.CFrame.p).unit*300)
- local position = mouse.Hit.p--game.Workspace:FindPartOnRay(ray, walrus)
- local distance = (position - Handle.CFrame.p).magnitude
- rp=Instance.new("Part",workspace)
- rp.Anchored=true
- rp.TopSurface="Smooth"
- rp.BottomSurface="Smooth"
- rp.Transparency=0.45
- local colors = {"Dark stone grey","Medium stone grey","Mid gray","Institutional white","Pearl","Ghost grey","Fosil","Smoky grey"}
- local Pew = BrickColor.new(colors[math.random(1, #colors)])
- rp.BrickColor= Pew
- rp.FormFactor="Custom"
- rp.CanCollide=false
- rp.Size=Vector3.new(0.1,0.1,distance)
- rp.Material = "Neon"
- rp.CFrame=CFrame.new(position, Handle.CFrame.p) * CFrame.new(0, 0, -distance/2)
- local cy=Instance.new("BlockMesh",rp)
- rp.Touched:connect(function(hit)
- if hit.Parent.Name == Character.Name then return wrongP() end
- local Char = hit.Parent
- if hit.Name:match("Torso") then
- PlaySound("Hit", 1 )
- for i,v in pairs(Char:GetChildren()) do
- local r = Char.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
- if v:IsA("BasePart") and r then
- ragJoint(v,r,.1)
- elseif v:IsA("Humanoid") then
- v.PlatformStand = true
- v.Changed:connect(function()
- v.PlatformStand = true
- end)
- end
- end
- Delay(10,function()
- Char:BreakJoints()
- end)
- end
- if hit.Name:match("Head") then
- PlaySound("Hit", 1 )
- for i,v in pairs(Char:GetChildren()) do
- local r = Char.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
- if v:IsA("BasePart") and r then
- ragJoint(v,r,.1)
- elseif v:IsA("Humanoid") then
- v.PlatformStand = true
- v.Changed:connect(function()
- v.PlatformStand = true
- end)
- end
- end
- Delay(3,function()
- Char:BreakJoints()
- end)
- end
- if hit.Name:match("Left Arm") then
- PlaySound("Hit", 1 )
- for i,v in pairs(Char:GetChildren()) do
- local r = Char.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
- if v:IsA("BasePart") and r then
- ragJoint(v,r,.1)
- elseif v:IsA("Humanoid") then
- v.PlatformStand = true
- v.Changed:connect(function()
- v.PlatformStand = true
- end)
- end
- end
- Delay(20,function()
- Char:BreakJoints()
- end)
- end
- if hit.Name:match("Right Arm") then
- PlaySound("Hit", 1 )
- for i,v in pairs(Char:GetChildren()) do
- local r = Char.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
- if v:IsA("BasePart") and r then
- ragJoint(v,r,.1)
- elseif v:IsA("Humanoid") then
- v.PlatformStand = true
- v.Changed:connect(function()
- v.PlatformStand = true
- end)
- end
- end
- Delay(20,function()
- Char:BreakJoints()
- end)
- end
- if hit.Name:match("Left Leg") then
- PlaySound("Hit", 1 )
- for i,v in pairs(Char:GetChildren()) do
- local r = Char.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
- if v:IsA("BasePart") and r then
- ragJoint(v,r,.1)
- elseif v:IsA("Humanoid") then
- v.PlatformStand = true
- v.Changed:connect(function()
- v.PlatformStand = true
- end)
- end
- end
- Delay(15,function()
- Char:BreakJoints()
- end)
- end
- if hit.Name:match("Right leg") then
- PlaySound("Hit", 1 )
- for i,v in pairs(Char:GetChildren()) do
- local r = Char.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
- if v:IsA("BasePart") and r then
- ragJoint(v,r,.1)
- elseif v:IsA("Humanoid") then
- v.PlatformStand = true
- v.Changed:connect(function()
- v.PlatformStand = true
- end)
- end
- end
- Delay(15,function()
- Char:BreakJoints()
- end)
- end
- end)
- for i=1,10 do
- wait()
- cy.Scale=cy.Scale-Vector3.new(0.1,0.1,0)
- end
- rp:Destroy()
- print'Ammo consumed'
- end)
- end)
- function reload()
- if (not vDebounce) then
- vDebounce = true
- local wa = Instance.new("Part",player)
- wa.Transparency = 1
- wa.CanCollide = false
- wa.Size = Vector3.new(1, 1, 1)
- wa:BreakJoints()
- local Weld3 = Instance.new("Weld",wa)
- Weld3.Part0 = Handle
- Weld3.Part1 = wa
- Weld3.C0 = CFrame.new(0, 0, -2) * CFrame.Angles(0, 0, 0)
- local animation = Instance.new("Animation")
- animation.Name = "reloading"
- animation.AnimationId = "http://www.roblox.com/asset/?id=97885754"
- local animTrack = Character.Humanoid:LoadAnimation(animation)
- animTrack:Play()
- for i = 1,60 do wait()
- local p = Instance.new("Part",workspace)
- p.FormFactor="Custom"
- p.Size=Vector3.new(0.5,0.5,0.5)
- p.TopSurface = 0
- p.BottomSurface = 0
- local colors = {"Dark stone grey","Medium stone grey","Mid gray","Institutional white","Pearl","Ghost grey","Fosil","Smoky grey"}
- local SmokeEffect = BrickColor.new(colors[math.random(1, #colors)])
- p.BrickColor = SmokeEffect
- p.Transparency=.3
- p.CanCollide=false
- p.Anchored=true
- p.CFrame =(Handle.CFrame*CFrame.new(0,0.5,-1.3))*CFrame.Angles(math.random(-3,3),math.random(-3,3),math.random(-3,3))
- game.Debris:AddItem(p,.1)
- vDebounce = true
- ammo = maxammo
- end
- end
- end
- local Sounds = {
- Dead = Instance.new("Sound")
- }
- Sounds["Dead"].SoundId = "http://www.roblox.com/asset/?id=1353080451"
- Sounds["Dead"].Volume = 1
- function PliySound(soundname, pitch)
- Sounds[soundname].Parent = Character.Torso
- Sounds[soundname].Pitch = pitch
- Sounds[soundname]:Play()
- local oldsound = Sounds[soundname]
- coroutine.resume(coroutine.create(function()
- wait(4)
- oldsound:Destroy()
- end))
- Sounds[soundname] = Sounds[soundname]:clone()
- end
- local Humanoid = player.Character.Humanoid
- function OnDeath()
- print("x_x dead")
- PliySound("Dead", 1)
- end
- Humanoid.Died:connect(OnDeath)
- function use()
- PlaySound("Dead", 1)
- local animation = Instance.new("Animation")
- animation.Name = "reloading"
- animation.AnimationId = "http://www.roblox.com/asset/?id=97884040"
- pew = Character.Humanoid:LoadAnimation(animation)
- pew:Play()
- end
- function unuse()
- pew:Stop()
- end
- tool2.Equipped:connect(use)
- tool2.Unequipped:connect(unuse)
- Humanoid = Character.Humanoid
- Torso = Character.Torso
- function OnDeath()
- print("Death")
- mode = Instance.new("Model")
- mode.Name = ""
- mode.Parent = Workspace
- wait(0.005)
- Humanoid.Parent = nil
- if Torso then
- zam=Torso:Clone()
- zam.Parent=mode
- zam.Elasticity = 0
- zam.Friction = 1
- x=Character:GetChildren()
- for i=1,#x do
- if ((x[i].Name=="Shirt") or (x[i].Name=="Pants") or (x[i].className=="CharacterMesh") or (x[i].className=="Hat") or (x[i].className=="Decal") or (x[i].className=="ShirtGraphic") or (x[i].className=="Model")) then
- local zor=x[i]:Clone()
- zor.Parent=mode
- end
- if x[i].Name=="Head" then
- local zem=x[i]:Clone()
- zem.Parent=mode
- zem.Name="Head"
- zem.Elasticity = 0
- zem.Friction = 1
- local Neck = Instance.new("Weld")
- Neck.Name = "Neck"
- Neck.Part0 = zam
- Neck.Part1 = zem
- Neck.C0 = CFrame.new(0, 1.5, 0)
- Neck.C1 = CFrame.new()
- Neck.Parent = zam
- end
- if x[i].Name=="Right Arm" then
- local Limb=x[i]:Clone()
- Limb.Parent=mode
- Limb.CFrame = zam.CFrame * CFrame.new(1.5, 0, 0)
- Limb.Elasticity = 0
- Limb.Friction = 1
- local Joint = Instance.new("Rotate")
- Joint.Name = "RightShoulder"
- Joint.Part0 = zam
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = zam
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.Elasticity = 0
- B.Friction = 1
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = mode
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- if x[i].Name=="Left Arm" then
- local Limb=x[i]:Clone()
- Limb.Parent=mode
- Limb.CFrame = zam.CFrame * CFrame.new(-1.5, 0, 0)
- Limb.Elasticity = 0
- Limb.Friction = 1
- local Joint = Instance.new("Rotate")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = zam
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = zam
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.Elasticity = 0
- B.Friction = 1
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = mode
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- if x[i].Name=="Right Leg" then
- local Limb=x[i]:Clone()
- Limb.Parent=mode
- Limb.CFrame = zam.CFrame * CFrame.new(0.5, -2, 0)
- Limb.Elasticity = 0
- Limb.Friction = 1
- local Joint = Instance.new("Rotate")
- Joint.Name = "RightHip"
- Joint.Part0 = zam
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = zam
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.Elasticity = 0
- B.Friction = 1
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = mode
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- if x[i].Name=="Left Leg" then
- local Limb=x[i]:Clone()
- Limb.Parent=mode
- Limb.CFrame = zam.CFrame * CFrame.new(-0.5, -2, 0)
- Limb.Elasticity = 0
- Limb.Friction = 1
- local Joint = Instance.new("Rotate")
- Joint.Name = "LeftHip"
- Joint.Part0 = zam
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = zam
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.Elasticity = 0
- B.Friction = 1
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = mode
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- bland=Instance.new("Humanoid")
- bland.Health=0
- bland.MaxHealth = 0
- bland.Parent=mode
- bland.Parent.Head.face.Texture = "http://www.roblox.com/asset/?id=145952218"
- if ((x[i].Name=="Shirt") or (x[i].Name=="Pants") or (x[i].className=="CharacterMesh")or (x[i].className=="Hat")or (x[i].className=="Decal")or (x[i].className=="ShirtGraphic")) then
- local zor=x[i]:Clone()
- zor.Parent=mode
- end
- --[
- local Bar = Instance.new("Part")
- Bar.TopSurface = 0
- Bar.BottomSurface = 0
- Bar.Elasticity = 0
- Bar.Friction = 1
- Bar.formFactor = "Symmetric"
- Bar.Size = Vector3.new(1, 1, 1)
- Bar.Transparency = 1
- Bar.CFrame = zam.CFrame * CFrame.new(0, 0.5, 0)
- Bar.Parent = mode
- local Weld = Instance.new("Weld")
- Weld.Part0 = zam
- Weld.Part1 = Bar
- Weld.C0 = CFrame.new(0, 0.5, 0)
- Weld.Parent = zam
- --]]
- end
- end
- wait()
- Character:remove()
- wait(5)
- mode:FindFirstChild("Head").Anchored = false
- mode:FindFirstChild("Left Arm").Anchored = false
- mode:FindFirstChild("Left Leg").Anchored = false
- mode:FindFirstChild("Right Arm").Anchored = false
- mode:FindFirstChild("Right Leg").Anchored = false
- mode:FindFirstChild("Torso").Anchored = false
- mode:FindFirstChild("Head").Velocity = Vector3.new(0,0,0)
- mode:FindFirstChild("Left Arm").Velocity = Vector3.new(0,0,0)
- mode:FindFirstChild("Left Leg").Velocity = Vector3.new(0,0,0)
- mode:FindFirstChild("Right Arm").Velocity = Vector3.new(0,0,0)
- mode:FindFirstChild("Right Leg").Velocity = Vector3.new(0,0,0)
- mode:FindFirstChild("Torso").Velocity = Vector3.new(0,0,0)
- wait(10)
- mode:remove()
- FadeIn()
- end
- Humanoid.Died:connect(OnDeath)
- tool2.Equipped:connect(function(mouse)
- mouse.KeyDown:connect(function(key)
- if key == "r" then
- reload()
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement