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

Changed funtion return an identifying variable?

for i,v in pairs(game.Workspace.Info.Lanes:GetChildren()) do
	v.changed:connect(function(a)
	
	end)
end

I have a group of Boolean Values, and I get them and when one of them changes how do I get the name of the one that changed or something? I looked all over ROBLOX wiki and nothing. Is there a way?

2 comments

0

If you want the name of the boolean, it's v.Name

0

Edited to add script block

1 answer

✓ Accepted answer
for i,v in pairs(game.Workspace.Info.Lane:GetChildren()) do
	v.Changed:connect(function(a)
		local name = v.Name --Added variable that uses a variable to store the name.
	end)
end

I didn't feel like I had to explain this, so I didn't. Seemed self-explanatory, but I'll go ahead and describe what I did.

Since you used a for loop with the variable v being the object, I went ahead and used v.Name and defined in a variable called, name.

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