Randomly Timed Sounds


  1. What do you want to achieve? Randomly timed sounds in my game

  2. What is the issue? I dont know how to script it

  3. What solutions have you tried so far? i looked for topics on the forum, only found a death sound one

Here is what I have

local Char = script.Parent

local SoundFolder = game.Workspace.Sounds
local Sounds = SoundFolder:GetChildren()

local Humanoid = Char:WaitForChild("Humanoid")
local HumanoidRootPart = Char:WaitForChild("HumanoidRootPart")

local ChosenSound = Sounds[math.random(1,#Sounds)]:Clone()
ChosenSound.Parent = HumanoidRootPart

I dont think this works

Anyways, thanks for reading

You could start a thread that waits for a random amount of time then plays a sound:

	while true do
		--Wait between 0.5 and 3.5 seconds
		wait(math.random() * 3.0 + 0.5)

Ok, where would I put this? In the script? or would I put that in a separate script and define the sound folder

It starts its own thread so you can put it anywhere that is acceptable for your organization.

I think this is a problem with the original script, but its only playing 1 sound

Only one sound ever or only one type of sound?

Never mind, sounds were actually really quiet so I couldnt hear the at first

Thank you for the help

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.