WooleyWool
(AWildWooleyWool)
June 26, 2020, 9:50pm
#1
Hi, i’m trying to send data from the Datastore2 to Firebase using the opensource code module. I am getting this error:
Here is my code:
local function coinsUpdated(updatedValue)
local PlayerCoinData = coinsDataStore:Get()
cash.Value = coinsDataStore:Get(updatedValue)
database:SetAsync(plr, HttpService:JSONEncode(PlayerCoinData))
end
1 Like
Affenity
(Visual)
June 26, 2020, 10:12pm
#2
If you read the documentation here you’ll see that SetAsync has to be a string.
The reason for the error is likely that it tries to do stringVariable .. YOUR_KEY
but it fails since you provided the player instance of a string.
1 Like
WooleyWool
(AWildWooleyWool)
June 26, 2020, 11:26pm
#3
So how would I convert it into a string?
Change the player instance to the player’s instance and then .UserId
WooleyWool
(AWildWooleyWool)
June 26, 2020, 11:51pm
#6
So i changed it to be player.UserId. I’m still getting the samne error