Shells ejecting behind the player when walking

Simple question but i have been having it for over than a year, but you ask, what’s the question?
image
You can see, i labeled the image with A and B points, as the title says, the shells are spawning behind the player when walking, but i wish they spawned in point B (Blue).
I honestly think this is a function execution lag issue, but not sure. I have seen many games with shell scripts running like this even ServerSided, and they all eject exactly in the Bolt (aka Slide) when ejecting, no matter if the player is running, walking or not.
So it’s it, i’ll be waiting for help! If you need the code to help me:

Code (located into a server script):

script.Parent.RemoteEvent.OnServerEvent:Connect(function()
local Shell = game.ServerStorage.Rifle
local Clone = Shell:Clone()
Clone.Position = script.Parent[“Bolt Mechanism”].Position
Clone.Parent = workspace
game:GetService(“Debris”):addItem(Clone, 10)
Clone.Velocity = (Vector3.new(Clone.CFrame.LookVector * 30) + (script.Parent.Handle.CFrame.RightVector * -8) + Vector3.new(0,30,0))
game:GetService(“Debris”):addItem(Clone, 10)

end)

Sorry if i made any spelling mistakes, i’m Brazilian.

Maybe it has to do with how the Handle part is turned, so it’s just going to shoot the shell backwards because that’s where the RightVector points.

You shouldn’t be doing this on the server, do it on the client. Your issue is likely caused by latency.

1 Like

With what @Tom_atoes said, It takes a few seconds for the server to receive the request

But how can i replicate the LocalScript to make it appear to everyone

you can prob use remote events Bindable Events and Functions | Roblox Creator Documentation

1 Like

You’ll probably have to use Something called :SetNetworkOwner

Network Ownership (roblox.com)

1 Like

You shouldn’t do this, it is a pretty big performance impact for not much of an effect. Most players will not care, and if you include it most will not notice.

3 Likes