How do I exclude this script from the tool user? I only want it to be for other players

I made a bullet pass script where if the bullet is less than 10 studs away from a player, then it will play the bullet pass sound effect. The script works perfectly and everything, but the problem is that I only want it to be for other people, not the gun user. This script is parented by the tool btw.

1 Like

Two options: have the shooting client set the volume of the sound to 0, or add a check to your sound player if the nearest client to the bullet is the shooter. If it is, do not play the sound.

A lack of code makes it hard to understand your current implementation and how you can apply a solution to this problem specific to your case, so at the very most some crude code samples or hypothetical solutions can be provided. If none of the above answers are applicable, then please provide actual information so that we can help you.

Sorry, here’s the code.

if (bulletP - plr.Character.Torso.Position).magnitude < 10 then
local pass = script.Parent.sounds.Pass:Clone()
pass.Parent = game.Players.LocalPlayer.PlayerGui
pass:Play()
end

I don’t know how to apply the two answers above, can you help me? I provided some code for some support, thanks.

I think I found a really easy solution, I’ll just wait a number of seconds (prob 1 or 2 seconds) and since the bullet goes 2500 studs per second, it won’t detect me because I’ll add a 1-2 second delay

1 Like