Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

{SOLVED}How to disclaim "IsInGroup" method?

Asked by 9 years ago

{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}

0
What do you mean by "disclaim"? BlueTaslem 18071 — 9y
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. kudorey619 138 — 9y

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

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
0
Thanks. kudorey619 138 — 9y
Ad

Answer this question