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

Why doesn't this GUI make visible on group Rank not work?

Asked by 8 years ago
Edited 8 years ago

There is a script for getting your Group rank in another script that i made and i made it a PlayerStat IntValue but for some reason when i make it so that this GUI shows only for certain rank it does not work anything wrong?

if game.Players.LocalPlayer.PlayerStats.Rank.Value == "President" then
    script.Parent.Visible = true
end

1 answer

Log in to vote
1
Answered by
Hasburo 150
8 years ago
Edited 8 years ago

Heyo,

I honestly can't tell what the problem is due to the fact that you weren't very specific. The problem might be that you said you made the PlayerStat an IntValue, when it should be a StringValue.

I'd suggest doing this instead though, which is much more efficient.

local groupId = 0
local role = 0

if game.Players.LocalPlayer:GetRankInGroup(groupId) >= role then
    script.Parent.Visible = true
end

What this script does is it checks if the LocalPlayer's rank is greater than or equal to a specific rank number. All you need to do is change the variables (groupId and role) and then it should be good to go!

If you're confused, please leave a comment or refer to this

Ad

Answer this question