I can't make an object visible

I am trying to get a part to trigger an invisible object. When a player steps onto this part it will trigger the other object to become visible. I am trying to make a slight jump scare, when they come closer towards the invisible object the part would have been touched allowing for this object to become visible to the player, however I can’t seem to get the part to trigger the object.

local Triggers = game.Workspace.Trigger2

local Bendy = game.Workspace.ScaryBendy.Cutout

local board = game.Workspace.ScaryBendy.Plank

local function visi()

Bendy.Transparency = 1

board.Transparency = 1

end

Triggers.Touched:Connect(function()

game.Workspace.ScaryBendy.Cutout.Transparency = 0

game.Workspace.ScaryBendy.Plank.Transparency = 0

end)

Why are you making the variables Bendy and board and then not using it in the function?
You should also be getting errors in the Output window since your visi() function isn’t set up.

Make Cutout and Plank already invisible by setting their Transparency to 1 in the workspace. Then put this in your script in the Trigger2 Part.

local Triggers = game.Workspace.Trigger2

local Bendy = game.Workspace.ScaryBendy.Cutout

local board = game.Workspace.ScaryBendy.Plank

local function invisible()
	Bendy.Transparency = 1
	board.Transparency = 1
end

local function visible()
	Bendy.Transparency = 0
	board.Transparency = 0
end

Triggers.Touched:Connect(visible)
Triggers.TouchEnded:Connect(invisible)

This works if the Trigger2 Part is in the workspace and the 2 Cutout and Plank Parts are in a model in the workspace named ScaryBendy.

1 Like

remove the visi() function

local Triggers = game.Workspace.Trigger2
local Bendy = game.Workspace.ScaryBendy.Cutout
local board = game.Workspace.ScaryBendy.Plank

Bendy.Transparency = 1
board.Transparency = 1

Triggers.Touched:Connect(function()
Bendy.Transparency = 0
board.Transparency = 0
end)
1 Like