So I have a script that checks to see if the game is updated then warns players and kicks everyone. The problem is that EVERY time I join (In studio, IDK about in game), it says that the game was updated. My script:
local DSS = game:GetService("DataStoreService")
local lastUpdated = DSS:GetDataStore("LastUpdated")
local function CheckForUpdate()
if game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Updated ~= lastUpdated:GetAsync("LastUpdated") then
lastUpdated:SetAsync(game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Updated)
status.Value = "The game has been updated!"
for i = 10, 0, -1 do
seconds.Value = i
wait(1)
end
for i, player in pairs(game.Players:GetPlayers()) do
player:Kick("The game has been updated! Please wait a minute, then join a new server.")
end
end
end
EDIT: It gives me an error on line 6: Argument 2 missing or nil.
