Hi I’m Todd,
I’m pretty new to scripting but have been able to grasp the very basics. I wrote a script that bans a user and bans any groups based on the GroupId or UserId. Could this be rewritten to perform more efficiently, and in the future if I wanted to add a data store how might I go about that.
-- Made by Todd_Hanover --
Banlist = {6401085}
PlayerBan = {1464494152, 1424426252, 1455888197, 1352806198, 1380397355, 1374496301, 1411119553, 1455853266}
game.Players.PlayerAdded:Connect(function(Player)
for i,v in ipairs(PlayerBan) do
if Player:IsInGroup(v) then
Player:Kick("You have been Banned, for Appeals join the group's communications")
end
end
for i,v in ipairs(Banlist) do
if Player:IsInGroup(v) then
local group = game:GetService("GroupService"):GetGroupInfoAsync(v)
Player:Kick("In order to join, please leave ".. group.Name)
end
end
end)
any help is appreciated, thanks.