Hey, so I am wondering how datastore plugins work because I been working on a plugin that uses the new roblox ban API and I got this error: BanAsync() can only be called on the server
It is a server script
Script:
local config: BanConfigType = {
UserIds = {2758548757},
Duration = 500,
DisplayReason = 'test',
PrivateReason = 'test2',
ExcludeAltAccounts = false,
ApplyToUniverse = true
}
local success, err = pcall(function()
return Players:BanAsync(config)
end)
if success then
print(success
else
warn(err)
end
So im wondering, if plugins dont have access to the server, then how do datastore plugins work?
I believe plugins are considered as both server and client when run. If you call RunService:IsClient() and RunService:IsServer(), they both return true.
So a plugin should have access to most server services, or at the very least DataStoreService. I’m not sure why there’s an exception for this function. Maybe they’re enforcing that it only be called in an actual server runtime environment?