BAE | Change titles per type of message

So as you know, Basic Admin hints have the Title textLabel that display’s the user’s username that ran the command. I wanted to add a [ Rank ] tag next to the username (group rank) which I did. Below you can see the single line of code I’ve used:

topTitle.Text = Title .. '<font transparency="0.65"> [ ' .. Player:GetRoleInGroup(15886999) .. ' ] </font>'

The only issue I’m facing and need help is with errors and server messages. Apparently, since Player is the parameter used, the code finds the player who used the command and then displays the user’s grouip rank on the Error message/server message. Here is what I mean:

So when a Error message/server message appears the rank role is still being shown and you want to avoid this?

Yep, that’s what I’m asking help with.

It’s been a while since I’ve worked with basic admin, can you get the type of event and edit the title based of that?

try this

topTitle.Text = Title == "Server Message" and Title or Title .. '<font transparency="0.65"> [ ' .. Player:GetRoleInGroup(15886999) .. ' ] </font>'

It could be the other way around but im not sure.

1 Like

Interesting approach, this may do the job but I’m not sure if it’s the best way.

It really is, at least as far as i see, it dosent use unnessecary code and uses less space (also is inline)

1 Like

So this worked, but I have to do this with the hint as well and it’s unfortunately not working as hints have Data[1].

Sorry, can you send the hint code, I really do not remember.

The following is the hint code:

hintTitleText.Text = Data[1].. '<font transparency="0.65"> [ ' .. Player:GetRoleInGroup(15886999) .. ' ] </font>'

So, what are you trying to acomplish, do you have like an anonymous header? If so whats the title, that would be what you replace
"Server Message" with.

This is their problem:

They have made it so on the ‘h’ and ‘m’ command it displays the players rank in a group on it.

But, when it comes to server messages and feedback hints, it still says the players rank next to the ‘Server Message’ title.

They would like it so it would not display next to the title on messages/ hints that don’t have the players name on it.

You can ultimately acomplish your end goal by doing the following

hintTitleText.Text = Data[1] == "Server hint or whatever the title is for your server hint" and Data[1] or Data[1] .. '<font transparency="0.65"> [ ' .. Player:GetRoleInGroup(15886999) .. ' ] </font>'

I did that. My mainModule has more titles that the hintTitleText gets replaced with. I’ve tried adding "text one" or "text two" or "text three" but that does not work, instead breaks the code.

thats more likely an if statement, like if Data[1] == "some message" then textObject.Text = "whatever" end

Hi thank you, so I did it with using your code but modified it a bit to make the hint work and organize it. The issue I’m getting with the message while using this technique is that the group rank is not appearing. My code is:

local messageTitle = {
			"Server Message",
			"Shakiez Announcement",
		topTitle.Text = Title == "Error" or messageTitle and Title or Title .. '<font transparency="0.65"> [ ' .. Player:GetRoleInGroup(15886999) .. ' ] </font>'

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.