HR Join Message

Yea, this is already open-sourced on the devfourm


Local Script in the Starter Gui:
game.ReplicatedStorage.JoinNotify.OnClientEvent:Connect(function(CustomTitle,CustomText,CustomImage)
   pcall(function()
    game.StarterGui:SetCore('SendNotification', {
        Title = CustomTitle,
        Text = CustomText,
        Icon = CustomImage,
        Duration = 13
    })
   end)
end)

Server Script in the ServerScriptStorage

local JoinNotify = game.ReplicatedStorage.JoinNotify

local function SyncAPI(...)
   JoinNotify:FireAllClients(...)
end

game.Players.PlayerAdded:Connect(function(Player)
    if Player:GetRankInGroup(YourGroupId) >= HrRank then
        local AdminTitle = ''..Player.Name
        local AdminText = Player:GetRankInGroup(YourGroupId)..', Has joined the game!'
        local UserId = Player.UserId
        local Size = Enum.ThumbnailSize.Size420x420 --Dont Change
        local Type = Enum.ThumbnailType.HeadShot
        local AdminImage = game.Players:GetUserThumbnailAsync(UserId, Type, Size)
        SyncAPI(AdminTitle,AdminText,AdminImage)
    end
end)

Guide

--[[
	Replace
	Player:GetRankInGroup(YourGroupId) >= HrRank [HrRank is for the people that are allowed on the Join Message!]
	Player:GetRankInGroup(YourGroupId)..', Has joined the game!'
	Change "Has joined the game!" to anything you want!
    "Enum.ThumbnailType.HeadShot" You can change it to anything you want
    These are the one that are there:
    Enum.ThumbnailType.AvatarThumbnail
    Enum.ThumbnailType.HeadShot --Default
    Enum.ThumbnailType.AvatarBust
    Edit:
    Use GetRoleInGroup.
--]]

You need a RemoteEvent in the ReplicatedStorage and name it JoinNotify

4 Likes

Nice!
I think this is a lifesaver for cafe and hotel games, although the trolls and exploiters will start getting a heart attack when they see the notification and stop breaking the rules.

Yeah, agree’d @dan

Most are alt accounts though.

Wow what a useful code thanks. This can really help prevent exploiters

Psst, you wouldn’t use game.<service>, instead use game:GetService – it’s the ‘proper’ way to get a service.

1 Like

That’s just non necessary and extra.
If you look at UserInputService you are supposed to use GetService in order to get the service.

I agree with what @Viken said because it’s extra.