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

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

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?

1 comment

0

This is not a request website

1 answer

✓ Accepted answer

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)

2 comments

0

thank you! just for confirmation, this is a script that will go into ServerScriptService right?

0

Yes

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