I am working on a game, and I wanted to make a block that appears when another block is pressed. Does anyone know a script I can use for this?
COMMUNITY QUESTION
Make a block that appears when another block is pressed?
1 answer
Since you provided a such roughly question, I will help the code while explaining to you.
1.Define two bricks.
local BrickDisappear = workspace.PartA
local BrickTouch = workspace.PartB
The codes above defines two bricks.
2.Set up the signal(event) listener.
local Signal = nil
Signal = BrickTouch.Touched:Connect(function()
BrickDisappear.Transparency = 1
Signal:Disconnect()
Signal = nil
end)
Since the Touched signal should only be listened once, we disconnect it after it fires.
3.Put all together.
local BrickDisappear = workspace.PartA
local BrickTouch = workspace.PartB
local Signal = nil
Signal = BrickTouch.Touched:Connect(function(part)
BrickDisappear.Transparency = 1
Signal:Disconnect()
Signal = nil
end)
Documentation:
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
This site is for getting help with writing scripts, not requesting scripts.
elaborate on 'pressed'. Like clicked or touched?