Trying to make bullet line go where player shoots at


so the bullet line does appear but in this image


when i shoot up or down, the bullet line doesn’t go up or down and only shoots in the middle

heres the script (its in serverside)
script.Parent.Shoot.OnServerEvent:Connect(function(player, mousePosition)
script.Parent.Handle.larrel.SurfaceLight.Enabled = true
script.Parent.Handle.larrel.ParticleEmitter.Enabled = true
script.Parent.Handle.theslidle.Transparency = 1
script.Parent.Handle.theslidle2.Transparency = 0
local bulletlinecloe = bulletline:Clone()
bulletlinecloe.Position = tool.Handle.larrel.Position
bulletlinecloe.Parent = workspace
bulletlinecloe.CFrame = tool.Handle.CFrame * CFrame.Angles(0, math.rad(180),0)
bulletlinecloe.CFrame = tool.Handle.CFrame * CFrame.new(0,0,-22)
script.Parent.Handle.Barrel[“Gun shot”]:Play()
wait(0.2)
bulletlinecloe:Destroy()
script.Parent.Handle.theslidle.Transparency = 0
script.Parent.Handle.theslidle2.Transparency = 1
script.Parent.Handle.larrel.SurfaceLight.Enabled = false
script.Parent.Handle.larrel.ParticleEmitter.Enabled = false
print(“it works”)
local part = Instance.new(“Part”)
part.Position = tool.Handle.buletcome.Position
part.Size = Vector3.new(0.052, 0.044, 0.17)
part.CFrame = tool.Handle.CFrame * CFrame.Angles(0, math.rad(90), 0)
part.Parent = workspace
part.CanCollide = true
part.BrickColor = BrickColor.new(“Bronze”)
part.Material = Enum.Material.Metal
wait(4)
part:Destroy()
end)

1 Like

Lowkey you’re better off using beams than actual parts, it’s just hassle free honestly.

That being said, do you have a script that makes the arm move up or down depending on where you’re aiming? If so, the bullet stays in the middle because the server doesn’t actually see your arm moving – that’s just your client.

yes but its also server sided too

also i have other guns that have the same problem that if you shoot left your right it just stays in the middle

Could you make the object tool.Handle.larrel visible? See if it moves with the gun.

ill see if that work (characters)

no it doesn’t, also larrel is the block that made a muzzle flash for the gun

Try figuring out why – if you can make larrel move with the gun, you can make it work.

ok ill try doing that i guess (char