What solutions have you tried so far? I have tried to use the code on “local” and “server” but both doesn’t solve anything. I have tried to check if the sound is already playing but doesn’t do anything too. I have tried to check if the sound is already playing stop it and play again and doesn’t work too.
so i want to know how can i solve that because it’s very annoying and this seems to be the same on a simple tool with a script that play a sound so why ? and how can i solve that ?
so yeah but the code is too big so you can see where the sound is played.
while wait(0) do
if Fire_Button_Pressed then
if Can_Fire_Again then
if Current_Bullet.Value > 0 and (not Reloading) then
Can_Fire_Again = false
Muzzle_Path.Fire:Play()
local raycast_result = Ray_Module:CreateRayWith2Position(Muzzle_Path.Position, mouse.Hit.Position, true, Enum.RaycastFilterType.Blacklist, {tool, workspace.Ray_Folder, player_char}, nil, false, nil, nil)
local is_player = IsPlayer(raycast_result.HitPart.Parent.Name)
local is_zombie = (raycast_result.HitPart.Parent.Name == "Zombie")
if raycast_result.HitPart ~= nil then
if is_zombie and (not Reloading) then
mouse.Icon = "rbxassetid://6972334166"
end
fire_anim = humanoid.Animator:LoadAnimation(Anims_Path.Fire_Anim)
fire_anim:Play()
RE_Fire:FireServer(raycast_result.HitPart.Parent, is_player, is_zombie, Muzzle_Path.Position, raycast_result.HitPos)
fire_anim.Stopped:Wait()
if is_zombie and (not Reloading) then
mouse.Icon = "rbxassetid://6972322242"
end
wait(Shots_Speed)
end
Can_Fire_Again = true
elseif Current_Bullet.Value == 0 and Current_Mag.Value > 0 then
if (not Reloading) then
Reload()
end
end
end
end
if While_Stop_Request then
break
end
end
sorry for the late answer but yes i have an “activated and deactivated” event but this control the “Fire_Button_Pressed” variable but the “sound problem” is on my pistol script too
Instead of making the “Fire_Button_Pressed” change on Tool.Activated and then checking if Fire_Button_Pressed is true in a separate script, connect the Tool.Activated directly to the script you sent earlier. You may have a reason for why you are doing it in this way but you may want to reconsider how you are triggering your shooting script.
i have already tried in a new game with a new tool and only a script with “tool.Activated:Connect” and i get the same problem but this seems to be the “Playbackspeed” because when he is on “1” it work but after it doesn’t work so it’s strange