i tried to use BindToClose for once but it just didn’t work
what’s wrong with my code thats cusing it to shutdown instantly?? i even tried to yield. i’m so confused
game:BindToClose(function()
local attempt2 = ds.GetAsync({
DataStore = datastore,
Key = "MainServerQueue"
})
if attempt2 ~= nil then
attempt2 = game:GetService("HttpService"):JSONEncode(attempt2)
for i, entry in pairs(attempt2) do
if entry.JobId == game.JobId then
table.remove(attempt2, i)
ds.SetAsync({
DataStore = datastore,
Key = "MainServerQueue",
Value = game:GetService("HttpService"):JSONEncode(attempt2)
})
if require(script.Parent.Parent.Config).LogPrints == true then
print("🏔️ | 📜 | Server removed from SECRET PROJECT REDACTED FROM DEVFORUM server list!")
end
break
end
end
end
task.wait(3)
end)