Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

help me im still trying to figure out how to make a block once clicked disappears can somebody help?

this is my script for a block that disappears, but then another block reappears:

local Part1 = game.Workspace:WaitForChild("Part1")
local Part2 = game.Workspace:WaitForChild("Part2")

while true do
	Part1.Transparency = 0
	Part1.CanCollide = true
	Part2.Transparency = 1
	Part2.CanCollide = false
	wait(3)
	Part1.Transparency = 1
	Part1.CanCollide = false
	Part2.Transparency = 0
	Part2.CanCollide = false
	wait(3)
end

can u guys make it so that the block just disappears once clicked? and then it respawns when u click another block?

2 comments

0

thanks its helping me a lil more ill soon figure it out!

1 answer

✓ Accepted answer

Kinda easy, add Click Detector to your part and then script to your part. Write this:

script.Parent.ClickDetector.MouseClick:Connect(function()
	script.Parent:Destroy()
end)

This script will find Click Detector by looking into parent's child and then detect click with MouseClick part. Then it connects function which removes the part.

That's all. I tested and it worked.

This discussion is preserved as it was. New answers, comments, and votes are closed.