Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

{SOLVED}How to disclaim "IsInGroup" method?

{SOLVED}I know the method IsInGroup, but I don't know how to disclaim it??

Well it be like IsNotInGroup? Or is there even a way to disclaim it?{SOLVED}

2 comments

0

What do you mean by "disclaim"?

0

I mean... I want the script to check if the player IS NOT in a group, instead of checking if he/she IS in a group.

1 answer

✓ Accepted answer

The unary logical operator not inverts a boolean statement.

That is, not true is false and not false is true.


IsInGroup returns a boolean, so not will work as expected with it, e.g.,

notinagroup = not player:IsInGroup(someGroupId)

Otherwise, in a clearer way, if ... else constructs can act depending on the truthy-ness of a statement:

if player:IsInGroup(someGroupId) then
	-- What to do if in group
else
	-- What to do if NOT in group
end

1 comment

0

Thanks.

This discussion is preserved as it was. New answers, comments, and votes are closed.