Aight so I got the Latency diffrence now.
I get the shooting player time and send it via remotevent to server, server sends all clients a remotevent with the passed time from shooter and the client itself takes his own time value and - it with the shooter time, this way I get the milliseconds in between the shots. its 0.42 smth.
How would I actually use it to shift the bullet? Do I increase the bulletspeed or do you want me to actually spawn the bullet further in the direction?
This is my fire function
function Fire(Tool,direction,TAU,MIN_BULLET_SPREAD_ANGLE,MAX_BULLET_SPREAD_ANGLE,BULLET_SPEED ,BULLET_MAXDIST,BULLET_GRAVITY,currtime)
local reptime = tick()
local latency = reptime - currtime
print("difference : "..latency)
local RNG = Random.new()
local ImpactParticle = Tool.Handle:WaitForChild("ImpactParticle")
local directionalCF = CFrame.new(Vector3.new(), direction)
playerTool = Tool
local direction = (directionalCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector
local CosmeticBullet = game.ReplicatedFirst.Assets.Bullets:FindFirstChild(Tool.Name.."_Bullet")
local FirePointObject = Tool.Handle:WaitForChild("GunFirePoint")
local humanoidRootPart = Tool.Parent:WaitForChild("HumanoidRootPart", 1)
local myMovementSpeed = humanoidRootPart.Velocity
local modifiedBulletSpeed = (direction * BULLET_SPEED) + myMovementSpeed
-- Prepare a new cosmetic bullet
local bullet = CosmeticBullet:Clone()
bullet.CFrame = CFrame.new(FirePointObject.WorldPosition, FirePointObject.WorldPosition + direction) * CFrame.new(0, 0, -CosmeticBullet.Size.Z/2)
bullet.Parent = workspace.Bullets
Caster:FireWithBlacklist(FirePointObject.WorldPosition, direction * BULLET_MAXDIST, modifiedBulletSpeed, ignorelist, bullet, false, BULLET_GRAVITY)
-- Play the sound
cuz lets say I’ll modify the speed. I cannot actually * the speed with the latency because the speed would actually lower itself when I multiply it with something below 1.
100 * 0.5 = 50