A server script will only run code if it is a descendant of the Workspace or ServerScriptService, and a local script will only run code if it is a descendant of one of the following objects:
a player’s Backpack , such as a child of a Tool
a player’s character model
a player’s PlayerGui
a player’s PlayerScripts
the ReplicatedFirst service.
The leaderstats folder is inside of your player object which is in none of these locations no matter what type of script you are using. I suggest you handle all of your leaderstat values from a server script in ServerScriptService.