Datastore modulehelp

I have made this module thing for storing player data
please give feedback for changes or something as I am unexperienced with datastores

local dserv = game:GetService("DataStoreService")
local plrstore = dserv:GetDataStore("SimplySavePlr")
local plrs = game:GetService("Players")
local ver = game.ReplicatedStorage.Version.Value

local plrdata = {}
plrs.PlayerAdded:Connect(function(plr)
	local result = plrstore:GetAsync(tostring(plr.UserId) .. "SavedAT")
	if result ~= nil then
		plrdata[tostring(plr.UserId)] = plrstore:GetAsync(tostring(plr.UserId) .. tostring(result))
	else
		plrdata[tostring(plr.UserId)] = {}
	end
	while true do wait(60)
		plrstore:SetAsync(tostring(plr.UserId), plrdata[tostring(plr.UserId)])
		plrstore:SetAsync(tostring(plr.UserId) .. "SavedAT", ver)
	end
end)

plrs.PlayerRemoving:Connect(function(plr)
	plrstore:SetAsync(tostring(plr.UserId), plrdata[tostring(plr.UserId)])
	plrstore:SetAsync(tostring(plr.UserId) .. "SavedAT", ver)
end)



local module = {}

function module.Save(plr, key, value)
	plrdata[tostring(plr.UserId)][key] = value
end

function module.Get(plr, key, value)
	return plrdata[tostring(plr.UserId)][key]
end

function module.WipeData(plr, key)
	if key ~= nil then
		plrdata[tostring(plr.UserId)][key] = nil
		plrstore:SetAsync(tostring(plr.UserId), plrdata[tostring(plr.UserId)])
	else
		plrstore:SetAsync(tostring(plr.UserId) .. "SavedAT", ver + 1)
	end
end

not entirely sure, but modules can’t handle events, they can only have functions and variables in them

im 99% sure modules act like scripts but they have to be required and usually return stuff like the functions

exactly, but you can’t require .PlayerAdded from the module, right?

from my testing they can run any code put in em but they also can return stuff

i think you still should try using normal scripts, and they will require the functions from the module (also try using prints in module scripts to see if it’s running the code or not)

you shouldnt talk about something you barley understand go test it and see for yourself!

This should be in #help-and-feedback:code-review if you want improvements on your script that already works.