I expect to get a true or false statement depending if BanningEnabled is true or false. The property does not exist and as stated by Documentation, it should be able to be read in Parellel. This is not the case.
This is intentional - the documentation mentions that this property is not scriptable and therefore cannot be read from/written to by scripts. You can change the property manually in the Studio window.
thank you for clarifying. This feels like a feature that should be readable, but I guess it can be detected from errors with :BanAsync. I should have read closer.
Edit
Made this code for Boolean behavior below:
local RuntimeService = game:GetService("RuntimeService")
local PlayerService = game:GetService("Players")
local function isBanningEnabled()
local newUserId = tonumber(2)
local config: BanConfigType = {
UserIds = { newUserId },
Duration = 1,
DisplayReason = "BANNINGENABLED.",
PrivateReason = "",
ExcludeAltAccounts = false,
ApplyToUniverse = true,
}
local success, err = pcall(function()
return PlayerService:BanAsync(config)
end)
if success then
return true
end
return false
end
if not RuntimeService:IsStudio() and isBanningEnabled() then
end