local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("Test2")
local RequestData = script.Parent:WaitForChild("RequestData")
script.Parent.RequestData.OnServerInvoke = function(ClientName, Name)
local success, Data = pcall(function()
return DataStore:GetAsync(Name)
end)
if not success then
warn("Error!")
end
return Data
end
That is the server script which gets the data and then returns it back the the local script. The problem is that the returned data doesn’t “arrive” at the local script. The data is a saved table.
The line of code which should get the returned data:
local Data = RequestData:InvokeServer(PlayerName)