Ad
Log in to vote
-2

How to make custom chat commands that only work for people that are above a certain rank in a group? [closed]

Asked by 2 years ago

I want to make a custom chat command that will only function if the player is above a certain rank in a group. How can I do that?

0
This is not a request website IAmNotTheReal_MePipe 418 — 2y

Closed as Not Constructive by User#32819, jediplocoon, PrismaticFruits, Nguyenlegiahung, and zblox164

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
2
Answered by
pwx 1546 Moderation Voter
2 years ago

It would have been great if you at least made an attempt. But what you'd have to do is define the Player, then create a function for when they chat.

-- [[ SERVICES ]] --

Players = game:GetService('Players')

-- [[ MAIN SCRIPT ]] --

Players.PlayerAdded:Connect(function(Player)
    Player.Chatted:Connect(function(Message)
        if Player:GetRankInGroup(0) >= 1 then -- change 0 to GroupId, change 1 to minimum RankId
            -- message stuff here
        end
    end)
end)
0
thank you! just for confirmation, this is a script that will go into ServerScriptService right? airsoft561 -3 — 2y
0
Yes Spjureeedd 385 — 2y
Ad