Player touch not working

I am trying to make a script. When you touch the specific block, the block will disappear then another block will appear. Anything wrong with this script?

Script:

local Block = script.Parent
local TouchPart = Block.TouchPart
local Block2 = game.Workspace.Appear2

TouchPart.Touched:Connect(function(PartThatTouched)
	local player = PartThatTouched.Parent
	Block.Transparency = 1
	Block2.Transparency = 0
end)

I would suggest finding humanoid so like: TouchPart.Touched:Connect(function(PartThatTouched)

local hum = PartThatTouched.Parent:FindFirstChildOfClass("Humanoid")
    if hum then
           	Block.Transparency = 1
        Block2.Transparency = 0
    end

end)

1 Like

Uhm… what? This does not help.

Sorry meant to message not reply, I have to many drafts open, my fault.

Dude I removed the post, why’d you flag it?

This works fine, I don’t see any problem with it.

Block.Transparency = 1
Touchpart.Transparency = 1 – should be this

Since you said you want the part the part to disappear, you have to change the TouchPart’s transparency since that’s the part you touched.

I’m assuming Appear2 is the part you want to appear, just replace Block2 with Appear2, and set the transparency to 1 beforehand.