#How to make taggs count every part

1 messages · Page 1 of 1 (latest)

chrome widget
#
local TagService = game:GetService("CollectionService")
local PushTag = TagService:GetTagged("ClickedColorChange")
local Debounce = false

for _,parts in pairs(PushTag) do
    local partColor = parts.Color
    local TouchInterest = parts:WaitForChild("TouchColorChange")
    
    if TouchInterest then
        TouchInterest.MouseClick:Connect(function()
            if Debounce == false then
                Debounce = true
                task.delay(7.2,function() -- Wait to use the button again
                    Debounce = false
                    TouchInterest.MaxActivationDistance = 32    
                end)
                parts.Color = Color3.new(0.560784, 0, 0) -- Color
                TouchInterest.MaxActivationDistance = 0
                task.wait(2) -- Wait to turn color
                parts.Color = partColor -- Start Color
            end
        end)
    end
end

So I want to make the MaxActivationDistance set to 32/0 to all parts when I click to just one part

keen laurel
#

give it a sec

#

wait

#

am super lost

#

wtf r u trying to do

#

and what happends

chrome widget
#

Theres 5 buttons let's call them A B C D E
When I click A the script makes A buttons MaxActivationDistance = 0 but rest of the buttons (B C D E) is still touchable I want to make all of them have the same ActivationDistance

#

What did you do bro

chrome widget
#

I want to make the button change all

#

It doesn't change all at the moment

#

When I click A button it makes A buttons Distance 0 but B C D E remain 32 and it brokes the other scripts I need to have a debounce on all buttons at the same time like If I click C button A B D E have debounce too

keen laurel
chrome widget
#

But it doesn't do that with this script

#

Yes

#
local TouchInterest = parts:WaitForChild("TouchColorChange")

This is ClickActivation

#

I named it TouchInterest because I mixed them and just realized this while typing this

keen laurel
#

am still getting lost

#

so just

#

it should work!

chrome widget
#

I made a elevator that has 2 buttons up and down when I click up it adds a debounce to that button and doesn't let me click (correct)
but when I click up button and just right then click down button it let's me click it (false) I have to make both of these buttons debounced not being able to click when I click one button