In my game, I want a player to only be able to chose a certain role if they are in a specific group. How can I do this?
It's easy, just get the player from game.Players (or from "game.Players.PlayerAdded") and then check using "PartOfGroup = Player:IsInGroup(GroupID)". The ":IsInGroup()" checks if a player is in a group then returns a true or false value (which is stored in the "PartOfGroup" variable).
If you want the documentation itself check it here: https://developer.roblox.com/en-us/api-reference/function/Player/IsInGroup
If you have any questions or issues contact me. ;)
You really need to give us more info but here's what I can do with your info:
You can just use an if statement:
local player = game.Players.LocalPlayer if player.Group == "Group" then -- change the group to your group path and change the "Group" to your group name, I highly suggest you use teams, this would make it a lot easier role.Visible = true -- Again, change role to the path of your role end
Please do some more research and next time give us some more information! I highly suggest you research teams and remote events, they will probably help you here! If I helped in the slightest please accept this answer!