game.Players.PlayerAdded:Connect(function(player)
local PlayerInMoreThanAGroup = {733857232, 88849958}
if game.Players:GetPlayerByUserId(PlayerInMoreThanAGroup) ~= nil then
Regiment.Value = "MP+"..player:IsInGroup(4510669, 4560842, 4560830, 4561186, 4560837, 4561172).Value
Rank.Value = player:GetRoleInGroup(4510669)
end
end)
So i have this script that gets the player userId when the player enters the game. Then if the player userId in the table is not equal to nil then it will do the following function.
Im also sure that theres also something wrong with the Regiment.Value, basically i was trying to change the Regiment.Value if the player is in more than one group(groupId above) like for example u are in a group called Military Police and another group called Special Forces then the Regiment.Value will be MP+1, Meaning Military Police + 1 more group.
Any idea? All the helps will be greatly appreciated :)

6 comments
https://developer.roblox.com/api-reference/function/Player/IsInGroup
You can only use :IsInGroup on one group at a time.
Also, .Value is not a valid member of a Boolean. :IsInGroup returns a boolean value, that is it.
Also, you cannot put an array into the :GetPlayerByUserId, it only expects one UserId.
You're trying to refer to the whole table which would return the hexademical address of the table and to get the actual values inside of that table you have to do a for loop on it.
@Phlegethon5778 Yeah man, I solved it myself, thats exactly what i did, anyway thanks for answering! @HilyrHere Its ok man, I solved it myself, anyway, thanks for answering!