Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local char = player.Character
- local barrel = tool:WaitForChild("Barel")
- local attachment0 = Instance.new("Attachment",barrel)
- attachment0.Name = 'Attachment0'
- local shot = tool.Barel.Fire
- wait()
- local beam = Instance.new("Beam",workspace)
- beam.Attachment0 = attachment0
- beam.Width0 = 0.2
- beam.Width1 = 0.2
- beam.Color = ColorSequence.new(Color3.fromRGB(200, 200, 60))
- canShoot = true
- tool.Equipped:Connect(function()
- local animation = Instance.new("Animation")
- animation.AnimationId = 'rbxassetid://1457042677'
- ting = player.Character.Humanoid:LoadAnimation(animation)
- ting:Play()
- tool.Activated:Connect(function()
- if canShoot then
- canShoot = false
- if mouse.Target.Name == 'Head' then
- if mouse.Target.Parent:FindFirstChild("Humanoid") then
- local person = mouse.Target.Parent
- person.Humanoid:TakeDamage(40)
- end
- end
- if mouse.Target.Name == 'Torso' or mouse.Target.Name == 'HumanoidRootPart' then
- if mouse.Target.Parent:FindFirstChild("Humanoid") then
- local person = mouse.Target.Parent
- person.Humanoid:TakeDamage(30)
- end
- end
- if mouse.Target.Name == 'Left Arm' or mouse.Target.Name == 'Right Arm' or mouse.Target.Name == 'Right Leg' or mouse.Target.Name == 'Left Leg' then
- if mouse.Target.Parent:FindFirstChild("Humanoid") then
- local person = mouse.Target.Parent
- person.Humanoid:TakeDamage(20)
- end
- end
- local fire = Instance.new("Animation")
- fire.AnimationId = 'rbxassetid://1457187786'
- local recoil = player.Character.Humanoid:LoadAnimation(fire)
- recoil:Play()
- print(mouse.Target.Name)
- shot:Play()
- local marker = Instance.new("Part",workspace)
- marker.CanCollide = false
- marker.Anchored = true
- marker.Transparency = 1
- marker.Size =Vector3.new(0.05,0.05,0.05)
- marker.Position = mouse.Hit.p
- local attachment1 = Instance.new("Attachment",marker)
- beam.Attachment1 = attachment1
- wait()
- marker:Destroy()
- wait(0.5)
- canShoot = true
- end
- end)
- end)
- tool.Unequipped:Connect(function()
- ting:Stop()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement