Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = Instance.new("Tool",owner.Backpack)
- local handle = Instance.new("Part",tool)
- handle.Name = "Handle"
- tool.Name = "gun"
- handle.Size = Vector3.new(1,1,2)
- handle.BrickColor = BrickColor.new("Fossil")
- handle.Material = "Metal"
- handle.Reflectance = 0.5
- handle.Anchored = false
- local clik = Instance.new("Sound",handle)
- clik.SoundId = "rbxasset://sounds//paintball.wav"
- local clunk = Instance.new("Sound",handle)
- clunk.SoundId = "rbxassetid://9113568235"
- local hit = Instance.new("Sound",handle)
- hit.SoundId = "rbxassetid://9113963768"
- function touch(part)
- --clunk:Play()
- part.Color = grenade.Color
- if part.Parent.Humanoid then
- hit:Play()
- part.Parent.Humanoid:TakeDamage(7)
- end
- wait(1)
- grenade:Destroy()
- end
- function launch()
- clik:Play()
- grenade = Instance.new("Part",workspace)
- grenade.Size = Vector3.new(1,1,1)
- grenade.Shape = "Ball"
- grenade.BrickColor = BrickColor.Random()
- grenade.CanCollide = true
- grenade.Anchored = false
- local spawnPosition = (handle.CFrame * CFrame.new(0, 0, -5)).p
- grenade.CFrame = CFrame.new(spawnPosition) --NOTE: This must be done before assigning Parent
- grenade.Velocity = tool.Parent.Head.CFrame.lookVector * 64
- Instance.new('BodyForce', grenade).Force = Vector3.new(0, grenade:GetMass() * (workspace.Gravity * .88), 0)
- grenade.Touched:Connect(touch)
- end
- tool.Activated:Connect(launch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement