Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Would I Check Which Part Was Activated?

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

on line 24 you should do

print(value)

instead of

print(part)
Ad

Answer this question