player.Leaderstats.Followers.Value = player.Leaderstats.Followers.Value + 5 * (player.Leaderstats.Rebirths.Value + 1)
?how do i fix this (Leaderstats is not a valid member of Player) here the localscript
2 answers
You shouldn't be using client-side scripts to manipulate with leaderstats as of ROBLOX's Filtering Enabled.
Why you shouldn't use it?
It's because ROBLOX made an update to prevent hackers/exploiters from injecting scripts that add money client-sided, so now if they even try it the Money or Followers or whatever value in the leaderstats will update only for them and is not acknowledged by the server so the real value is still on the server and that value will be used for purchases or transactions or etc inside of your game if you manipulate with it
However, if you manage to use Remote Events, this problem can be solved pretty easily.
Local script:
-- Your code is probably some small partition of your scripts without me knowing how'd you get the player so I used my own method.
local RS = game:GetService("ReplicatedStorage") or game:FindService("ReplicatedStorage");
local FollowersEvent = RS:WaitForChild("FlwEvent");
local followers_amount_to_be_added = 5
FollowersEvent:FireServer(followers_amount_to_be_added)
-- Over here I used an event to call upon a server to increase the value of Followers
Script inside ServerScriptService
local ReplicatedStorage = game:GetService("ReplicatedStorage") or game:FindService("ReplicatedStorage");
local FlwEvent = ReplicatedStorage:WaitForChild("FlwEvent");
FlwEvent.OnServerEvent:Connect(function(player, followers_amount)
local leaderstats = player:WaitForChild("leaderstats");
local Followers = leaderstats:WaitForChild("Followers");
local Rebirths = leaderstats:WaitForChild("Rebirths");
-- I'd made here a check on the server to check is that a right amount of followers that should be added to prevent exploiters as I don't know the concept of your game so I cannot provide anything more on my own
if followers_amount ~= nil then
Followers.Value = Followers.Value + followers_amount * (Rebirths.Value+1);
else
warn("You've forgot to provide the followers amount that is gonna be added or increased in a local script")
end
end)
This code should work but however is not tested. Make sure to add a RemoteEvent instance inside the ReplicatedStorage service named "FlwEvent"
Also a tip is to put the "normal scripts" or server-side scripts in a ServerScriptService to prevent cheaters from accessing your code and looking for flaws in it to bypass them + obfuscating local scripts is a must
-- try this
game.Players.LocalPlayer.leaderstats.Followers.Value = game.Players.LocalPlayer.leaderstats.Followers.Value + 5 * (game.Players.LocalPlayer.leaderstats.Rebirths.Value + 1)
-- it should ALWAYS be leaderstats with a lowercase l instead of capital L
-- also dont use just player instead do game.Players.LocalPlayer
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
exploiters can fire that Remote event and pass a infinite amount of followers, it should be a pre-defined amount or all handled by server
That's what I said too by the comment where he needs to check the event on his own to prevent exploiters..