I am trying to make a script that only people whit a certain rank or above in a roblox group, can see a gui but it dosen't work
I've tried a lot of different things, nothing worked, here is my current script...
local Player = game.Players.LocalPlayer
local GUI = game.StarterGui.ScreenGui.Frame
local Button = game.StarterGui.ScreenGui.Frame.TextLabel
local Minimun = 250 -- Rank Premisions Currently
local groupId = 5445897 -- Group ID
if Player:GetRankInGroup(groupId) >= Minimun then
GUI.Visible = true
Button.Visible = true
else
print("U get no GUI")
end
Can someone help?

3 comments
The script is located in ServerScriptService Btw, is this correct?
Also this is a ServerScript Not a Local Script, idk if this is correct too.
if you're using a serverscript you can't use LocalPlayer