Yes, that is what I mean but how could I adapt it so it is like for a rank in a group so. Let’s say, all ranks above the rank ID 12 get it, how could I do that where it is like (NAME) (RANK) Has joined the game!
What do you mean by (RANK)? Rank ID or name? I don’t know how to convert RankId to RankName.
But for (NAME) it would be player.Name? I don’t know if that would make it say every player’s name.
I’ll start on it now.
Do you want to have it in the chat?
Also, I have altered the game to say the owner has joined to all players when the owner joins. Using MultiRblx to test this though…
So like at my group we have ranks, lets say I wanted the rank Board Of Director to be notified upon joining.
WAIT, you mean… you don’t want all players to be notified? Just a certain rank?
No I want all the players to be notified when a certain rank joins the game.
Try this script:
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(GroupId) == RankId then
-- Use my notification thing to send a notification that a player in (RANK NAME) has joined the game
-- I think you can also make it say that player's name without it saying all players name.
else
-- Nothing
end
end)
On the owner script thing where it says IconLink do I put my profile ID there?
No, what you do there is pretty simple, I am not gonna make a script for this just in case I get it wrong but try looking here: Players | Documentation - Roblox Creator Hub
Thanks for your help, do you have discord so I can more easily speak with you? My code - hireimgeorge#4510
There is a way to grab the image of a player. There is a forum post that has the links for you to use here: New image endpoints that can be used in-game!
ServerScriptService
Insert a Script, then insert a ModuleScript inside of it. Call the Script “PlayerJoined”, then the ModuleScript “Index”. Put this in the Script:
local GroupID = 4530974 -- Get it from your browser, if you didn't know.
local RankIndex = require(script.Index)
game.Players.PlayerAdded:Connect(function(player)
local playerRank = player:GetRankInGroup(GroupID)
if playerRank > 1 then
game.ReplicatedStorage.Groups.CreateChatMessage:FireAllClients("Player Joined", player.Name .. " [" .. RankIndex[playerRank] .. "] has joined the game!") -- First argument is the title, second argument is the message.
end
end)
local RoleIndex = {
[1] = "Fans";
[127] = "YouTube Partners";
[254] = "XGetRect9X";
[255] = "MaximussDev";
--[[ These are roles in my group. Make sure to change the number (i.e. 127) to your own (get it from the ConfigureGroup page, and then in the Roles Section,
Click on each role and get the rank number.
]]--
}
return RoleIndex
Now, insert a Folder into your ReplicatedStorage, and then call it “Groups”. Insert a RemoteEvent into the Folder, and call it “CreateChatMessage”.
LocalScript in StarterPlayer > StarterPlayerScripts
Now make a LocalScript in StarterPlayer > StarterPlayerScripts, and call it “GroupChatMessage”. Put this in:
game.ReplicatedStorage.Groups.CreateChatMessage.OnClientEvent:Connect(function(title, message)
-- I used this part from MrOofBoyPlayz's code. Thanks. :)
game.StarterGui:SetCore("SendNotification", {
Title = title;
Text = message;
})
end)
This will send a Notification (just like what @MrOofBoyPlayz used) to all players, but only when a player above rank 1 joins. Normal players joining won’t.
Hope this helped!
Silly max, I used a event to fire a notification.
Nevermind, I see, you did use it
You can also add a third argument, called “Type”, and send multiple messages through one event.
lol
Also, I think he can now mark one of my reply’s as answered, since I helped him through the power of…
DISCORD!
AAAAAAA…
Dramatics over
Woahhh thanks! How would I make it send a sound too?
Just put it in workspace and go workspace.SoundName:Play() when its fired lol?
Alright. Thanks for the method, anyways.
I personally don’t like SetCore, so what I would do is make an user interface beforehand that has a nice theme to it, and put an ImageLabel on it, along with two TextLabels: the title, and the text.
Then, I would put a tweening transition in the ScreenGui, and put it in a module and make a function for it, so I can use the UI for other purposes too. The function would have parameters for the player’s UserId (so I can get the user thumbnail of the player using GetUserThumbnailAsync, Players | Documentation - Roblox Creator Hub), the title of the notification, and the text. The function would place the UI in every player’s PlayerGui into the game after its ImageLabel and two TextLabels are formatted for the player who joined. (Except if you want it so that everyone except the HR can view it).
After making the function, I would require the module in a script, that script that from there.
I’m not going to spoonfeed this to you, so here’s a learning opportunity.
You can check whenever a player joins using PlayerAdded, if they are above a certain rank, such as the lowest High Rank in your situation. If they are, the Notify function of the module is used, and you give the parameters of the player’s UserId, the title of the notification, and the text, which you can easily do on your own.
Note: This isn’t really advanced, but you can make it better from here.
Hope this helped!
PS: Sorry for the terrible grammar, I just woke up.
This is another way of doing it. I never use SetCore as I make my own UIs that go with my game’s interface, but SetCore is a good way for people who would rather not.