Hello, I've been trying to make a grenade tool for a while and the problem I've been running into is that the grenade only goes forward because it comes out of a part inside to tool. I was wondering if I could modify this script to make the grenade go where you're looking at.
local ReplicatedStorage = game.ReplicatedStorage local Grenade = ReplicatedStorage:WaitForChild('US_Grenade') local Muzzle = script.Parent:WaitForChild('Muzzle') local VGrenade1 = script.Parent:WaitForChild('base') local VGrenade2 = script.Parent:WaitForChild('head') local VGrenade3 = script.Parent:WaitForChild('leaver') local VGrenade4 = script.Parent:WaitForChild('pin') local VGrenade5 = script.Parent:WaitForChild('ring') Space = game.Workspace local NewGrenade = Grenade:Clone() script.Parent.Activated:Connect(function() wait(1.04) NewGrenade.Parent = Space NewGrenade.CFrame = Muzzle.CFrame NewGrenade.Velocity = Muzzle.CFrame.lookVector * 92 game:GetService('Debris'):AddItem(NewGrenade,49) wait(0.1) script.Parent.Script:Destroy() VGrenade1.Transparency = 1 VGrenade2.Transparency = 1 VGrenade3.Transparency = 1 VGrenade4.Transparency = 1 VGrenade5.Transparency = 1 end)
Extra Info:
Example of what I'm thinking of: If you look down the grenade gets thrown down.
Script Type: Normal Script
ObjectType ~ the grenade: Meshpart not inside a model.
Replace line 16 with
NewGrenade.Velocity = game.Workspace.CurrentCamera.CFrame.LookVector * 92
if you wanna do with where the mouse is looking at then
NewGrenade.Velocity = Mouse.Hit.LookVector * 92