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

Groupid Rank GUI Transparency Help?

So I am not that good as a scripter and this did not work. I just want it so if the groupid = 2864146 then it checks what rank you are and if you are a Waiter Rank, the GUI is not transparent, but if the rank is not a waiter, the gui is transparent. Please help. Thank you.

Groupid = 2864146
Min = 4	
Max = 255

if Groupid rank = Waiter
	then script =  true
else = script.Parent = false
end


if game.Players.LocalPlayer.Name ~= "" and game.Players.LocalPlayer:GetRankInGroup(Workspace.GiveSystem.GroupID.Value) < Workspace.GiveSystem.RankID.Value then
	return
end

1 answer

✓ Accepted answer

You seem unsure of the basics of scripting so I recommend you start with practicing changing the color of a brick, or changing the position of a brick before you start getting into scripting guis.

local groupId= 2864146
local plr = game.Players.LocalPlayer
local guiPath = plr.PlayerGui.ScreenGui.DesiredGui --edit this path to be the gui you want to change

guiPath.Visible = (plr:GetRoleInGroup(groupId) == "Waiter")

--alternative based on the rank number instead of the role name
local waiterRank= 4 
guiPath.Visible = (plr:GetRankInGroup(groupId) == waiterRank)

The rank number method is recommended to remove dependency on the exact role name. For example, if the role in the group is "waiter" and you compare it to "Waiter" it will return false and the gui wont show up.

This is an alternative for the last line that has the exact same effect, but is easier to understand.

local role = plr:GetRoleInGroup(groupId)

if role == "Waiter" then --make sure that the name matches exactly including case.
	guiPath.Visible = true
else
	guiPath.Visible = false
end

--and for the rank method

local waiterRank = 4
local rank = plr:GetRankInGroup(groupId)

if rank == waiterRank then
	guiPath.Visible = true
else
	guiPath.Visible = false
end

7 comments

0

I still do not understand it. Do I insert the script into a LocalScript or a regular Script?

0

Since I used LocalPlayer, it is a LocalScript.

0

That is what I thought. Should I place this in the screen GUI?

0

You can put it anywhere a LocalScript will run (replicated storage, playergui, etc.) as long as you put the correct path on line 3 of the first code block.

0

Yeah, I am having trouble with that. Here is how I have it:

0

So I have it so that the StarterGui is the parent of the Gui I want to be transparent unless the rank is a waiter but here is the script: local groupId= 2864146 local plr = game.Players.LocalPlayer local guiPath = plr.PlayerGui.ScreenGui.DesiredGui --edit this path to be the gui you want to change guiPath.Visible = (plr:GetRoleInGroup(groupId) == "Waiter")

0

If you put this script inside the gui, replace line 3 with "local guiPath = script.Parent"

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