Hello, I am trying to check if the player that just joined is a mod in my group. Here is what I did.
game.Players.PlayerAdded:Connect(function(player)
print(“Checking rank…”)
if player:GetRankInGroup(12563062) >= 100 then
panelButton.Visible = true
print(“Is mod.”)
else
panelButton.Visible = false
print(“Isn’t mod.”)
end
end)
This is in a local script in my moderation panel GUI. The script is called “Handler”. I’m trying to check if the player that just joined is a certain rank in my group. In the output, it’s not even putting “Checking Rank…”
I would highly suggest you would make it into a script in serverscriptservice, put the UI inside of it, then clone the UI into the plr that joined’s playergui if it meets the requirements to prevent exploiters from getting access to the panel by just making it visible.
Last question (Sorry, I just kinda started and have many questions.)
So, inside of the the GUI I have many other frames that I make visible if the user clicks a button.
Would I just do UI.Menu.Visible = true ?
Why are you adding a PlayerAdded event to a LocalScript? This is going to make it visible for everyone else who joins if somebody with that rank joins, and wouldn’t even fire for you as the UI is replicated onto the client after you join.
local player = game.Players.LocalPlayer
local panelButton = script.Parent:WaitForChild('ModerationPanel')
if player:GetRankInGroup(12563062) >= 100 then
panelButton.Visible = true
print("Is mod.")
else
panelButton.Visible = false
print("Isn’t mod.")
end
(This only applies to the local version Zivao sent, not the serversided one)
If Corey doesn’t make checks for his admin actions buttons (such as check the plr’s group rank everytime he uses the admin event), exploiters will be able to use them by just making the frame visible.
Yea, I recommend you also secure your serversided events and don’t rely on frame visibility because you might as well make it accessible for everybody if you’re going to do that.