Im trying to create a script to look for any objects with the classname Sound in the workspace but idk how to do it i tried using findfirstchild but it only finds using the name, not the classname?
like i can use this but it only finds it using the name of it not classname
local found = workspace:FindFirstChild("Sound",true) if found then found.PlaybackSpeed = 0.5 end
There's a function called 'FindFirstChildOfClass'.
local sound = workspace:FindFirstChildOfClass('Sound') if sound then sound.PlaybackSpeed = 0.5 end
There is a property of all instances called GetDescendants. You can use this like so,
for i,v in pairs(workspace:GetDescendants()) do if v.ClassName == "Sound" then --Do Stuff end end