So I’m sending data to add to a custom leaderboard, which every player has.
The problem is that its giving out a nil on the client.
Server:
if Data ~= nil then
local datatoSend = {
['Username'] = player.Name,
['Coins'] = Data.Coins,
['Rebirths'] = Data.Rebirths,
['level'] = Data.Level,
}
server.fireallclients(7, datatoSend) -- to add to leaderboard
end
client:
events.RemoteEvent.OnClientEvent:Connect(function(atype, data)
print('updating leaderboard!')
if atype == 7 then
local playerName, coins, rebirths, level = table.unpack(data)
print(playerName)
end
end)