I own a Hotel and I really want to give only certain tools to certain group ranks in my group games. How do I do that?? Please help me.
COMMUNITY QUESTION
How do I make a script that gives only certain tools to certain ranks in my group games?
1 answer
You can use Player:IsInGroup(GROUP ID) to check if a player is in a specific group.
Example:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
if player:IsInGroup(372) then
print(player.Name .. " is in the Scripting Helpers group!")
end
end)
Furthermore, if you want to check the player's rank in the group, you can use Player:GetRankInGroup(GROUP ID). This method acts a check if the player is in the group as well because their rank is defined as 0 if they are not in the group, otherwise their rank is between 1 to 255 depending on how the group's ranks are managed. If you are the group owner then you can change the rank numbers.
Example:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
if player:GetRankInGroup(372) == 1 then
print(player.Name .. " is a member of the group.")
end
if player:GetRankInGroup(372) == 255 then
print(player.Name .. " is the owner of the group.")
end
end)
From there, you just clone the tool(s) you want into the player's backpack.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Try it yourself, first.