Hi! This is my first forums post so if I’m in the wrong place just tell me.
First lets start with "what is a discord webhook proxy?"
A discord webhook is using Roblox to send messages in discord. Discord did not like roblox sending messages though the servers, so you can only send the in studio. until now.
Using proxys:
If you are viewing this tutorial I assume you have some knowledge with using webhooks. If not, use this tutorial by @WaterJamesPlough.
Anyhow, a normal webhook should look something like
https://discordapp.com/api/webhooks/xxxxxx/xxxxxxx
. This can only be send using Roblox Studio. If you want to send it through a server, then instead of https://discordapp.com/api/webhooks/xxxxxx/xxxxxxx
use https://hooks.hyra.io/api/webhooks/xxxxxx/xxxxxxx
. This will allow you to send messages though the server. An example of a player joined logging I made looks like this:
example
local DataStore = game:GetService("DataStoreService"):GetDataStore("VisitsStore")
local DataStore = game:GetService("DataStoreService"):GetDataStore("VisitsStore")
local TimePlayedStart = os.time()
game.Players.PlayerAdded:Connect(function(plr)
pcall(function()
if not DataStore:GetAsync(plr.UserId.."-".."visits") then
amount.Value = 0
else
amount.Value = DataStore:GetAsync(plr.UserId.."-".."visits")
end
amount.Value = amount.Value + 1
DataStore:SetAsync(plr.UserId.."-".."visits", amount.Value)
end)
end)
game.Players.PlayerRemoving:Connect(function(plr)
local HookData = {
["embeds"] = {{
['username'] = "Plr joined Bot",
["title"] = plr.Name.." joined the game for the "..DataStore:GetAsync(plr.UserId.."-".."visits")..afterword.." time",
["type"] = "rich",
["color"] = tonumber(0x4287f5)
}}
}
HookData = http:JSONEncode(HookData)
if not game:GetService("RunService"):IsStudio() then
http:PostAsync("https://hooks.hyra.io/api/webhooks/xxxx", HookData)
end
end)
This script will log how many times the player has joined and how long they joined for. This is very useful for tracking where people get in your game.
Thanks for looking at this tutorial. I hoped you learned a lot and might use this knowledge in your future games. If you have any questions please put them in the comments!