Need help modding this Basic Admin Script

Hello everyone! I need help modding this script from Basic Admin Essentials 2.0! This script below is the script that sends a PM (Private Message) to a user.

pendNotif("Private Message","From "..Sender.. '<font transparency="0.65"><font face="Gotham"> [ Admin ]</font></font>',{"Receive",Sender,Data,true,ID})

I am trying to make it so next to the senders username is says their admin level, or “[Admin]” as shown below.

The problem is, with this script, it says [Admin] next to everyone’s name, even non-admins.

I am hoping to get help on how to fix it so that the users admin level will appear in brackets [] next to the senders username.

Any help is greatly appreciated!

2 Likes

Is ‘Admin’ a variable initiated previously? If it is then you would need to place quotation marks before and after where it says Admin as it isn’t calling the variable, it’s just continuing the string.

Unfortunately, it is not. I need help with trying to state the admin level, then placing it within the line of code. All though on the bright side, I know this is possible because other groups are currently doing it/using it. :+1::smiling_face_with_tear:

Personally, I would initiate the variable first as a blank variable, like so

local Admin

After that I would then set the Admin variable based on whether the player has ranks in a group, is in a group, or etc.
This would become something like:

local Admin
if Player:GetRankInGroup(GroupId) => 100 then
   Admin = "Admin"
elseif Player:IsInGroup(GroupId) then
   Admin = "Member"
else
   Admin = "Guest"
end
1 Like

get the source code, it might be easy to modify.

I have the source code already, it’s just that the admin levels are defined in the module script but the action of the PM being sent is done in another script “Essentials Code”. Therefore I’m confused on how to define the admin level, because it’s supposed to vary between which admin level the player is. There are multiple admin levels and they are given upon joining based on your rank. I think it would require under standing of Basic Admin Essentials to make it work.

I think it would require under standing of Basic Admin Essentials to make it work.

thats the point, you require scripting knowledge too.

Check the player rank and determine whether to add “[Admin]” next to the name or not.

local SenderStr = player.Name

if not (playerRank < 1) then
    SenderStr = "[Admin] " .. SenderStr
end

It would be easier to create your own admin system so you’d know what you were doing, rather than editing someone else’s previously written system and trying to decipher what they wrote.

1 Like

It’s Basic Admin Essentials and it’s open source, so it’s able to be modified.

The only thing about this is that it gets the rank of the player when its supposed to be getting the rank of the sender and displaying it to the other player.

I am not familiar with “Basic Admin Essentials” but, I think if you can get the rank of that user you can set it up with rich text doing something like this.

local rank = "rank you got from the system"
pendNotif("Private Message","From "..Sender.. '<font transparency="0.65"><font face="Gotham">'..rank..'</font></font>',{"Receive",Sender,Data,true,ID}

You would need to return the players’ current permission from the basic admin main module.

local playerpermission = returnPermission(Sender)
local rank 
if  playerpermission = 0 then 
    rank = "Nonadmin"
elseif playerpermission = 1 then 
    rank = "Moderator"
elseif playerpermission = 2 then
    rank = "Administrator" 
elseif playerpermission = 3 then
    rank = "Super Administrator"
elseif playerpermission = 4 then
    rank = "Owner"
end
pendNotif("Private Message","From "..Sender.. '<font transparency="0.65"><font face="Gotham">'..rank..'</font></font>',{"Receive",Sender,Data,true,ID}

If you would like to change the variables, you can but I’d recommend you keep it that way. Hopefully this should work.