Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local char = owner.Character
- local tool = Instance.new("Tool")
- local holding = false
- local db = false
- local remote = Instance.new("RemoteEvent")
- remote.Name = "Shoot"
- remote.Parent = tool
- tool.Parent = owner.Backpack
- tool.Name = "Tommy Gun"
- tool.Grip = CFrame.new(0,-.6,.5)
- local sound = Instance.new("Sound")
- local particle = Instance.new("ParticleEmitter")
- local handle = Instance.new("Part")
- handle.Name = "Handle"
- handle.Parent = tool
- local att = Instance.new("Attachment")
- att.Parent = handle
- att.Position = Vector3.new(0,.18,-2)
- sound.Parent = att
- sound.Volume = 0.5
- sound.SoundId = "rbxassetid://5238024665"
- particle.Parent = att
- particle.Texture = "rbxassetid://7924475328"
- particle.Enabled = true
- particle.Size = NumberSequence.new(1)
- particle.Lifetime = NumberRange.new(1)
- particle.Transparency = NumberSequence.new(0)
- particle.Speed = NumberRange.new(0)
- particle.Shape = Enum.ParticleEmitterShape.Box
- particle.EmissionDirection = Enum.NormalId.Front
- particle.Color = ColorSequence.new(BrickColor.new("Gold").Color)
- particle.LightEmission = 1
- particle.LightInfluence = 1
- particle.LockedToPart = true
- particle.Drag = 0
- particle.VelocitySpread = NumberRange.new(0, 0)
- particle.VelocityInheritance = 0
- particle.Acceleration = Vector3.new(0, 0, 0)
- particle.SpreadAngle = Vector2.new(0, 0)
- particle.ZOffset = 2
- particle.Rotation = NumberRange.new(0, 360)
- particle.RotSpeed = NumberRange.new(0)
- particle.Rate = 100
- local mesh = Instance.new("SpecialMesh")
- mesh.Parent = handle
- mesh.Scale = Vector3.new(0.9,0.9,0.9)
- mesh.MeshId = "http://www.roblox.com/asset/?id=116679805"
- mesh.TextureId = "http://www.roblox.com/asset/?id=116679995"
- NLS([[
- local char = owner.Character
- local tool = script.Parent
- local event = tool.Shoot
- local mouse = game.Players.LocalPlayer:GetMouse()
- tool.Activated:Connect(function()
- holding = true
- end)
- tool.Deactivated:Connect(function()
- holding = false
- end)
- spawn(function()
- while wait() do
- if holding then
- if not db then
- db = true
- print("shoot")
- event:FireServer(mouse.Hit.Position)
- wait(.1)
- db = false
- end
- end
- end
- end)
- ]],tool)
- remote.OnServerEvent:Connect(function(player,pos)
- local beam = Instance.new("Part")
- beam.Parent = char
- beam.Anchored = true
- beam.CanCollide = false
- beam.CFrame = CFrame.new(att.WorldPosition,pos) * CFrame.new(0, 0, -(att.WorldPosition-pos).Magnitude / 2)
- beam.Size = Vector3.new(.1,.1,(att.WorldPosition-pos).Magnitude)
- beam.BrickColor = BrickColor.new("Gold")
- beam.Material = Enum.Material.Neon
- local params = OverlapParams.new()
- params.FilterDescendantsInstances = {char}
- params.FilterType = Enum.RaycastFilterType.Blacklist
- sound:Play()
- particle:Emit(100)
- local parts = workspace:GetPartBoundsInBox(CFrame.new(pos),Vector3.new(.2,.2,.2),params)
- for i,v in pairs(parts) do
- if v.Parent then
- if v:FindFirstAncestorOfClass("Model") then
- local pchar = v:FindFirstAncestorOfClass("Model")
- if pchar:FindFirstChild("Humanoid") then
- pchar.Humanoid:TakeDamage(5)
- end
- end
- end
- end
- spawn(function()
- for i = 1,10,1 do
- beam.Transparency += 0.1
- wait(0.025)
- end
- beam:Destroy()
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement