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

How Would I Check Which Part Was Activated?

I am doing this collect stone system with pairs() And I'm Trying to Find Which Brick Was Activated

local this = script.Parent
local Items = this.Items

---- Dict.

local Items = {
	Diamond = Items.Diamond,
	Copper = Items.Copper,
	Ruby = Items.Ruby,
	Emerald = Items.Emerald
}

local Levels = {
	Copper = 1,
	Emerald = 2,
	Ruby = 3,
	Diamond = 4
}

for key, value in pairs(Items) do
	print(value)
	value.ClickDetector.MouseClick:Connect(function(part)
		
		print(part)
		
	end)
	
end

It Returns The Player

1 answer

✓ Accepted answer

on line 24 you should do

print(value)

instead of

print(part)

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