It works in playtest but not online. I'm not sure what's wrong and output tells me nothing.
bin = script.Parent
function onButton1Down(mouse)
local hit = mouse.Target
if (hit == nil) then return end
if (hit.Name == "SilverDoor2") then
hit.Transparency = 0.8
hit.CanCollide = false
wait(2)
hit.CanCollide = true
hit.Transparency = 0
end
end
function onSelected(mouse)
print("Action Tool Selected")
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected)

1 comment
Sadly, this doesn't work. The function onSelected does work. But onButton1Down does not work.