Hello, I’m making an event that returns a value from a module script. I have a module script inside server storage that holds data for the player. From there a server script retrieves the data and returns it to the client. The only problem is when I return it even though it does exist it returns nil.
Scripts:
local value = RetrieveData:FireServer("value1", "value2")
print(value) -- nil
local function onEvent(player, dataType, dataName)
local playerData = data:Return(player)
if playerData[dataType] and playerData[dataType][dataName] then
local value = playerData[dataType][dataName].Value
print(value) -- 100
return tonumber(value)
end
end
I know that since it’s a module script on the server it doesn’t exist for the client, but I’m returning a number and that should exist I think.
Thank you.