I am trying to make a grenade tool in Roblox but I am having trouble getting the part to shoot where I am facing. How do I fix this? Also it would be good if it was all in 1 script.
Here is my code:
local t = Instance.new("Tool" ,owner.Backpack)
local p = Instance.new("Part" ,t)
p.Name = "Handle"
p.Size = Vector3.new(1.5,1.5,1.5)
p.Anchored = false
t.Name = "Grenade"
t.ToolTip = "The thing you are holding isn't a grenade, but what you shoot out is."
t.GripPos = Vector3.new(0,0,1)
t.Activated:Connect(function()
local g = Instance.new("Part", workspace)
g.Position = p.Position
g.Anchored = false
g.Size = Vector3.new(1,1,1)
g:ApplyImpulse(Vector3.new(0,0,50))
end)
I tried changing the orientation but that didn’t seem to work.