Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help whit a script More info in decs. It didn't work? ( I need help asap )

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

0

The script is located in ServerScriptService Btw, is this correct?

0

Also this is a ServerScript Not a Local Script, idk if this is correct too.

0

if you're using a serverscript you can't use LocalPlayer

1 answer

✓ Accepted answer
local Player = game.Players.LocalPlayer
local GUI = Player.PlayerGui.ScreenGui.Frame
local Button = Player.PlayerGui.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

Anything in the StarterGui automatically gets copied into the PlayerGui inside of a player when the game starts. So, you need to make edits to the player's PlayerGui.

This discussion is preserved as it was. New answers, comments, and votes are closed.