What do you want to achieve? I made a door that plays a sound and tweens once Clicked on by a ClickDetector.
What is the issue? The problem that I had was the ClickDetector only detected a click in the actual games, not in Studio. There were no warnings, errors, etc about this and I wasn’t able to find anything on this topic.
What solutions have you tried so far? I tried to use a new ClickDetector, only for it to not work. I tried re-scripting it and that also did not work. It seems the only thing that did work though is the HoverOver event.
print("1")
local Door_Open_Sound = script.Parent["Door Opening"]
print("2")
local Debounce = false
Detect.MouseClick:Connect(function()
Debounce = true
print("hELLO wORLDSOSS")
(These were the prints I have gotten from the script, but I still didn’t get the “hELLO wORLDSOSS” print from clicking on the door)
local Click = script.Parent.ClickDetector
local Part = script.Parent
Click.MouseHoverEnter:Connect(function()
print("Work")
end)
What is the variable ‘Detect’ assigned to; if it is not assigned to the click detector, that could be your issue?
local part = script.Parent
local clickDetector = part.ClickDetector
local function foo()
print("Hello there - Obi Wan Kenobi")
end
clickDetector.MouseClick:Connect(foo)
Try this in studio and see if the issue still occurs.