I'm testing this, because previously I tried to return a value from a table that's stored inside a datastore, but it kept on returning nil aswell. But right now, it's just supposed to return a simple string. I have no idea why this happens.
LocalScript:
local plr = game.Players.LocalPlayer
wait(1)
local text = game.Lighting.Remotes.GetName:FireServer(script.Parent.Slot.Value)
wait(1)
print(text)
ServerScript:
game.Lighting.Remotes.GetName.OnServerEvent:connect(function(plr, slot)
local ds = game:GetService("DataStoreService"):GetDataStore("datastore["..slot.."]"..plr.UserId)
local key = "key"..plr.UserId
ds:GetAsync(key)
return "Test"
end)

1 comment
Yes, someone else had already answered that before, but i'll accept anyways.