I want to make session locking to fix a few trading duplication glitches found in my game. This is what I got so far:
local lock = {};
local dss = game:GetService("DataStoreService")
local locked = dss:GetDataStore('SessionLocked1.1')
game.Players.PlayerAdded:Connect(function(player)
if not locked:GetAsync(player.UserId) then
locked:SetAsync(player.UserId, "Unlocked")
end
end)
lock.CreateSessionLock = function(player)
if locked:GetAsync(player.UserId) ~= 'Unlocked' then
print('Already sessioned locked!')
else
locked:SetAsync(player.UserId, game.GameId)
lock.StartUnlockSection(player, game.GameId);
end
end
return lock;
I’m not sure where to go next.