Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I find all parts named something, and make this happen to all of them?

I need to make this function place a copy of the text bubble above every brick named FaradayDisplay instead of just the script's parent, but I'm god awful with tables. How would I find them?

function Speak()
	local text = game.ServerScriptService.FaraVoice.Value
		local y = game:GetService("Chat"):Chat(script.Parent, ""..text, Enum.ChatColor.Green)
end

1 answer

✓ Accepted answer

You can do it by puting all your bricks inside a same Model and then doing this:


function Speak(Brick)
local text = game.ServerScriptService.FaraVoice.Value
local y = game:GetService("Chat"):Chat(Brick, ""..text, Enum.ChatColor.Green)
end


for i,v in pairs(workspace.Model:GetChildren()) do -- Change the workspace.Model to wherever your Model is and whatever your Model is called.
if v:IsA("BasePart") then
if v.Name == "FaradayDisplay" then
Speak(v)
end
end
end

I'm not sure if this is going to work but let me know.

This discussion is preserved as it was. New answers, comments, and votes are closed.