Greetings,
I am gonna be showing you guys a clean method to using HTTPService to notify you when a star creator joins you game!
This can be useful for engagement of your game and also to let you/your team know when a star creator joins. (Proud moment eh?)
So lets get into the procedure,
Step 1
Create a RemoteEvent and name it whatever you wish like, here I have named it as “StarCreatorEvent”
Step 2
Create a script in ServerScriptService and name it CreatorJoin (Your wish to rename)
Step 3
Create your discord Webhook!
Click on the Gear icon
Click on Integrations and Create a New Webhook
Copy Webhook URL and save changes!
Step 4
Lets get into scripting! :-
Open the CreatorJoin script and enter the following -
local Group = 4199740 --The Star Creators' Group ID
local Minimum = 1
local ReplicatedEvent = game:GetService("ReplicatedStorage").StarCreatorEvent
local Webhook = "Your webhook here"
local HTTPService = game:GetService("HttpService")
local Format = 'https://www.roblox.com/headshot-thumbnail/image?userId=%s&width=420&height=420&format=png'
game:GetService("Players").PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(Group) >= Minimum or Player.UserId == 1612496695 then -- Test it using your own Player ID
local TimeFormat = os.date('%I:%M | %x')
local PlayerUserId = Player.UserId
local Thumbnail = string.format(Format,PlayerUserId)
local data = {
['embeds'] = {
{
['author'] = {name=Player.Name,icon_url=Thumbnail},
['title'] = "**⭐ A Star Creator Has Joined! ⭐ **",
['description'] = Player.Name.." has joined your game :D !",
['fields'] ={
{name='Name 💬',value=Player.Name,inline=true},
{name='UserId 🕵️♀️',value=Player.UserId,inline=true},
{name='Game Name 🎮',value=game.Name,inline=false},
{name='Game ID 🗂',value=game.GameId,inline=true},
{name='Time ⌚',value=TimeFormat,inline=false}
},
['url'] = "https://www.roblox.com/users/".. PlayerUserId .. "/profile",
}
}
}
ReplicatedEvent:FireAllClients(Player.Name, Player.UserId)
local FinalData = HTTPService:JSONEncode(data)
HTTPService:PostAsync(Webhook, FinalData)
end
end)
CAUTION : DO NOT REVEAL YOUR WEBHOOK URL IN PUBLIC
There you go! This can also be done using Roblox Admin’s group ID for example to notify when an Admin joins and editting the embedded a little bit (Any group can be used!)
Result: (Example)
I hope this tutorial would help you in your future projects C:
Remember, you can always edit the group ID and embedded features to experience this feature your own way!
All the best :>