Hello! I own a hotel where certain ranks get certain tools, how could I make a script that automatically gives a certain rank certain tools?
Thanks,
George.
Hello! I own a hotel where certain ranks get certain tools, how could I make a script that automatically gives a certain rank certain tools?
Thanks,
George.
there is a method in the player object called Player:GetRankInGroup(GroupId) and another one Player:GetRoleInGroup(GroupId) the first one gives you the number of that account, the second one gives you the name. I’d use the first one to cut down on code but it’s up to you.
I’d use :GetRankInGroup() in an if statement everytime a new player joins.
So something like this
local tool = (tool location)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if player:GetRankInGroup(id) (< or > or =) (rank number) then
tool.Parent = player.Backpack
print(char.Name…"'s tools have been given")
end
end)
end)
Please correct me if I’ve made any mistakes.
You should fire this when their character is added!
My bad I’ll correct the script now