-- [[ Dummiez's Data Store Score Board ]]
-- This script updates the Data store with the values from the remote function.


wait(1)

local score = game:GetService("DataStoreService"):GetOrderedDataStore(script.DataStore.Value)

function script.UploadScore.OnServerInvoke(player)
	print("working")
	local inv = player:FindFirstChild(script.Original.Value)
	local storedValue = inv:FindFirstChild(script.Score.Value).Value ~= 0 and math.floor(math.log(inv:FindFirstChild(script.Score.Value).Value) / math.log(1.0000001)) or 0
	score:SetAsync(player.Name,storedValue)
	--score:SetAsync(player.Name, inv:FindFirstChild(script.Score.Value).Value)
	print("worked")
end
