replicatedstorage.Remotes.Rank.OnServerInvoke = function() local character = game.Players.LocalPlayer.Character --This is the line with the error if not remoteData:FindFirstChild(character) then return "NoFolder" end local rank = player.leaderstats.Rank
I'm getting index nil and I do not know how to fix this. Any help?
Okay, well you can't get a localplayer from a Script, but you can call the player from the parameters inside of the OnServerInvoke event.
Should look like this
replicatedstorage.Remotes.Rank.OnServerInvoke = function(player)
so then you can get the Character with local Character = player.Character