I don’t have any experience in velocity or mouse direction, I tried to do the script myself from base knowledge, but failed. Is there a specific parameter or order, so that I can script the direction of the bullet? Mouse’s position, not raycast
local bullets = game:GetService("Workspace").GunGiver.Bullets.Bullet
local gun = script.Parent
local plrs = game:GetService("Players")
local player = gun.Parent.Parent
print(player.Name.. " has a gun")
local mse = game:GetService("MouseService")
local mouse = player:GetMouse()
local deb = true
local difference = 0.2
mouse.Button1Down:Connect(function()
if deb == true then
deb = false
local newBullet = bullets:Clone()
newBullet.Parent = game:GetService("Workspace")
newBullet.Position = gun.Handle.Part.Position
newBullet.Velocity = Vector3.new(gun.Handle.Part.CFrame.p, (mouse.Hit.p - gun.Handle.Part.CFrame.p)).unit*300
wait(difference)
deb = true
end
end)