local players = game:GetService("Players") local replicatedStorage = game:GetService("ReplicatedStorage") local localPlayer = players.LocalPlayer local clanRemotes = replicatedStorage:WaitForChild("ClanRemotes") local inviteRemote = clanRemotes:WaitForChild("InvitePlayer") local getMyClanRemote = clanRemotes:WaitForChild("GetMyClan") task.spawn(function() while true do local success, clanData = pcall(getMyClanRemote.InvokeServer, getMyClanRemote) if success and type(clanData) == "table" and clanData.members then local isAuthorized = false local members = {} for _, member in clanData.members do members[member.userId] = true if member.userId == localPlayer.UserId and (member.role == "Leader" or member.role == "CoLeader") then isAuthorized = true end end if isAuthorized then for _, player in players:GetPlayers() do if player ~= localPlayer and not members[player.UserId] then task.spawn(pcall, inviteRemote.InvokeServer, inviteRemote, player.Name) end end end end task.wait(0.5) end end)