Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hitsomething = Instance.new("Sound", script)
- hitsomething.PlayOnRemove = true
- hitsomething2 = Instance.new("Sound", script)
- hitsomething2.PlayOnRemove = true
- rayblacklist = {}
- local E = Instance.new("RemoteEvent",owner.Character)
- NLS([[
- local E = owner.Character:FindFirstChildWhichIsA("RemoteEvent")
- local Mouse = owner:GetMouse()
- function ButtonDown()
- E:FireServer(Mouse.Hit)
- end
- Mouse.Button1Down:Connect(ButtonDown)
- ]],owner.PlayerGui)
- tool = Instance.new("Tool",owner.Backpack)
- script = tool
- part = Instance.new("Part",script)
- part.Anchored = true
- part.Shape = "Cylinder"
- part.Size = Vector3.new(2,2,2)
- part2 = Instance.new("Part",script)
- part2.Anchored = true
- part2.Shape = "Cylinder"
- part2.Size = Vector3.new(2,0.55,0.55)
- part2.CFrame = CFrame.new(0.35,-0.925,0.625)
- part3 = Instance.new("Part",script)
- part3.Anchored = true
- part3.Shape = "Cylinder"
- part3.Size = Vector3.new(2,0.5,0.5)
- part3.CFrame = CFrame.new(0.35,1.025,0)
- part4 = Instance.new("Part",script)
- part4.Anchored = true
- part4.Shape = "Cylinder"
- part4.Size = Vector3.new(2,0.55,0.55)
- part4.CFrame = CFrame.new(0.35,-0.925,-0.625)
- part5 = Instance.new("Part",script)
- part5.Anchored = true
- part5.Shape = "Cylinder"
- part5.Size = Vector3.new(2,0.5,0.5)
- part5.CFrame = CFrame.new(0.35,0.425,-1.025)
- part6 = Instance.new("Part",script)
- part6.Anchored = true
- part6.Shape = "Cylinder"
- part6.Size = Vector3.new(2,0.5,0.5)
- part6.CFrame = CFrame.new(0.35,0.425,1.025)
- part7 = Instance.new("Part",script)
- part7.Anchored = true
- part7.Shape = "Cylinder"
- part7.Size = Vector3.new(2,0.45,0.45)
- part7.CFrame = CFrame.new(0,-0.625,0)
- part8 = Instance.new("Part",script)
- part8.Anchored = true
- part8.Shape = "Cylinder"
- part8.Size = Vector3.new(2,0.45,0.45)
- part8.CFrame = CFrame.new(0,-0.2125,0.625)
- part9 = Instance.new("Part",script)
- part9.Anchored = true
- part9.Shape = "Cylinder"
- part9.Size = Vector3.new(2,0.45,0.45)
- part9.CFrame = CFrame.new(0,-0.2125,-0.625)
- part10 = Instance.new("Part",script)
- part10.Anchored = true
- part10.Shape = "Cylinder"
- part10.Size = Vector3.new(2,0.45,0.45)
- part10.CFrame = CFrame.new(0,0.475,0.345)
- part11 = Instance.new("Part",script)
- part11.Anchored = true
- part11.Shape = "Cylinder"
- part11.Size = Vector3.new(2,0.45,0.45)
- part11.CFrame = CFrame.new(0,0.475,-0.345)
- part12 = Instance.new("Part",script)
- part12.Anchored = true
- part12.Shape = "Cylinder"
- part12.Size = Vector3.new(2,0.5,0.5)
- part12.CFrame = CFrame.new(0.5,0,0)
- buls = Instance.new("Part",script)
- buls.Anchored = true
- buls.Shape = "Cylinder"
- buls.Size = Vector3.new(0.75,0.225,0.225)
- buls2 = Instance.new("Part",script)
- buls2.Anchored = true
- buls2.Shape = "Cylinder"
- buls2.Size = Vector3.new(0.01875,0.235,0.235)
- buls2.CFrame = CFrame.new(-0.375,0,0)
- buls3 = Instance.new("Part",script)
- buls3.Anchored = true
- buls3.Shape = "Ball"
- buls3.Size = Vector3.new(0.2225,0.2225,0.2225)
- buls3.CFrame = CFrame.new(0.375,0,0)
- buls3.Color = Color3.fromRGB(235, 213, 19)
- buls.Color = Color3.fromRGB(235, 213, 19)
- buls2.Color = Color3.fromRGB(227, 205, 16)
- trigs = Instance.new("Part",script)
- trigs.Anchored = true
- trigs.Shape = "Cylinder"
- trigs.Size = Vector3.new(0.125,0.5,0.5)
- trigs2 = Instance.new("Part",script)
- trigs2.Anchored = true
- trigs2.Shape = "Cylinder"
- trigs2.Size = Vector3.new(0.5,0.5,0.5)
- trigs2.CFrame = CFrame.new(0,0.025,0.0625)
- trigs3 = Instance.new("Part",script)
- trigs3.Anchored = true
- trigs3.Shape = "Cylinder"
- trigs3.Size = Vector3.new(0.5,0.5,0.5)
- trigs3.CFrame = CFrame.new(0,0.1,0.0625)
- ope = Instance.new("Part",script)
- ope.Anchored = true
- ope.Size = Vector3.new(0.125,0.5,0.225)
- ope2 = Instance.new("Part",script)
- ope2.Anchored = true
- ope2.Size = Vector3.new(0.125,0.225,0.225)
- ope2.Shape = "Cylinder"
- ope2.CFrame = CFrame.new(0,0.25,0)
- ope3 = Instance.new("Part",script)
- ope3.Anchored = true
- ope3.Size = Vector3.new(0.125,0.225,0.225)
- ope3.Shape = "Cylinder"
- ope3.CFrame = CFrame.new(0,-0.25,0)
- local un2 = part:UnionAsync({part12})
- task.wait()
- part:Destroy()
- part12:Destroy()
- un2.Parent = script
- local table3 = {part2,part3,part4,part5,part6,part7,part8,part9,part10,part11}
- local table2 = {part2,part3,part4,part5,part6}
- for i,v in pairs(table2) do
- local par = Instance.new("Part",script)
- par.Anchored = true
- par.Shape = "Ball"
- local siz = v.Size.Y - 0.02125
- par.Size = Vector3.new(siz,siz,siz)
- par.CFrame = v.CFrame * CFrame.new(-1,0,0)
- table.insert(table3,par)
- end
- task.wait()
- local union = un2:SubtractAsync(table3)
- trigr = trigs:SubtractAsync({trigs2,trigs3})
- local bul = buls:UnionAsync({buls2,buls3})
- local opener = ope:UnionAsync({ope2,ope3})
- task.wait()
- buls:Destroy()
- ope:Destroy()
- ope2:Destroy()
- ope3:Destroy()
- trigs:Destroy()
- trigs3:Destroy()
- trigs2:Destroy()
- buls3:Destroy()
- buls2:Destroy()
- for i,v in pairs(table3) do
- v:Destroy()
- end
- un2:Destroy()
- task.wait()
- union.Parent = script
- trigr.Parent = script
- trigr.CFrame = owner.Character.HumanoidRootPart.CFrame
- opener.Parent = script
- opener.Size = Vector3.new(0.09375,0.54,0.165)
- trigr.Size = Vector3.new(0.09375,0.3225,0.2775)
- union.CFrame = owner.Character.Head.CFrame
- opener.CFrame = union.CFrame * CFrame.new(0.35,-0.175,0)
- local wels = Instance.new("Weld",opener)
- wels.Part0 = union
- wels.Part1 = opener
- union.Anchored = false
- wels.C1 = CFrame.new(-0.35,0.175,0)
- local part = Instance.new("Part",script)
- part.Anchored = true
- part.CFrame = opener.CFrame * CFrame.new(-0.625,-0.25,0)
- part.Size = Vector3.new(1,0.0625,0.35)
- local part4 = Instance.new("Part",script)
- part4.Size = Vector3.new(0.5,0.15,0.15)
- local part5 = Instance.new("Part",script)
- part5.Size = Vector3.new(1,0.0625,0.35)
- part4.Shape = "Cylinder"
- gunp = part4
- local wels2 = Instance.new("Weld",part)
- wels2.Part0 = opener
- wels2.Part1 = part
- local wels7 = Instance.new("Weld",part)
- wels7.Part0 = part5
- wels7.Part1 = part
- wels7.C0 = CFrame.new(-0.175,-0.7,0)
- opener.Anchored = false
- wels2.C1 = CFrame.new(0.625,0.25,0)
- local part2 = Instance.new("Part",script)
- part2.Anchored = true
- part2.CFrame = opener.CFrame * CFrame.new(-0.925,0,0)
- part2.Size = Vector3.new(0.45,0.5,0.35)
- local part3 = Instance.new("Part",script)
- part3.Anchored = true
- part3.CFrame = opener.CFrame * CFrame.new(-1.325,-0.25,0) * CFrame.Angles(0,0,math.rad(-15))
- part3.Size = Vector3.new(0.45,0.75,0.25)
- local part6 = Instance.new("Part",script)
- part6.Size = Vector3.new(0.5,0.85,0.225)
- local wels4 = Instance.new("WeldConstraint",part)
- wels4.Part0 = part2
- wels4.Part1 = part
- local wels5 = Instance.new("WeldConstraint",part)
- wels5.Part0 = part3
- wels5.Part1 = part
- local wels7 = Instance.new("Weld",part3)
- wels7.Part0 = part6
- wels7.Part1 = part3
- trigr.CFrame = part2.CFrame * CFrame.new(0,-0.5,0) * CFrame.Angles(0,math.rad(90),0)
- local wels3 = Instance.new("Weld",part2)
- wels3.Part0 = trigr
- wels3.Part1 = part2
- trigr.Anchored = false
- wels3.C1 = CFrame.new(0,-0.25,0) * CFrame.Angles(0,math.rad(90),0)
- wels3.C0 = CFrame.new(0,0.25,0)
- wels.C0 = wels.C0 * CFrame.Angles(math.rad(35),0,0)
- part2.Anchored = false
- for i,v in pairs(tool:GetChildren()) do
- v.Material = "Metal"
- table.insert(rayblacklist,v)
- end
- part3.Material = "Wood"
- part3.Color = Color3.fromRGB(102, 51, 0)
- part6.Material = "Sand"
- part6.Color = Color3.fromRGB(60,60,60)
- part.Anchored = false
- TweenService = game:GetService("TweenService")
- spininfo = TweenInfo.new(0.1125,Enum.EasingStyle.Linear)
- openp = TweenService:Create(wels2,spininfo,{C0 = wels2.C0 * CFrame.new(0,-0.15,0.325) * CFrame.Angles(math.rad(35),0,0)})
- openp2 = TweenService:Create(wels2,spininfo,{C0 = wels2.C0})
- fir = TweenService:Create(wels3,TweenInfo.new(0.0625,Enum.EasingStyle.Linear),{C0 = wels3.C0 * CFrame.Angles(math.rad(-35),0,0)})
- fir2 = TweenService:Create(wels3,TweenInfo.new(0.0625,Enum.EasingStyle.Linear),{C0 = wels3.C0})
- Spin1 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(-120),0,0)})
- Spin2 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(-240),0,0)})
- Spin3 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(-360),0,0)})
- union.Size = Vector3.new(0.625,0.5,0.5)
- task.wait()
- part3.Anchored = false
- part3.Name = "Handle"
- part3.Parent = tool
- tool.Equipped:Wait()
- wait(0.5)
- openp:Play()
- bul.Parent = script
- bul.Size = Vector3.new(0.46125,0.1175,0.1175)
- bul.CFrame = union.CFrame * CFrame.new(-0.5,0.11875,-0.08625)
- local bul2 = bul:Clone()
- bul2.CFrame = union.CFrame * CFrame.new(-0.5,0.11875,0.08625)
- bul2.Parent = script
- local bul3 = bul:Clone()
- bul3.CFrame = union.CFrame * CFrame.new(-0.5,-0.15625,0)
- bul3.Parent = script
- local bul4 = bul:Clone()
- bul4.CFrame = union.CFrame * CFrame.new(-0.5,-0.053125,0.15625)
- bul4.Parent = script
- local bul5 = bul:Clone()
- bul5.CFrame = union.CFrame * CFrame.new(-0.5,-0.053125,-0.15625)
- bul5.Parent = script
- local bullets = {bul,bul2,bul4,bul3,bul5}
- for i,v in pairs(bullets) do
- v.CanCollide = false
- v.Anchored = false
- end
- bwel = Instance.new("Weld",union)
- bwel.Part0 = bul
- bwel.Part1 = union
- bwel.C0 = CFrame.new(-0.5,0.11875,-0.08625):Inverse()
- bwel2 = Instance.new("Weld",union)
- bwel2.Part0 = bul2
- bwel2.Part1 = union
- bwel2.C0 = CFrame.new(-0.5,0.11875,0.08625):Inverse()
- bwel3 = Instance.new("Weld",union)
- bwel3.Part0 = bul3
- bwel3.Part1 = union
- bwel3.C0 = CFrame.new(-0.5,-0.15625,0):Inverse()
- bwel4 = Instance.new("Weld",union)
- bwel4.Part0 = bul4
- bwel4.Part1 = union
- bwel4.C0 = CFrame.new(-0.5,-0.053125,0.15625):Inverse()
- bwel5 = Instance.new("Weld",union)
- bwel5.Part0 = bul5
- bwel5.Part1 = union
- bwel5.C0 = CFrame.new(-0.5,-0.053125,-0.15625):Inverse()
- local wels6 = Instance.new("Weld",part2)
- wels6.Part0 = part4
- wels6.Part1 = part2
- wels6.C0 = CFrame.new(-1.25,-0.3,0)
- trigr.Anchored = false
- function bulweld()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel.C0 * CFrame.new(-0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel2
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel2.C0 * CFrame.new(-0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel3
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel3.C0 * CFrame.new(-0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel4
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel4.C0 * CFrame.new(-0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel5
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel5.C0 * CFrame.new(-0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- end
- function bulweld2()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel.C0 * CFrame.new(0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel2
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel2.C0 * CFrame.new(0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel3
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel3.C0 * CFrame.new(0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel4
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel4.C0 * CFrame.new(0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.5
- local object = bwel5
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = bwel5.C0 * CFrame.new(0.3975,0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- end
- bulweld()
- wait(0.65)
- tool.Grip = CFrame.Angles(0,math.rad(-90),0) * CFrame.Angles(math.rad(15),0,0)
- Spin1:Play()
- local count = 0
- Spin1.Completed:Connect(function()Spin2:Play() end)
- Spin2.Completed:Connect(function()Spin3:Play() end)
- Spin3.Completed:Connect(function() if count ~= 3 then count += 1 Spin1:Play() else count = 0 end end)
- openp2:Play()
- wait(0.5)
- local shots = 0
- canshoot = true
- function reload()
- if canshoot then
- canshoot = false
- openp:Play()
- wait(0.5)
- bulweld2()
- wait(0.5)
- bulweld()
- openp2:Play()
- Spin1 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(120),0,0)})
- Spin2 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(240),0,0)})
- Spin3 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(360),0,0)})
- Spin1.Completed:Connect(function()Spin2:Play() end)
- Spin2.Completed:Connect(function()Spin3:Play() end)
- Spin3.Completed:Connect(function() if count ~= 1 then count += 1 Spin1:Play() else count = 0 end end)
- Spin1:Play()
- shots = 0
- canshoot = true
- end
- end
- function shoot()
- if canshoot then
- task.wait()
- canshoot = false
- fir:Play()
- shots += 1
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.125
- local object = wels
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = wels.C0 * CFrame.Angles(math.rad(72),0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- wait(0.125)
- fir2:Play()
- canshoot = true
- end
- end
- toolout = false
- tool.Equipped:Connect(function() toolout = true end)
- tool.Unequipped:Connect(function() toolout = false end)
- tool.Activated:Connect(shoot)
- prox = Instance.new("ProximityPrompt",tool.Handle)
- prox.Style = Enum.ProximityPromptStyle.Custom
- prox.Enabled = true
- prox.KeyboardKeyCode = Enum.KeyCode.R
- prox.Triggered:Connect(function(player)
- if player == owner then
- reload()
- end
- end)
- E.OnServerEvent:Connect(function(plr,hitp)
- if shots <= 4 and toolout and canshoot then
- hitsomething2.SoundId = "rbxassetid://6150723164"
- hitsomething2.Volume = 1
- hitsomething2.Parent = gunp
- hitsomething2.Parent = nil
- damage = math.random(15,35)
- local bul = Instance.new("SpawnLocation",script)
- bul.Enabled = false
- bul.Anchored = true
- local x,y,z = CFrame.new(gunp.Position,hitp.Position):ToEulerAnglesXYZ()
- bul.CFrame = CFrame.new(gunp.Position + gunp.CFrame.rightVector * 0.5) * CFrame.Angles(x,y,z)
- bul.Size = Vector3.new(0.1,0.1,1)
- bul.CanCollide = false
- bul.Material = "Neon"
- table.insert(rayblacklist,bul)
- local params = RaycastParams.new()
- params.FilterDescendantsInstances = {owner.Character,rayblacklist}
- params.FilterType = Enum.RaycastFilterType.Blacklist
- local result = game.Workspace:Raycast(gunp.Position + gunp.CFrame.rightVector * 0.5, (hitp.Position - gunp.Position).Unit*500,params)
- if not result then
- game:GetService("Debris"):AddItem(bul,5)
- local tweenService = game:GetService("TweenService")
- local timeToFade = 5
- local object = bul
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.CFrame = bul.CFrame * CFrame.new(0,0,-1000)
- goal.Transparency = 1
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- elseif result then
- game:GetService("Debris"):AddItem(bul,0.25)
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.25
- local object = bul
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- local x,y,z = CFrame.new(gunp.Position,hitp.Position):ToEulerAnglesXYZ()
- goal.CFrame = bul.CFrame * CFrame.new(0,0,(bul.Position - result.Position).Magnitude * -2)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local whathit = result.Instance
- local hole = Instance.new("SpawnLocation",workspace)
- hole.Enabled = false
- table.insert(rayblacklist,hole)
- hole.Shape = "Cylinder"
- hole.CanCollide = false
- hole.Size = Vector3.new(0.02,0.35,0.35)
- hole:BreakJoints()
- hole.Position = result.Position
- local currentRightVector = whathit.CFrame.RightVector
- local upVector = result.Normal
- local newFacialVector = currentRightVector:Cross(upVector)
- hole.CFrame = CFrame.fromMatrix(hole.Position, currentRightVector, upVector, newFacialVector) * CFrame.Angles(0,0,math.rad(90))
- if whathit.Anchored == false then
- local holeweld = Instance.new("WeldConstraint",whathit)
- holeweld.Part0 = hole
- holeweld.Part1 = whathit
- elseif whathit.Anchored == true then
- hole.Anchored = true
- end
- if whathit.Material == "Glass" then
- whathit:Destroy()
- end
- local humanoid = whathit.Parent:FindFirstChild("Humanoid") or whathit.Parent.Parent:FindFirstChild("Humanoid")
- hole.Color = Color3.fromRGB()
- local pe = Instance.new("ParticleEmitter", hole)
- pe.Color = ColorSequence.new(whathit.Color)
- pe.LightEmission = 0
- pe.LightInfluence = 1
- pe.EmissionDirection = "Right"
- pe.Orientation = Enum.ParticleOrientation.VelocityParallel
- pe.Size = NumberSequence.new(0.5,0)
- pe.Texture = "rbxassetid://243132757"
- pe.Transparency = NumberSequence.new(0,0.4)
- pe.Lifetime = NumberRange.new(0.15,0.45)
- pe.Rate = 300
- pe.Rotation = NumberRange.new(90)
- pe.RotSpeed = NumberRange.new(0)
- pe.Speed = NumberRange.new(10)
- pe.SpreadAngle = Vector2.new(-15,15)
- pe.Drag = NumberRange.new(1)
- rand = math.random
- pe.Acceleration = Vector3.new(rand(-20,20),-50,rand(-20,20))
- hitsomething.Parent = hole
- local whatsound = math.random(1,3)
- if whatsound == 1 and not humanoid then
- hitsomething.SoundId = "rbxassetid://4427232788"
- hitsomething.Volume = 1
- hitsomething.Parent = nil
- elseif whatsound == 2 and not humanoid then
- hitsomething.SoundId = "rbxassetid://4427234167"
- hitsomething.Volume = 1
- hitsomething.Parent = nil
- elseif whatsound == 3 and not humanoid then
- hitsomething.SoundId = "rbxassetid://4427236368"
- hitsomething.Volume = 1
- hitsomething.Parent = nil
- end
- task.wait()
- if whathit.Name ~= "Head" and humanoid then
- humanoid.Health = humanoid.Health - damage
- elseif whathit.Name == "Head" and humanoid then
- humanoid.Health = 0
- end
- game:GetService("Debris"):AddItem(hole,30)
- if humanoid then
- hitsomething.Parent = hole
- hitsomething.SoundId = "rbxassetid://7441119598"
- hitsomething.Volume = 1
- task.wait()
- hitsomething.Parent = nil
- hole.BrickColor = BrickColor.new("Maroon")
- game:GetService("Debris"):AddItem(pe,10)
- pe.Size = NumberSequence.new(1,0)
- pe.Color = ColorSequence.new(Color3.fromRGB(100,0,0))
- coroutine.wrap(function()
- for i = 1, 20 do
- wait(0.125)
- local bloodpartfloor = Instance.new("SpawnLocation", workspace)
- bloodpartfloor.Enabled = false
- bloodpartfloor.CanCollide = false
- local random2 = math.random(-5,5)
- local random3 = math.random(-5,5)
- bloodpartfloor.Size = Vector3.new(0.005,0.25,0.25)
- bloodpartfloor.CanCollide = false
- bloodpartfloor.Material = "Glass"
- bloodpartfloor.Shape = "Cylinder"
- bloodpartfloor.Anchored = true
- table.insert(rayblacklist,bloodpartfloor)
- local params2 = RaycastParams.new()
- params2.FilterDescendantsInstances = {whathit, owner.Character,rayblacklist}
- params2.FilterType = Enum.RaycastFilterType.Blacklist
- local result2 = workspace:Raycast(whathit.Position + Vector3.new(random2,0,random3), whathit.Position + Vector3.new(random2,-300,random3), params2)
- if result2 then
- bloodpartfloor.Position = result2.Position
- local currentRightVector2 = whathit.CFrame.RightVector
- local upVector2 = result2.Normal
- local newFacialVector2 = currentRightVector2:Cross(upVector2)
- bloodpartfloor.CFrame = CFrame.fromMatrix(bloodpartfloor.Position, currentRightVector2, upVector2, newFacialVector2) * CFrame.Angles(0,0,math.rad(90))
- bloodpartfloor.BrickColor = BrickColor.new("Maroon")
- game:GetService("Debris"):AddItem(bloodpartfloor,25)
- local tweenService = game:GetService("TweenService")
- local timeToFade = 10
- local object = bloodpartfloor
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- local random = math.random(0.25,5)
- goal.Size = Vector3.new(0.05,random,random)
- local grow = tweenService:Create(object, tweenInfo, goal)
- grow:Play()
- end
- end
- end)()
- else
- coroutine.wrap(function()
- game:GetService("Debris"):AddItem(pe,2)
- wait(0.35)
- pe.Enabled = false
- end)()
- end
- end
- elseif shots > 4 and toolout and canshoot then
- hitsomething2.SoundId = "rbxassetid://7432036929"
- hitsomething2.Volume = 1
- hitsomething2.Parent = gunp
- hitsomething2.Parent = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement