-
What do you want to achieve? I want to make a script that will randomizer sound
-
What solutions have you tried so far? I have tried looking at youtube videos, free models, and even on the DevForums, but I found nothing as to what I was looking for.
Here’s how I want the script to work.
this is for my car crash game, I already have my trigger event.
function onTouch(part)
wait(0)
if part.Name == “Joint Break” then
print(“it hit it”)
now when you crash into let’s just say a wall that has a joint break in it.
then when it hits the wall, the script will then detect’s it and this is where the randomizer come into play.
-
right after the print(“it hit it”) it will scan the IDs I put for the script, and I can put as many IDs as I want in it, it will even have names in them like (crash_1, 4816395722, crash_2, 5826497601, crash_3, 77739264) something like that.
-
Once it picks an ID with the sound then it will instance a new sound into whatever part the script is inside of with the crash ID sound and name.
-
and lastly once it instance it, it will then play the sound only 1 time and then remove the sound afterwards.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
```(function onTouch(part)
wait(0)
if part.Name == "Joint Break" then
print("it hit it")
--start the randomizer sound here and then remove this text your reading here afterward
script.Parent.Hit_Sound_1.Playing = true
wait(0.01)
script.Parent.BreakSound.Disabled = true
script.Parent.Material = Enum.Material.SmoothPlastic
end
end
script.Parent.Touched:connect(onTouch))```
and that it.
Please do not ask people to write entire scripts or design entire systems for you.