I am making some sick bullet whizzes, and i could not figure out how to make a delay to the second sound, because you hear the bullet impact first before you hear the shot. here is the code right here :
local Meta = Instance.new("Sound") Meta.Name = "Crack" Meta.SoundId = "rbxassetid://196857754" Meta.Volume = 0.7 Meta.Pitch = 1 Meta.Looped = true Meta.Parent = bullet Meta:play() local Feta = Instance.new("Sound") Feta.Name = "Plound" Feta.SoundId = "rbxassetid://1055286841" Feta.Volume = 2.5 Feta.Pitch = 1 Feta.Looped = false Feta.Parent = bullet Feta:play()
Feta is the bullet impact which will play first, however meta plays the same time as Feta which is why it needs a delay, now if i put a wait at:
local Feta = Instance.new("Sound") wait(2) Feta.Name = "Plound" Feta.SoundId = "rbxassetid://1055286841" Feta.Volume = 2.5 Feta.Pitch = 1 Feta.Looped = false Feta.Parent = bullet Feta:play()
it works but the whole gun delays which means it loads every two seconds so what must i do to make Meta delay for 2 seconds then play sound?
I think you mean you want the delay for the sound without delaying the script. If that's what you mean, you can use delay
to delay the sound without delaying the script.
local Meta = Instance.new("Sound") Meta.Name = "Crack" Meta.SoundId = "rbxassetid://196857754" Meta.Volume = 0.7 Meta.Pitch = 1 Meta.Looped = true Meta.Parent = bullet Meta:play() delay(2, function() -- Delays the function for 2 seconds local Feta = Instance.new("Sound") Feta.Name = "Plound" Feta.SoundId = "rbxassetid://1055286841" Feta.Volume = 2.5 Feta.Pitch = 1 Feta.Looped = false Feta.Parent = bullet Feta:play() end) -- Putting more here won't delay 2 seconds.
Flip it around. Create Feta play it first. Wait. Then create the other and play. Like this.
local Feta = Instance.new("Sound") Feta.Name = "Plound" Feta.SoundId = "rbxassetid://1055286841" Feta.Volume = 2.5 Feta.Pitch = 1 Feta.Looped = false Feta.Parent = bullet Feta:play() wait(2) local Meta = Instance.new("Sound") Meta.Name = "Crack" Meta.SoundId = "rbxassetid://196857754" Meta.Volume = 0.7 Meta.Pitch = 1 Meta.Looped = true Meta.Parent = bullet Meta:play()