Hello everyone! I'm trying to increase the security of my servers to prevent admin abusing by adding a NumberValue called "Faults" into the player's folder called "leaderstats". I made a ScreenGUI which only me can use to add a fault to the player who deserved it. I use a RemoteEvent in the ReplicatedStorage to communicate the ServerScript which increases 1 in the Faults value and the LocalScript that calls the ServerScript with the player's name. The matter is when the ServerScript tries to acces the leaderstats folder. The output says "attempt to index nil leaderstats". LocalScript:
local remote = game.ReplicatedStorage:WaitForChild("Remote")
remote:FireServer(script.Parent.Parent.PlayerNameText.Text)
ServerScript:
local remote = game.ReplicatedStorage:WaitForChild("Remote")
remote.OnServerEvent:Connect(function(player, nam)
local Player = game.Players:FindFirstChild(nam)
Player.leaderstats.Faults.Value = Player.leaderstats.Faults.Value + 1
end)
Can someone help the ServerScript access the leaderstats Folder?
