The problem is, if I click on part, it starts to glow, but when I click on it again, nothing happens. I should add loop somewhere or something, so it changes part material everytime I click on it, but I don't know where..
local Collector = game:GetService("CollectionService")
local TParts = Collector:GetTagged("TestTager")
for _, TParts in pairs(TParts) do
CD = Instance.new("ClickDetector",TParts)
CD.MaxActivationDistance = 5
CD.MouseClick:Connect(function()
local dotka = false
if dotka == false then
TParts.Material = Enum.Material.Neon
dotka = true
else
TParts.Material = Enum.Material.SmoothPlastic
dotka = false
end
end)
end
