How would I restrict a GUI (within a LocalScript) to a certain rank only?
I have tried myself but did not work out. Could you give me an example?
How would I restrict a GUI (within a LocalScript) to a certain rank only?
I have tried myself but did not work out. Could you give me an example?
What do you mean a rank?
A group rank. So for instance group rank is >= 30 (rank id).
local plr = -- define the player
if plr:GetRankInGroup(groupid) >= 30 then
end
You could have a localscript within the GUI and do:
local player = game:GetService("Players").LocalPlayer
if player:IsInGroup(GROUPID) then
if player:GetRankInGroup(GROUPID) < 30 then
script.Parent:Destroy()
end
else
script.Parent:Destroy()
end
You defined player
as the service, not the localplayer.
Whoops fixed it now was typing fast
Thank you lot, both helped. Just a heads up, you forgot to reference to GroupService, not sure if it’s needed, but here it is.
Thanks anyways, it worked.
local GroupService = game:GetService("GroupService")
GroupService isn’t really needed for this. You can just run the function on the player.