I simply need to check if a player has any saved data, and the Entry Menu to act accordingly.
I have a RemoteFunction “Profile” stored in a folder in Replicated Storage, the client invokes it, and the server checks to see if they have played before.
Oddly enough, nothing happens, and I find out that the server function is not even running to begin with.
Client Script:
local UserProfile = Events.Profile:InvokeServer()
if UserProfile ~= nil then
--load
else
--(removed for simplicity)
end
Server Script:
function GetProfile(player)
local Name = player.Name
if _G.PLAYER_DATA[Name] == nil then return nil end
if _G.PLAYER_DATA[Name].Data.Profile.RPName == "" then return nil end
return _G.PLAYER_DATA[Name].Data.Profile
end
Events.Profile.OnServerInvoke = GetProfile
I have troubleshooted the issue to find that all loops in any involved script does not yield forever, and allows the client to invoke the server with Profile. I also know that the client does invoke the server, but the GetProfile function does not run.
Is this an issue with the engine, or am I missing something?
EDIT: The Interface that handles player currency is also not working properly, which may indicate that all of the RemoteFunctions (and possibly Events) are not being handled by the server either.
Add in some print statements just before the client sends the request to the server, and when the server receives that request. The information you’ve provided isn’t enough to figure out what’s wrong.
First you need to know if it’s the client’s fault or the server’s fault.
I am a bit embarrassed to say that the issue was that is in one of the event connections, I forgot to use OnServerEvent and directly used Connect to the RemoteEvent object, which hindered the other connections.