Data via a RemoteFunction is returning void

Hello,

I was trying to get a DataStore key off of the server and onto the client but it’s returning void in the watcher.


This is the error I’m getting:
image

Code:

-- Client
	local data = game.ReplicatedStorage.Remotes.Check:InvokeServer(tostring(script.Parent.ID.ContentLabel.Text), 1)
	
	local IsBanned = data["IsBanned"]
--- Server
local function OnInvoke(p, Player,Intent,Table)
	if Intent == 1 then --Check status
		local data = BannedPlayers:GetAsync(game.Players:GetUserIdFromNameAsync(Player).."_BanV1")
		return data
...

game.ReplicatedStorage.Remotes.Check.OnServerInvoke = OnInvoke

Check your script syntax. This should be closed with an end statement.

It’s closed, I just cut out a lot.

Alright then. Before parsing with data.IsBanned, try making sure data exists. You could do this by either doing data = data or {} or if not data then return end.

1 Like

Turns out my issue is I was searching for 1 (or Roblox) in the database and because the account has never joined the game it was erroring.

1 Like