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

Groupid Rank GUI Transparency Help?

Asked by 7 years ago

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

Log in to vote
2
Answered by 7 years ago

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
0
I still do not understand it. Do I insert the script into a LocalScript or a regular Script? BunnyFilms1 297 — 7y
0
Since I used LocalPlayer, it is a LocalScript. GoldenPhysics 474 — 7y
0
That is what I thought. Should I place this in the screen GUI? BunnyFilms1 297 — 7y
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. GoldenPhysics 474 — 7y
View all comments (3 more)
0
Yeah, I am having trouble with that. Here is how I have it: BunnyFilms1 297 — 7y
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") BunnyFilms1 297 — 7y
0
If you put this script inside the gui, replace line 3 with "local guiPath = script.Parent" GoldenPhysics 474 — 7y
Ad

Answer this question