#how to rank lock team changer?
32 messages · Page 1 of 1 (latest)
https://create.roblox.com/docs/reference/engine/classes/GroupService there are methods that could help you in achieving your desired effect
you can do button.active = false if you check that they're not in a rank/group
what it does is basically make it so that the button doesn't detect any input, so that they won't be able to access the the locked buttons until you detect they join a group and do button.active = true
so you want to check for multiple groups?
or do you want to only check their rank/roles
or is it both?
this
do you want to figure this out yourself
or do you want some actual idea on how groupservice works
i would like some info or assistance, im not very familiar with lua
alright give me a second
i presume I would need a script somewhere that defines the group and then checks a persons role to show/activate teams depending on their role
or at least let them/or not to join the team they click
you're kinda correct, you'll need to check for if the player's inside of a group or not, then activate or deactivate the button, depending on whether they're inside of the group or outside of the group, but i'd like to do this check for whether they're in group or not before they click the button
https://create.roblox.com/docs/reference/engine/classes/GroupService#GetGroupsAsync this method here can give you your desired effect of checking if the player's inside of a group or not
yeah okay but what about the rank?
alright wait
local Gs = game:GetService("GroupService")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(plr)
local playerrole = plr:GetRoleInGroup(PUTGROUPIDHERE)
if playerrole == " PUTYOURRANKNAMEHERE " then
print("IFTHISPRINTSTHENITWORKS")
plr.PlayerGui.BUTTONNAMEHERE.Actived = true
else
plr.PlayerGui.BUTTONAMEHERE.Actived = false
end
end)
i think it could've been done better but it'll still work