#how to rank lock team changer?

32 messages · Page 1 of 1 (latest)

surreal sparrow
#

I found this awesome team changer with great and simple ui but turns out it doesnt have a rank/group lock script anywhere and I was wondering how to do that while still keeping the ui

rapid charm
#

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

surreal sparrow
#

The problem is its only in one group

#

I need to check their rank/role

rapid charm
#

so you want to check for multiple groups?

#

or do you want to only check their rank/roles

#

or is it both?

surreal sparrow
rapid charm
#

do you want to figure this out yourself

#

or do you want some actual idea on how groupservice works

surreal sparrow
#

i would like some info or assistance, im not very familiar with lua

rapid charm
#

alright give me a second

surreal sparrow
#

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

rapid charm
#

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

surreal sparrow
#

yeah okay but what about the rank?

rapid charm
#

is this what you're talking about?

surreal sparrow
#

Yes the role

#

the role

rapid charm
#

alright wait

rapid charm
#

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

surreal sparrow
#

script or local script and where should i put it?

#

thank you btw this is helpful

rapid charm
#

server script

#

you don't want to give the local script the power to check for things most of the time

#

because exploiters can modify local scripts