Hello world! Im creating a 2 player obby:
How to make a Button that turns a part to Transparency = 0 and CanCollide = true just while is touched? soo , as soon as the player doesent touch anymore that Button, the Part whil go back to Transparency = 0.6 and CanCollide = false.
Curently i use this:
local button = script.Parent.Button
local part = script.Parent.Part
local Debounce = false
script.Parent.Button.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if Debounce == false then
Debounce = true
button. BrickColor = BrickColor.new ("Bright red")
part.Transparency = 0
part.CanCollide = true
wait(20)
button.BrickColor = BrickColor.new("Bright green")
part.Transparency = 0.6
part.CanCollide = false
Debounce = false
end
end
end)

2 comments
i just cant figure out how to do that.
as you can see: ”button” and ”part” are both a Part