RemoteFunctions.GetData.OnServerInvoke = function(player: Player)
local Profiles = PlayerDataHandler.Profiles[player]
print(Profiles)
local profile = Profiles.Data
if not profile then return end
print(profile)
return profile
end
local script:
local data = RemoteFunctions.GetData:InvokeServer(Player)
print(data)
Make sure “Player” on the client is equal to the local player.
This is my server script:
local PlayerDataHandler = require(game.ServerScriptService.PlayerDataHandler)
PlayerDataHandler.Init()
game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function(player: Player)
local Profiles = PlayerDataHandler.Profiles[player]
print(Profiles)
local profile = Profiles.Data
if not profile then return end
print(profile)
return profile
end
This is my local script:
local data = game.ReplicatedStorage.RemoteFunction:InvokeServer(game.Players.LocalPlayer)
print(data)
Oh yes, my bad on that, I still can’t find the issue however.
try waiting a second before invoking server. I don’t think this is the issue, but I want to see if you are invoking the server before the data has been set.