Hello, I'm Fako16 and I'm a new scripter that's currently learning. I watched a AlvinBlox video that explained how FE click detectors work and I wanted to make a click detector that would give you resources like wood, stone, etc.. I started making it and it works fine in studio, but I remembered that if it works in studio, that doesn't mean it'll work in game and when I tested it in-game it didn't work. Can someone help me see why it doesn't work?
https://prnt.sc/jo6vc8 PLEASE CHECK THIS IMAGE BEFORE LOOKING AT SCRIPTS!
Script 1 -
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local wood = Instance.new("IntValue", player)
wood.Name = "Wood"
wood.Value = 0
wood.Parent = leaderstats
local stone = Instance.new("IntValue", player)
stone.Name = "Stone"
stone.Value = 0
stone.Parent = leaderstats
end)
Script 2 -
game.Workspace.Tree.ClickDetector.MouseClick:connect(function()
game.Players.LocalPlayer.leaderstats.Wood.Value = game.Players.LocalPlayer.leaderstats.Wood.Value + 1
end)
Script 3 -
local clickdetector = game.Workspace.Tree.ClickDetector
clickdetector.MouseClick:Connect(function()
game.Workspace.TreeCutting:FireServer()
end)
Any help will be appreciated!

5 comments
You don't need FE (Filtered enable) for mouse click as long as the code is in script and not local script
I did what you said and it doesn't change the Wood value when i press it and also I need FE to keep my game exploiter-clean
I added answer
You do need filtering enabled, its used as roblox's anti cheat as well as allowing accounts under 13 to join.
Why do you need it for mouse click?