Ello devforum community its me ya boi once again,
Alright i dont know what happend but yesterday my guns were legit working yesterday. I didnt change anything now in edit mode this happend.
i dont know why but the sounds dont get looped instantly after every shot like they used to. It looks like its playing the audio completly and then after its played ended its playing again idk why ?
the local scripts send a event with the info that the gun got fired to a server script wich then plays the audio
EDIT: Ignore the audio error in output it comes when you shoot into the nowhere
EDIT: So for some reason the player spawns in with the gun the audio bugs but when you drop it and pick it up wich makes it get copied off serverstorage it starts to work. The Audios have no difference
Maybe show the script that handles the RemoteEvent? As long as you do not wait for the sound to finish, this should not happen.
-- This the code from the local script inside the gun
if FireAnim then FireAnim:Play(nil,nil,Module.FireAnimationSpeed) end
if not ShootingHandle.FireSound.Playing or not ShootingHandle.FireSound.Looped then
ObjectEdit:FireServer(Handle, 'GunFired')
if not Jammed then
if Chance(Module.JamChance) == true then
Jammed = true
end
end
--ShootingHandle.FireSound:Play()
end
-- This the script wich catches the event and makes the gun play sound
if GunType == 'SilencedPistol' then
local FireFX = Tool.Handle:WaitForChild('SilencedFireSound')
FireFX:Play()
else
local FireFX = Tool.Handle:WaitForChild('FireSound')
FireFX:Play()
end
local Particle = MuzzleEffect:Clone()
Particle.Parent = Tool.Muzzle
EDIT: From what i see it checks if the sound is playing what i dont understand
I suspect the if not ShootingHandle.FireSound.Playing is the problem. This is why it waits for the sound to finish playing probably.
wait but how does it make sence yesterday it was working fine im hella confused lol
EDIT: Because from what i see its that the event dont get fired when the sound is playing right ? but the event also make the bullet drop when shooting so that means the event still gets fired because the bullet drop is working fine
Did you try to remove it and it works?
There are multiple reasons why it could have worked before. Maybe you changed the hierarchy of the objects in the explorer or something.
what you mean. I realized this problem when i changed the audio ID
wait bro when i dropped the gun ingame and picked it up again the sounds worked fine ? da hell ???
The gun you picked up uses the old sound or the new?
it uses the new sound but what i dont understand i just literlly copied it from server storage and replaced it with the one in backpack and the sound was bugged out again then i dropped it ingame and the sounds worked again
Do the same thing you did before and instead of copying the sound from replicated storage, check what are the differences between the 2 sounds. Are there any differences?
just checked them they have no difference im so confused
yo bro i just changed this line in my local weapon script.
i just remembered someone recommending to use this for the local variable character
local Character = Player.CharacterAdded:Wait() or Player.Character
the one i had wasnt waiting for anything and i was told that the tool might break so i added this and it worked
EDIT: Wait no i just rejoined edit mode the audios bugged out again ? what the hellllllll
can i just ignore this bug because the players joining my game wont spawn with a weapon anyways they have to buy it from a NPC and from what i see the audios work once its being copied from serverstorage