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)
Remove the line that you have an issue on. In your localscript pass your money ex:
event:FireServer(money.Value)