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

The TextLabel's text wont change for some reason?

The Text in the UI won't change, this only happened when I added anything to do with Regiment, before that The Username would show up, Any help?

local Groupservice = game:GetService("GroupService")
local Groups = {
	"9337585",
	"9337510",
	"9337562",
	"9337514",
	"9337548",
}




game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		
		local GroupID = "9275037"
		local GuiClone = script.BillboardGui:Clone()
		GuiClone.Parent =  Character:WaitForChild("Head")
		local TextLabel = GuiClone.Frame.TextLabel
		local GroupRank = Player:GetRoleInGroup(GroupID)
		
		local function FindRegimentGroup()
			for i, id in pairs(Groups) do
				local InRegiment = Player:IsInGroup(id)
				if InRegiment then
					local GroupRegimentRank = Player:GetRoleInGroup(id)
					return id
				end
			end

				
		FindRegimentGroup()
		
		local Regiment = Player:GetRoleInGroup(FindRegimentGroup())

		if GroupRank and Regiment then
			TextLabel.Text = Player.Name.."\n"..GroupRank.."\n"..Regiment
		elseif not GroupRank and not Regiment then
			TextLabel.Text = Player.Name.."\nGuest"
		elseif GroupRank and not Regiment then
			TextLabel.Text = Player.Name.."\n"..GroupRank.."\nRegimental Recruitment"
		end
			
		end
	end)
end)

1 answer

Is this on a script or local script, because scripts wont work to change the persons Gui, since scripts are not really good for changing text labels or text colors. Things that are handled locally such as Guis are usually done by local scripts, so in conclusion if you do need this to be a script then I suggest putting a remote event and firing it to a client which can change the text of the label.

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