-- ServerScriptService
```
-- RoHook Created By LuaScape
local HTTP = game:GetService("HttpService")
local webhookurl = "잔디 Webhook(incoming) URL 주소" -- This can be found by going into your discord server settings then going to integrations then going to webhooks
local function SendReport(player)
-- local character = player.Character
-- local hmndrootpart = character:FindFirstChild("HumanoidRootPart")
local data = {
["body"] = "[[Alert]](http://url_to_text) 새로운 방문자가 들어왔습니다.",
["connectColor"] = "#FAC11B",
["connectInfo"] = {{
["title"] = player.Name,
["description"] = "play started"
},
{
["title"] = 'Location',
["description"] = "Empire State Building, 5th Ave, New York",
["imageUrl"] = "http://url_to_text"
}
}
}
local response = HTTP:RequestAsync(
{
Url = webhookurl, -- This website helps debug HTTP requests
Method = "POST",
Headers = {
["Accept"] = "application/vnd.tosslab.jandi-v2+json",
["Content-Type"] = "application/json" -- When sending JSON, set this!
},
Body = HTTP:JSONEncode(data)
}
)
-- Inspect the response table
if response.Success then
print("Status code:", response.StatusCode, response.StatusMessage)
print("Response body:\n", response.Body)
else
print("The request failed:", response.StatusCode, response.StatusMessage)
end
end
-- This is just an EXAMPLE you should not log everytime a player joins
game.Players.PlayerAdded:Connect(function(player)
wait(5)
SendReport(player)
end)
```
-- jandi message screen capture
References
잔디 커넥트 인커밍 웹훅(Incoming Webhook)으로 외부 데이터를 잔디 메시지로 수신하기
Webhook이란? 웹훅(Webhook)이란 잔디에 잔디가 정한 포맷에 일치하는 데이터를 수신하여 지정된 대화에 메시지 형태로 전송해주는 기능을 말합니다. 현재 잔디 커넥트에서 지원하지 않고 있는 서비
support.jandi.com
- https://developer.roblox.com/en-us/api-reference/function/HttpService/RequestAsync
HttpService:RequestAsync
This Platform uses cookies to offer you a better experience, to personalize content, to provide social media features and to analyse the traffic on our site. For further information, including information on how to prevent or manage the use of cookies on t
developer.roblox.com
- How To Send Information To Discord Webhooks From Roblox
-- discord webhook lua script (discord windows 설치 오류 빈번하여 잔디 webhook 사용으로 변경)
-- discord webhook example
```
-- RoHook Created By LuaScape
local HTTP = game:GetService("HttpService")
local webhookurl = "URL HERE" -- This can be found by going into your discord server settings then going to integrations then going to webhooks
local function SendReport(player, reason)
local data = {
["embeds"] = {{
["author"] = {
["name"] = player.Name,
["icon_url"] = "https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username="..player.Name
},
["description"] = "Kicked For: " .. reason,
["color"] = tonumber(0xFFFAFA),
["fields"] = {
{
["name"] = "Account Age:",
["value"] = player.AccountAge,
["inline"] = true
},
{
["name"] = "User ID:",
["value"] = player.UserId,
["inline"] = true
}
}
}},
}
local finaldata = HTTP:JSONEncode(data)
HTTP:PostAsync(webhookurl, finaldata)
end
--[[
This is just an EXAMPLE you should not log everytime a player joins
game.Players.PlayerAdded:Connect(function(p)
wait(5)
SendReport(p, "Doing Bad Stuff")
end)]]
```
'tech > game' 카테고리의 다른 글
21/07/28 How to Make a Shop Menu GUI [Updated Version] - Roblox Studio Tutorial (0) | 2021.07.28 |
---|---|
21/07/28 ROBLOX Best Plugins (2021) (0) | 2021.07.28 |
21/07/27 로블록스 게임 만들기 #3/3 - 리오아빠 - Leo's Daddy (0) | 2021.07.27 |
21/07/27 로블록스 게임 만들기 #2/3 - 리오아빠 - Leo's Daddy (0) | 2021.07.27 |
21/07/27 로블록스 게임 만들기 #1/3 - 리오아빠 - Leo's Daddy (0) | 2021.07.27 |