You can write your topic however you want, but you need to answer these questions:
I’m trying to write a function that when said function is called to “remove” all audio from ReplicatedStorage, it does exactly that. But when I try to run it, it doesn’t run. I’ve tried debugging, restarting Studio, Changing where the function gets called from, but it still doesn’t work
Function:
function Cleanup()
task.wait(1)
print("start")
for _, v in pairs(game.ReplicatedStorage.TrafficCams.CameraSnapshot:GetDescendants()) do
if v:IsA("Audio") then
print("✔️")
v.Playing = false
v.Volume = 0
end
end
end
Maybe I’m absolutely wrong here, but I never heard of an “Audio” instance. Are you referring to a “Sound” Instance? You would need to use :IsA(“Sound”) in that case.
function Cleanup()
task.wait(1)
print("start")
for _, v in pairs(game.ReplicatedStorage.TrafficCams.CameraSnapshot:GetDescendants()) do
if v:IsA("Audio") then
print("✔️")
v.Playing = false
v.Volume = 0
end
end
end
my guy there is no audio its sound and also you didnt run the function
function Cleanup()
task.wait(1)
print("start")
for _, v in pairs(game.ReplicatedStorage.TrafficCams.CameraSnapshot:GetDescendants()) do
if v:IsA("Sound") then
print("✔️")
v.Playing = false
v.Volume = 0
end
end
end
Cleanup()
yeah happens to me often , i once forgot that remote fuctions from a client give the player to the server and i spent 2 hours wondering why it wasnt working lol