First thing you can do is test this in an actual game server.
Second thing you can do is using RunService.IsStudio
to create another data store system for testing within studio.
An example:
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
if RunService:IsStudio() then
local Name
for i, v in ipairs(Players:GetPlayers()) do
if v.UserId == tonumber(data.key) then
Name = v.Name
end
end
end
Edit:
I corrected the code. I made a minor typo