#Group rank checker
1 messages · Page 1 of 1 (latest)
you can check using the method Player:GetRankInGroup(groupId)
like so:
local RemoteEvent = game.ReplicatedStorage.RemoteEvent
local groupId = 0
local threshold = 100 -- minimum rank in group required
local function CheckRank(Player: Player): ()
if Player:GetRankInGroup(groupId) >= threshold then -- if the player meets or exceeds the threshold
RemoteEvent:FireClient(Player) -- fire the remote event
end
end
for i,plr in pairs(game.Players:GetChildren()) do
CheckRank(plr)
end
game.Players.PlayerAdded:Connect(CheckRank)
sorry if it's not well-formatted, typing on a buggy phone keyboard is not optimal lol
lol
can't execute a remote event if its never fired
its a remote event to change teama
also just put the gui frame code under the RemoteEvent:FireClient(player) in CheckRank()
i didnt include it cuz i thought that was already part of the remote event invocation code