I am having trouble with filtering enabled getting in the way. We're not exactly worrying about how to get remote events to work, but how I should find a way to do this. Let me explain this the best I can.
I am making a DayZ type of game. The problem I am running into at the moment is with loot. With the type of game in mind, we all should be aware that there will be hundreds of the same time of loot on the map, for example, beans. Remembering this, let's continue.
I am using ClickDetector's "MouseHoverEnter" API as a way for gui text to pop up to give you the option to "Take Beans" (or any other loot). That's not important. The part that makes this tough is that the script to do this all has to be inside the actual loot part. Here is the print filter's output with having a script inside the loot part (in a server script):
Filtering is enabled. Event MouseHoverLeave for instance Workspace.Beans.Loot.ClickDetector will not be replicated.
Is there a way around this? The script has to be in the part, because there will be hundreds of "Beans". Another way would be to have a local script in something like PlayerGui, and have it directly do game.Workspace.Beans, but remember there will be hundreds of Beans, and would cause the script to error and break.
Another important part is that I need to be able to use .MouseHoverEnter:connect(function(Player) somehow. With having the 'Player' argument, I can do all the duties of transferring the loot's properties to a players backpack.
Thanks to anyone who can help. If you need more clarification just ask.
Putting a script inside every single bean in the Workspace to correspond with it's ClickDetector will cause massive amounts of lag and is extremely inefficient. Use a LocalScript in PlayerGui to detect if the mouse's Target is named 'Beans'. One script to replace potentially hundreds, and you won't have a problem with FilteringEnabled getting in the way of your ClickDetectors.
Example;
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() while wait(.5) do --.5 interval to reduce lag if mouse.Target ~= nil then if mouse.Target.Name == "Beans" then --Your code here-- end end end