I know that the local player can be accessed via local script like this:
game.Players.LocalPlayer
But I am using a module script, so I try to access the local player like this (in module script):
local Players = game:GetService("Players")
So now in order to access the LocalPlayer, I tried to do this (in module script):
local Players = game:GetService("Players")
print(Players.LocalPlayer)
But the Players.LocalPlayer just prints nil
Is it because I am using a module script and local players can't be accessed through it or is it because I am not accessing the local player properly?
And if the error is because I am using a module script, then is there any way to access the local player with another method?
Side Note:
I am trying to access the local player because I want to increase one of their leader board's stat. So I tried to do this:
Players.LocaPlayer.leaderstats.Kills.Value += 1
And this too:
Players.LocalPlayer:WaitForChild("Kills").Value += 1
But the Players.LocalPlayer is returning nil
Thanks for any help

1 comment
It is saying 'attempt to index nil with 'Name''. I think it is because we can't use game.Players.LocalPlayer inside a module script.