Due to my minimal scripting skills, I’m unable to understand this particular gun system and cannot even attempt to change stuff myself.
I’m currently using a modified version of Sensei’s Gun Kit (Sensei's Gun Kit) and I’m trying to make tracers server-sided, since they’re apparently only client-sided.
I assume this script named “BulletServer” has something to do with it, but I’d prefer if someone could download the latest version of the kit which I’ll post below and look through all its contents if possible. gun kit thing (2).rbxm (49.4 KB)
local activeBullets = 0
local function replicate(player, origin, direction, bulletSpeed, newBehavior, tracer, firingMethod)
if tracer ~= nil then
for _,v in pairs(game.Players:GetChildren()) do
if v ~= player then
replicateBullet:FireClient(v, origin, direction, bulletSpeed, newBehavior, tracer, true, {player.Character} ,firingMethod)
end
end
end
end
local function playerJoined(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
if player.Team ~= nil then
humanoid:SetAttribute("Team", player.Team)
end
wait(0.1)
for _,v in pairs(character:GetDescendants()) do
if v.Parent:IsA("Accessory") and v:IsA("BasePart") then
v.CanCollide = false
v.CanQuery = false
end
end
end)
end
game.Players.PlayerAdded:Connect(playerJoined)
replicateBullet.OnServerEvent:Connect(replicate)```
This is where it sends all the data to the client. If you then go to the LocalScript and look for the OnClientEvent portion, you will see the code it runs to create the tracer. You could copy that code to the server(along with any dependencies) and it will create it on the server. I would heavily advise against making the tracers server sided, though. There will be significant network usage and lag if you created the tracers server sided. You might just be experiencing a networking issue if you don’t see them on other clients.
FE gun kit’s projectile system is created and handled in the client, so it is definitely not that hard to make the tracers visible to all players if you are atleast beginner level in scripting (knowing what does “if” do and basic object creating/cloning), so i advise you to locate which localscript handles the bullet tracers, which is most likely in StarterPlayerScripts or StarterCharacterScripts
The code is already setup to do that, there’s just a networking error somewhere… In the ReplicateBullet call, try printing the player’s Name. You’ll need to see if it’s firing the event, and if the receiving client is properly making the bullet.
Rolo is probably right, about there being a tiny error hidden somewhere, but if you feel like going the extra mile just delete the gun kits entire tracer system and replace it with a custom one. Theres no point fumbling around with it.
Ofc you can take some of the code from there, for example the code that actually moves the tracer.
But the absolute best way to replicate VFX is by using client replication. Basically, when the player shoots spawn a tracer on the client. Then make them send a RemoteEvent to the server, which then Sends a RemoteEvent to all of the clients EXCEPT the one that already shot. This remote tells all the other players to spawn the same tracer on their screens. If you don’t use any kind of randomness for the tracer paths, they should line up well enough on each client. Then, spawn the “real” projectile on the server. Each client can then check if the “real” projectile is still alive, and if it isn’t, destroy their cosmetic tracer. You can also make their tracers lerp to the “real” projectiles position to make 99% the players are seeing the same things.
Replacing the tracer system worked. Keep in mind this is an opensource gun system that hasn’t been updated in a while, maybe completely remaking certain scripts will help me in the future too.
As you guys said, I assume there was some sort of error in one of the scripts.