This script keeps giving me an error?

Whenever I use this server script (in workspace):

local part = workspace.Chest.ChestDoor
local button = workspace.Key
local doorkey = workspace.DoorKey
local clickDetector = button.ClickDetector

function onClicked()	
	part.Transparency = 1
	part.CanCollide = false
	doorkey.Handle.Transparency = 0
	doorkey.Handle.Eyeholes.Transparency = 0
	doorkey.Handle.Skull.Transparency = 0
	doorkey.Handle.SkullDetail.Transparency = 0
end

clickDetector.MouseClick(onClicked)

It gives me this error:

Workspace.Script:15: attempt to call a RBXScriptSignal value

What is the issue here? :face_with_spiral_eyes:

To connect a function you must use the Connect method that returns RBXScriptSignal.

clickDetector.MouseClick:Connect(onClicked)
1 Like

I have no idea how I didn’t notice that LOL, thank you so much!! :>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.