Roblox Forum banner
1 - 14 of 14 Posts

·
Registered
Joined
·
4 Posts
Discussion Starter · #1 ·
local HTTP = game:GetService("HttpService")
local Key = "(delet this and put your webhook key, the long link on the webhook details in discord)"
local HookData = {
['content'] = "";
}

game.Players.PlayerAdded:connect(function(player)
HookData.content = ("**" .. player.Name .. "**" .. " has joined the server!")
HTTP:postAsync(Key, HTTP:JSONEncode(HookData))
end)

game.Players.PlayerRemoving:connect(function(player)
HookData.content = ("**" .. player.Name .. "**" .. " has left the server!")
HTTP:postAsync(Key, HTTP:JSONEncode(HookData))
end)
 

·
Registered
Joined
·
52 Posts
local HTTP = game:GetService("HttpService")
local Key = "(delet this and put your webhook key, the long link on the webhook details in discord)"
local HookData = {
['content'] = "";
}

game.Players.PlayerAdded:connect(function(player)
HookData.content = ("**" .. player.Name .. "**" .. " has joined the server!")
HTTP:postAsync(Key, HTTP:JSONEncode(HookData))
end)

game.Players.PlayerRemoving:connect(function(player)
HookData.content = ("**" .. player.Name .. "**" .. " has left the server!")
HTTP:postAsync(Key, HTTP:JSONEncode(HookData))
end)
THX!
 

·
Premium Member
Joined
·
664 Posts
How this works

Code:
-- variables
local HTTP = game:GetService("HttpService")
local Key = " **insert webhook key here** "
local HookData = {
['content'] = "null";
}

HookData.content = "**This will be sent to a Discord webhook." -- changes "null" to this text.
HTTP:PostAsync(Key, HTTP:JSONEncode(HookData))
end)

-- I don't know anything about Discord webhooks :/ ..but this is what happens on the roblox side.
 

·
Registered
Joined
·
52 Posts
Code:
local HTTP = game:GetService("HttpService")
local Key = "(delet this and put your webhook key, the long link on the webhook details in discord)"
local HookData = {
['content'] = "";
}

game.Players.PlayerAdded:connect(function(player)
HookData.content = ("**" .. player.Name .. "**" .. " has joined the server!")
HTTP:postAsync(Key, HTTP:JSONEncode(HookData))
end)

game.Players.PlayerRemoving:connect(function(player)
HookData.content = ("**" .. player.Name .. "**" .. " has left the server!")
HTTP:postAsync(Key, HTTP:JSONEncode(HookData))
end)
 

·
Registered
Joined
·
2,707 Posts
local HTTP = game:GetService("HttpService")
local Key = "(delet this and put your webhook key, the long link on the webhook details in discord)"
local HookData = {
['content'] = "";
}

game.Players.PlayerAdded:connect(function(player)
HookData.content = ("**" .. player.Name .. "**" .. " has joined the server!")
HTTP:postAsync(Key, HTTP:JSONEncode(HookData))
end)

game.Players.PlayerRemoving:connect(function(player)
HookData.content = ("**" .. player.Name .. "**" .. " has left the server!")
HTTP:postAsync(Key, HTTP:JSONEncode(HookData))
end)
Is this before scripting?
 
1 - 14 of 14 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top