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 = "grenade"
- handle.Shape = "Ball"
- handle.Size = Vector3.new(1,1,1)
- handle.BrickColor = BrickColor.new("Sea green")
- handle.Anchored = false
- local boom = Instance.new("Sound",handle)
- boom.SoundId = "rbxassetid://9114840785"
- local clik = Instance.new("Sound",handle)
- clik.SoundId = "rbxassetid://9116545076"
- local clunk = Instance.new("Sound",handle)
- clunk.SoundId = "rbxassetid://9116260154"
- function launch()
- clik:Play()
- local minors = true
- tool.Enabled = false
- local grenade = Instance.new("Part",workspace)
- grenade.Size = Vector3.new(1,1,1)
- grenade.Shape = "Ball"
- grenade.BrickColor = BrickColor.new("Sea green")
- 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, 0)
- grenade.Touched:Connect(function()
- if minors == true then
- clunk:Play()
- minors = false
- wait(.5)
- grenade.Anchored = true
- wait(1.5)
- local exploder = Instance.new("Explosion")
- exploder.Position = grenade.Position
- exploder.Parent = workspace
- boom:Play()
- grenade:Destroy()
- minors = true
- tool.Enabled = true
- end
- end)
- end
- tool.Activated:Connect(launch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement