Alright, I've made a datastorage script but it is completely ignoring the value, I understand what the issue is, the value for some reason "doesn't exist" but I dont know how to fix it, Its clear that the **SERVERSCRIPT ** is unable to access it, where else would I put it (i tried in character, but it ignores the value)
btw this error has NOTHING to do with datastorage , any help? (ps the cash is inside StarterPlayerScripts that is then inside PlayerScripts i cant access playerscripts but idk where else to put it)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
saveMoneyEvent = game.ReplicatedStorage.saveMoneyEvent
HttpService = game:GetService("HttpService")
local function onSaveMoneyFired(player, money)
print ("saving...")
player:FindFirstChild('cash').Value = money --issue
local databaseService = require(game.ServerScriptService.DatabaseService)
local globalDatabase = databaseService:GetDatabase("Global")
print (money) --issue via chain reaction
local frank = HttpService:JSONEncode(money) --issue via chain reaction
print(frank) --issue via chain reaction
print(HttpService:JSONDecode(frank)) --issue via chain reaction
globalDatabase:PostAsync(player.Name, frank) --issue via chain reaction
end
saveMoneyEvent.OnServerEvent:Connect(onSaveMoneyFired)

7 comments
im very confused.
the money value on line 7 is a nil value (doesnt exist) and its because the script cant access PlayerScripts, im unsure where to put the "cash" value instead
what kind of name is ____
sorry, forgot to explain what i meant by ____ its just a general thing that im trying to understand about indexes, but the thing that cant be found is "money"
Show your localscript please
Put the cash in leaderstats. So make a leaderstats folder that you'll place in Player, then insert the cash value into there.
i dont want to use leaderstats, i want the money value to not be able to be seen, without disabling the leaderboard gui thing