Uh the script doesn’t really work…
So i did take your script and i deleted some stuff so i don’t have to recreate everything I hope you can understand it. This is how i would code something like this.
local Hitbox = script.Parent.Hitbox
local ImpactSoundBig = script.Sound
local Aircraft = script.Parent
Hitbox.Touched:Connect(function(hit)
local IsAudioHere = true
if hit and IsAudioHere == true then
ImpactSoundBig:Play()
ImpactSoundBig.Ended:Connect(function()
ImpactSoundBig:Destroy()
end)
for i, part in pairs(Aircraft:GetDescendants()) do
if part:IsA("BasePart") or part:IsA("MeshPart") or part:IsA("UnionOperation") then
part.Material = Enum.Material.Sandstone
part.BrickColor = BrickColor.new("Dark stone grey")
end
end
end
end)
So what you do you have those audios and after that play you can destroy them and after that it would do the rest. This is just an example so i’m not sure how it would preform on your side.
I did not know how to name “IsAudioHere”…
Uh the audio still spam… I did it correctly
Just to clarify, when the part is touched, you want the audio to be played once only and will not continue playing, correct?
No, a bit more like a cooldown
okay i have no idea what i was doing yesterday. So you could do something like this.
ImpactSoundBig:Play()
ImpactSoundBig.Ended:Wait()
ImpactSoundBig:Destroy()
I have no idea why did i make a IsAudioHere if im not even using it i guess i wasn’t Clear yesterday…
Uh it still spams the audio… I think I’m just gonna let it spam
maybe its cause you have the property PlayOnRemove is on,
Nope. Both of them don’t have it
Is it looped? Or maybe its just a very long audio by anychance?
Nope. Just a short explosion sound effect
I have ran out of ideas…
I mean you could delete the seat upon the impact as it would “destroy it anyways” but there would be a error anyways. There really has to be a debounce.
I know. I also already tried to make it destroy the seat before but yeah…