Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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?

0
The script is located in ServerScriptService Btw, is this correct? Piloten2008YT1 34 — 4y
0
Also this is a ServerScript Not a Local Script, idk if this is correct too. Piloten2008YT1 34 — 4y
0
if you're using a serverscript you can't use LocalPlayer OhManXDXD 445 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
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.

Ad

Answer this question