Whenever I fire my weapon, the block comes up, and then there is like a .2 second delay before the velocity kicks in.
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr,tool,handle,mouseHit)
local l = Instance.new("Part",workspace)
l.BrickColor = BrickColor.new("Toothpaste")
l.Size = Vector3.new(1,1,3)
l.CanCollide = false
l.Anchored = false
l.CFrame = handle.CFrame
l.CFrame = CFrame.new(l.Position,mouseHit.p)
local v = Instance.new("BodyVelocity",l)
v.Velocity = l.CFrame.lookVector * 100
v.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
end)

17 comments
Edit: Changed L to I
Thanks for the advice but there is still a delay.
@memere If this the result of firing to the server, there's going to be a delay regardless of what you do. That's simply the nature of these connections. You could create it locally for the client firing and then recreate them on the other clients since we want that first client to have responsiveness. (which is how most people do it)
You don't have to have it make a new part every time. Just create a part in Server Storage with set properties (like size, anchored, cancollide, etc..) and have the script simply create a clone of the part in ServerStorage, and set it's parent to workspace or whatever.
@RuskiKrolik Still won't make a such a difference time wise
Alright thanks.
I just experimented client vs server and yes, danz, you are right. The client and the server have a huge time delay. How can I recreate this is everyone's client?
@memere so basically, on the client you would create the ball exactly when they click so they see it first, then you send info about it, pos and dir to server, the server will then send that stuff out to the rest of the client to reproduce. On the original client it will do the touch checks and send info to the server so it can verify its legit there.
How can I make it so the server can see the second bullet but not the client?
@memere You don't, the bullet only exists on the clients.
How would I replicate the bullet on the other clients then?
@memere You send infomation about it, through the server, such as where it originates, where it should go, etc.
Wouldn't that just create a second bullet from the first client's perspective if you run it again on the server?
@memere Your not creating the bullet on the server, your sending the data through the server to the OTHER clients so they can create it. Why would a another player need the server to create a bullet if that player is on the other side of the map
May you refer me to a source that would explain to me how to send information from the server to every nearby client (and run it on their clients)? I would appreciate it, thank you.
@memere No sources come to mind, if you understand how to fire remoteevent simply fire to the server, and there loop through each player and see if they are close enough to the player to fire the info to them.
Thanks.