I am making a checker for corruption for a group i’m in. I’m not that good at scripting. I have tried this but it dosnt work.
local NRB = 4734688
local RC = 3880488
player = plr.name
Flag1 = "Player in NRB and RC"
if player in NRB and RC then
print("Player:"+Player+"Flag Reason:"+ Flag1)
end
In order to check if a player is a member of a group, you can use Player:GetRankInGroup().
Try this code:
local Players = game:GetService("Players")
local NRB = 4734688
local RC = 3880488
Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(NRB) > 0 and Player:GetRankInGroup(RC) > 0 then
print("Player: " .. Player.Name .. " flagged; Player in NRB and RC.")
Player:Kick("Corrupt member.")
end
end)
Code summary:
Whenever a player joins, it checks if they are in the Nighthawk Reaper Batallion and The Red Cell. If they are members of those groups, it will print that they are flagged. Whatever you wish to do to members of this group, make sure to put inside the if statement. I added an extra kick feature, as it seems you want to disallow these players from your game. Take it out if I misinterpreted.
You do realize there is a function for this, called IsInGroup() right? It returns a Bool depending if they are in the group or not (But I suppose that works too, just that I’d recommend using the more logic-based one)
local NRB = 4734688
local RC = 3880488
local Flag1 = "Player in NRB and RC"
game.Players.PlayerAdded:Connect(function(Player)
if Player:IsInGroup(NRB) and Player:IsInGroup(RC) then
print("Player: "..Player.Name.."flagged. Reason: ", Flag1)
Player:Kick("No")
end
end)
(Btw both of these scripts should belong in ServerScriptService as a Server Script)
Never knew this was a method! Thanks for the information. Anyways I would still choose checking the rank over whether they are in the group or not just for more capabilities with it, but thank you for the input.
15:21:15.233 Player: Aapocalypse_Gamingflagged. Reason: Player in NRB and RC - Server - Script:8
15:21:15.234 Scaned All Corruptions. - Server - Script:9
local NRB = 4734688
local RC = 1174414
local Flag1 = "Player in NRB and RC"
print("Scanning...")
game.Players.PlayerAdded:Connect(function(Player)
if Player:IsInGroup(NRB) and Player:IsInGroup(RC) then
print("Player: "..Player.Name.."flagged. Reason: ", Flag1)
print("Detected Corruptions.")
end
end)
print("Scanned.")
If you’re testing this on a “Play Solo” simulation, it’ll only work for you
PlayerAdded should fire as soon as a Player first joins the game? Did you remember to referenc it inside ServerScriptService? (Also that’s not my updated code)
Not really, but I suppose I can give you some insights on where to search:
HTTPService provides the ability to create integration as long as they’re third-party based URLs (Supposedly they’re used for obtaining information outside of other websites, such as youtube.com, randomwebsite.com, etc)
I suppose you can search how to create your own proxy so that you can create your own website out of ROBLOX’s domains