Hi, so I’m not much of a scripter but I need a little help with this.
I know it might be really simple but I just don’t know the solution.
I have been trying to make a “Hidenames” command, where when someone over the rank of 11, if they say “.hidenames” then it will hide everyone’s names. My game uses a custom overhead Gui. It inserts a BillboardGui, which displays the rank and name.
The path of the overhead GUI is: game.Workspace.[PLAYER].Head.Rank
“Rank” is the BillboardGui
I can’t find a way to run through every player in the game and destroy the GUI, however this is what I want to achieve.
Current script:
local group = 13962134
local minrank = 11
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(Message)
if Message == ".hidenames" then
if player:GetRankInGroup(group) >= minrank then
for i,v in pairs(game.Players:GetChildren()) do
--????.Head.Rank:Destroy() *im not sure if this is the correct thing to use and confused on what to use (where the ???? is)*
end
end
end
end)
end)
So, overall what I want to know is how do I run through every player in the server, and destroy their Overhead GUI. I don’t know if the use of “for i,v” is correct, as I’m not much of a scripter. If it isn’t, please tell me the correct way.