Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rayblacklist = {}
- local partta = {}
- local sizes = {}
- local sound = Instance.new("Sound")
- sound.Volume = 1
- sound.SoundId = "rbxassetid://6988979548"
- sound.PlayOnRemove = true
- tool = Instance.new("Tool",owner.Character)
- part = Instance.new("Part",tool)
- part.Name = "Handle"
- local texture = Instance.new("Texture",part)
- texture.Face = "Front"
- texture.StudsPerTileU=2
- texture.StudsPerTileV=1
- texture.OffsetStudsU=0
- texture.Texture = "rbxassetid://9110401157"
- part.Size = Vector3.new(1,1,1)
- part2 = Instance.new("Part",part)
- part2.Size = Vector3.new(1,0.25,0.25)
- tank = Instance.new("Part",owner.Character)
- tank.Size = Vector3.new(1,0.125,1)
- tank2 = Instance.new("Part",owner.Character)
- tank2.Size = Vector3.new(1.25,0.125,1.25)
- tank3 = Instance.new("Part",owner.Character)
- tank3.Size = Vector3.new(1.25,0.125,1.25)
- tank4 = Instance.new("Part",owner.Character)
- tank4.Size = Vector3.new(1.125,1.5,1.125)
- tank4.Transparency = 0.65
- tank.Material = "Sand"
- tank2.Material = "SmoothPlastic"
- tank3.Material = "SmoothPlastic"
- tank4.Material = "SmoothPlastic"
- local weld = Instance.new("Weld",part)
- weld.Part0 = part2
- weld.Part1 = part
- weld.C0 = CFrame.new(-1,-0.25,0)
- local weld2 = Instance.new("Weld",owner.Character.Torso)
- weld2.Part0 = tank
- weld2.Part1 = owner.Character.Torso
- weld2.C0 = CFrame.new(0,0.45,-1.125)
- local weld3 = Instance.new("Weld",owner.Character.Torso)
- weld3.Part0 = tank2
- weld3.Part1 = owner.Character.Torso
- weld3.C0 = CFrame.new(0,-1,-1.125)
- local weld4 = Instance.new("Weld",owner.Character.Torso)
- weld4.Part0 = tank3
- weld4.Part1 = owner.Character.Torso
- weld4.C0 = CFrame.new(0,0.5,-1.125)
- local weld5 = Instance.new("Weld",owner.Character.Torso)
- weld5.Part0 = tank4
- weld5.Part1 = owner.Character.Torso
- weld5.C0 = CFrame.new(0,-0.25,-1.125)
- tool.Grip = CFrame.new(1.25,0,0)
- local on = false
- ammotake = false
- tool.Activated:Connect(function()
- on = true
- delay(0.25,function()
- if on then
- ammotake = true
- else
- if partta[#partta] then
- if partta[#partta - 1] then
- tank.Color = partta[#partta - 1].Color
- end
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.0625
- local object = tank
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.Size = Vector3.new(1,object.Size.Y - 0.025,1)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local timeToFade = 0.0625
- local object = weld2
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = object.C0 * CFrame.new(0,0.015,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- texture.OffsetStudsU=1
- local donthit = {}
- partta[#partta].Parent = script
- partta[#partta].CFrame = part.CFrame
- partta[#partta].Anchored = false
- game:GetService("Debris"):AddItem(partta[#partta],20)
- table.insert(rayblacklist,partta[#partta])
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.0625
- local object = partta[#partta]
- local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
- local goal = {}
- goal.CFrame = part.CFrame * CFrame.new(0,partta[#partta].Size.Y,-partta[#partta].Size.Z + -10)
- goal.Size = sizes[#partta]
- goal.Transparency = 0
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- local cf = part.CFrame
- local v = partta[#partta]
- v.CanTouch = false
- coroutine.wrap(function()
- tween.Completed:Wait()
- texture.OffsetStudsU=0
- v:ApplyImpulse(cf.LookVector * v:GetMass() * 250 + Vector3.new(0,v:GetMass() * workspace.Gravity * 0.25,0))
- v.CanTouch = true
- v.CanCollide = true
- local hitplayers = {}
- partta[#partta].Touched:Connect(function(hit)
- local hum = hit.Parent:FindFirstChildWhichIsA("Humanoid") or hit.Parent.Parent:FindFirstChildWhichIsA("Humanoid")
- if hum and not table.find(hitplayers,hum) then
- table.insert(hitplayers,hum)
- hum.Health -= 5 * v.Size.Magnitude
- end
- end)
- end)()
- sizes[#partta] = nil
- partta[#partta] = nil
- end
- end
- end)
- end)
- tool.Deactivated:Connect(function()
- on = false
- ammotake = false
- texture.OffsetStudsU=0
- end)
- coroutine.wrap(function()
- while wait(0.0325) do
- if on and not ammotake then
- texture.OffsetStudsU=1
- sound.Parent = part
- sound.PlaybackSpeed = 1
- sound.SoundId = "rbxassetid://6717089252"
- sound.Parent = nil
- for i = 1, 9 do
- wait(0.0125)
- local bul = Instance.new("SpawnLocation",script)
- bul.Enabled = false
- game:GetService("Debris"):AddItem(bul,0.125)
- bul.Anchored = true
- table.insert(rayblacklist,bul)
- bul.CFrame = part.CFrame * CFrame.new(Random.new():NextNumber(-1,1),Random.new():NextNumber(-1,1),-1)
- local x,y,z = CFrame.new(part.Position,bul.Position):ToEulerAnglesXYZ()
- bul.CFrame = CFrame.new(bul.Position) * CFrame.Angles(x,y,z)
- bul.Size = Vector3.new(0.1,0.1,0.5)
- bul.CanCollide = false
- bul.Material = "Neon"
- bul.Transparency = 0.125
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.125
- local object = bul
- local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
- local goal = {}
- goal.CFrame = bul.CFrame * CFrame.new(0,0,math.random(-12,-8))
- goal.Size = Vector3.new(0.05,0.05,1)
- goal.Transparency = 1
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- end
- elseif on and ammotake then
- sound.Parent = part
- sound.PlaybackSpeed = 1.5
- sound.SoundId = "rbxassetid://6988979548"
- sound.Parent = nil
- texture.OffsetStudsU=1
- local bul = Instance.new("SpawnLocation",script)
- bul.Enabled = false
- game:GetService("Debris"):AddItem(bul,0.125)
- bul.Anchored = true
- table.insert(rayblacklist,bul)
- bul.CFrame = part.CFrame * CFrame.new(Random.new():NextNumber(-1,1),Random.new():NextNumber(-1,1),-1)
- local x,y,z = CFrame.new(part.Position,bul.Position):ToEulerAnglesXYZ()
- bul.CFrame = CFrame.new(bul.Position) * CFrame.Angles(x,y,z) * CFrame.new(0,0,math.random(-12,-8))
- bul.Size = Vector3.new(0.1,0.1,0.5)
- bul.CanCollide = false
- bul.Material = "Neon"
- bul.Transparency = 1
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.125
- local object = bul
- local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
- local goal = {}
- goal.CFrame = bul.CFrame * CFrame.new(0,0,(part.Position - bul.Position).Magnitude)
- goal.Size = Vector3.new(0.05,0.05,1)
- goal.Transparency = 0.125
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- end
- end
- end)()
- while task.wait() do
- if ammotake then
- ang = CFrame.Angles(0,0,math.pi * 2 * math.random()) * CFrame.Angles(math.random() * math.rad(30),0,0)
- dir = part.Position
- dir = (CFrame.new(dir,part.Position + part.CFrame.lookVector * 20) * ang).lookVector
- local params = RaycastParams.new()
- params.FilterDescendantsInstances = {rayblacklist}
- params.FilterType = Enum.RaycastFilterType.Blacklist
- local result = workspace:Raycast(part.Position, dir * 10, params)
- if result and not table.find(partta,result.Instance) and result.Instance.Name ~= "Base" and #partta < 50 then
- local what = result.Instance
- if what.Size.X < 25 then
- if what.Size.Y < 25 then
- if what.Size.Z < 25 then
- table.insert(partta,result.Instance)
- result.Instance.CanCollide = false
- result.Instance.Anchored = true
- table.insert(sizes,result.Instance.Size)
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.0625
- local object = tank
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.Size = Vector3.new(1,object.Size.Y + 0.025,1)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- tank.Color = what.Color
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.0625
- local object = weld2
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.C0 = object.C0 * CFrame.new(0,-0.015,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- what:BreakJoints()
- local tweenService = game:GetService("TweenService")
- local timeToFade = 0.125
- local object = result.Instance
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.CFrame = part.CFrame
- goal.Size = result.Instance.Size * 0.25
- goal.Transparency = 1
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- tween.Completed:Wait()
- result.Instance.Parent = nil
- end
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment