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

Trying to input a group info through the textbox on a brick and it won't work help?

I am trying basically input a group id through the textbox and it shows group info on the text label if it is possible showing the leader would be nice too on the right u input the userid and it shows user information and it shows their rank in the group on the left, I want it to be shown on the Brick Gui Textbox don't tell me how to display that I know I want it to be displayed on a textbox like on this:

https://gyazo.com/110a91bea2048ba2f6c4c447a3574054

https://gyazo.com/68f03807f55b42441c972284cd0e8d24

local groupId = 123
print(game.Players.Vecaxo:GetRankInGroup(groupId)) -- Outputs the name of the rank.
   -- 255 is the number of the highest role set in group terms. It's the
  --  owner basically.
--   Guests are 0.
if game.Players.Vecaxo:GetRoleInGroup(groupId) < 255 then
    print('vecaxo is not the owner of the group 123')
end

Please tell me what functions and ect I need to add to this script so it will work or any clues, or explainations or tutorials.

Thanks from ahead.

1 answer

✓ Accepted answer

The Issue

Instead of using the .Text property that is given, you're using the print command, which will just pop it up into the console for the owner's viewing. You will also get returned an error because it will automatically check for Vecaxo whenever any user joins the game, which causes the script to not work.

Solution

Added a PlayerAdded function, that get triggered everytime a player joins, then add an if statement that checks for the name, then if the name is what we're looking for, use the .Text property to change the text label.

Script

local groupId = 123 --Your group id thingy
local players = game:GetService('Players') --Gets the player service
players.PlayerAdded:connect(function(player) --Checks when a player is added
    if player.Name == "Vecaxo" then --Checks to see if it's the player we want
		script.Parent.Text = script.Name.." says that Vecaxo's Rank is "..player:GetRankInGroup(groupId).."."   
   		 if player:GetRoleInGroup(groupId) < 255 then
    			script.Parent.Text = script.Name.." says that Vecaxo is not the owner of the group."
    	end
		end
end)

If this helps, then please accept my answer. If this didn't answer your question, then please comment.

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