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

In Pairs help?

So what I'm trying to do is make the Pair transparent, then nontransparent after 1 second. Apparently It's only making that loop to the 1st Brick, not the 2nd Brick.

button=script.Parent
siren=game.Workspace.siren:GetChildren()

function onClick()
	for i=1,10 do
		for o,p in pairs(siren) do
		siren[o].Transparency=1
		end
                wait(1)
		for o,p in pairs(siren) do
		siren[o].Transparency=0
		print(i)
end end end

button.ClickDetector.MouseClick:connect(onClick)

What I'm trying to figure out is how to get the 2nd Brick to do what the 1st Brick is doing > (which In Pairs should do automatically....) Help would be appreciated!

1 answer

The script has an error because not everything in your work space will have the transparency property thus the script will not work. I suggest watching Peasfactory tutorial on tables on youtube it will explain the answer in more depth

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