that is, if it is facing north, it should go north. I am trying to create a gun that shoots bullets,something too basic, without the need to locate the mouse, just shoot where the nozzle of the gun is pointing and the bullet goes in a straight line being anchored. Like a gun in real life Here is the code so you can understand me better
local tool = script.Parent
local bullet = Instance.new("Part")
bullet.Anchored = true
bullet.Name = "bullet"
bullet.Size = Vector3.new(1,1,1)
local Debris = game:GetService("Debris")
tool.Equipped:Connect(function()
tool["pipupipu's sound"]:Play()
end)
tool.Activated:Connect(function()
local Newball = bullet:Clone()
local exist = true
Newball.CFrame = tool.Disparar.CFrame
Newball.Parent = game.Workspace
Debris:AddItem(Newball, 10)
print(Newball.CFrame.LookVector)
while Newball do
wait(0.5)
Newball.CFrame = CFrame.new(Newball.CFrame.LookVector * 10)
print(Newball.CFrame)
end
end)
