Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I use Click Detector with filtering enabled?

Asked by 6 years ago

I'm working on a store script where a player could click on a mannequin to be able to buy it. How do I make it so that this works with filtering enabled on?

script.Parent.MouseClick:connect(function()
    print("Click Detected")
    -- other stuff
end)


2 answers

Log in to vote
0
Answered by 6 years ago

The ClickDetector object is already FilteringEnabled compatible. It’s a server-side only class.

Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

I have a system, where I make a click detector, and the click detector has a remote event inside of it. In a local script in the client when you click part it checks if the part has a click detector and the remote event in it. Then it just fires the remote event. For a server script insteadde of connecting a function to the click detector, I connect it to the remote event.

Answer this question