The datastore works fine in studio, but in game it just saves it everytime the game restarts.
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("Omaygawd3")
local Remote = game.ReplicatedStorage.RemoteFunction
function GetFingerPrintAsync(player)
local Fingerprint = Remote:InvokeClient(player)
return Fingerprint
end
game.Players.PlayerAdded:Connect(function(player)
wait(3)
local FingerPrint = GetFingerPrintAsync(player)
local FPDatabase = ds:GetAsync(FingerPrint)
local Tag = game.Players:FindFirstChild(player.Name):AddTag(FingerPrint)
if FPDatabase then
if table.find(FPDatabase,player.Name) then
print(FingerPrint)
player:Kick("Already found in database, alts :\n"..table.unpack(FPDatabase))
else
print(FingerPrint)
table.insert(FPDatabase,player.Name)
ds:SetAsync(FingerPrint, FPDatabase)
end
else
print(FingerPrint)
ds:SetAsync(FingerPrint, {player.Name})
end
end)
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("Omaygawd3")
local Remote = game.ReplicatedStorage.RemoteFunction
function GetFingerPrintAsync(player)
local Fingerprint = Remote:InvokeClient(player)
return Fingerprint
end
game.Players.PlayerAdded:Connect(function(player)
local FingerPrint = GetFingerPrintAsync(player)
local FPDatabase = ds:GetAsync(FingerPrint)
local Tag = game.Players:FindFirstChild(player.Name):AddTag(FingerPrint)
if FPDatabase then
if table.find(FPDatabase,player.Name) then
player:Kick(table.unpack(FPDatabase))
end
end
game:BindToClose(function()
task.wait(1)
if FPDatabase then
if table.find(FPDatabase,player.Name) then
else
table.insert(FPDatabase,player.Name)
ds:SetAsync(FingerPrint, FPDatabase)
end
else
ds:SetAsync(FingerPrint, {player.Name})
end
end)
end)
--[[\
if FPDatabase then
if table.find(FPDatabase,player.Name) then
player:Kick("Already found in database, alts :\n"..table.unpack(FPDatabase))
else
table.insert(FPDatabase,player.Name)
ds:SetAsync(FingerPrint, FPDatabase)
end
end
--]]